Skip to content

Commit

Permalink
Add pre-commit config with sensible hooks; apply those hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejalim committed Jan 24, 2024
1 parent 111c78f commit 235af88
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

# Global excludes, override per repo below if different excludes required.
# exclude: >
# (?x)^(
# DIRNAME_OR_FILENAME_HERE
# | DIRNAME_OR_FILENAME_HERE
# | DIRNAME_OR_FILENAME_HERE
# )
repos:
# Note: hooks that add content must run before ones which check formatting, lint, etc
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Community Participation Guidelines

This repository is governed by Mozilla's code of conduct and etiquette guidelines.
This repository is governed by Mozilla's code of conduct and etiquette guidelines.
For more details, please read the
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).

## How to Report
For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

2 changes: 1 addition & 1 deletion docs/trusted_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ dangerous sink that requires Trusted Types.
``Step 3: Enforce Trusted Types``
=================================
Once you have addressed all of the Trusted Types violations present in your
application, you can begin enforcing Trusted Types to prevent DOM XSS.
application, you can begin enforcing Trusted Types to prevent DOM XSS.

Configure django-csp so that ``CSP_REPORT_ONLY`` is set to *False*.

Expand Down
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ docstring-code-format = false
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
docstring-code-line-length = "dynamic"

0 comments on commit 235af88

Please sign in to comment.