diff options
| author | Adam Zapletal <adamzap@gmail.com> | 2024-12-20 14:48:08 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-20 21:48:08 +0100 |
| commit | 6dc8f418e6b652863ccb16a3e2e01795e8a89d9f (patch) | |
| tree | 2b2b7394bcf8c37eedb0bcf4ddec96e6206299ed /.pre-commit-config.yaml | |
| parent | a4bb1d7550a3ee4236e5be503018792e1cea8d11 (diff) | |
Run `prettier` on JavaScript via `pre-commit`
This patch removes the global `djangoproject/static/*` exclude rule in
`.pre-commit-config.yaml` to enable `prettier` to run on this project's
JavaScript files. The `djangoproject/static/js/lib/` directory is now
excluded in the `prettier` hook because there is no value in
reformatting a minified JavaScript file.
I also added a `.prettierrc` file to the root of the project to control
JavaScript formatting.
Refs #1827
Diffstat (limited to '.pre-commit-config.yaml')
| -rw-r--r-- | .pre-commit-config.yaml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a9e918f..ab794f30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -exclude: '(^djangoproject\/static\/.*$)' +exclude: '^djangoproject\/static\/(css\/|fonts\/|img\/|robots).*$' default_language_version: python: python3 repos: @@ -19,6 +19,7 @@ repos: - id: debug-statements - id: detect-private-key - id: end-of-file-fixer + exclude: '(^djangoproject\/static\/js\/lib\/.*$)' exclude_types: [json, sql] - id: file-contents-sorter files: ^(requirements/\w*.txt)$ @@ -46,6 +47,7 @@ repos: hooks: - id: prettier exclude_types: [html, json, scss] + exclude: '(^djangoproject\/static\/js\/lib\/.*$)' - repo: https://github.com/pycqa/isort rev: "5.13.2" hooks: |
