Skip to content

Commit

Permalink
Exclude migrations, vendor, .min.js, .svg, and static/*.js from pre-c…
Browse files Browse the repository at this point in the history
…ommit (#211)

* Exclude vendor, .min.js, .svg, and static/*.js from pre-commit

Those files are copied from other sources or edited by other tools
and IMHO not subject for pre-commit handling.

Refs:
- readthedocs/readthedocs.org#11200
- readthedocs/readthedocs.org#11199

* Exclude migrations from isort, black, and pre-commit-hooks tuneups
  • Loading branch information
yarikoptic authored Oct 14, 2024
1 parent f47b4b5 commit 24ecab8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: '^$|settings|scripts'
exclude: '^$|settings|scripts|vendor|\.(min\.js|svg)$|static/.*\.js$'
fail_fast: false
repos:

Expand Down Expand Up @@ -33,6 +33,7 @@ repos:
.+\.svg|
.+\.js|
.+\.css|
.*/migrations/.*|
)$
- id: mixed-line-ending
args: ['--fix=lf']
Expand Down Expand Up @@ -68,6 +69,7 @@ repos:
exclude: |
(?x)^(
readthedocs/rtd_tests/files/conf.py|
.*/migrations/.*
)$
# NOTE: run `isort` after `black` to keep the format of isort finally
Expand All @@ -76,6 +78,10 @@ repos:
hooks:
- id: isort
name: isort (python)
exclude: |
(?x)^(
.*/migrations/.*
)
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
Expand Down

0 comments on commit 24ecab8

Please sign in to comment.