From ccbf085095addb7c55e341391cc899181040fc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 21 Dec 2020 17:59:28 +0100 Subject: [PATCH] Improve local pre-commit experience --- .pre-commit-config-slow.yaml | 7 +++++++ .pre-commit-config.yaml | 5 ----- MANIFEST.in | 1 + noxfile.py | 3 +++ tox.ini | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .pre-commit-config-slow.yaml diff --git a/.pre-commit-config-slow.yaml b/.pre-commit-config-slow.yaml new file mode 100644 index 000000000..2179c6657 --- /dev/null +++ b/.pre-commit-config-slow.yaml @@ -0,0 +1,7 @@ +# Slow pre-commit checks we don't want to run locally with each commit. + +repos: +- repo: https://github.com/mgedmin/check-manifest + rev: '0.43' + hooks: + - id: check-manifest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 838b1f24e..4eadea08c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,8 +97,3 @@ repos: entry: NEWS fragment files must be named *.(process|removal|feature|bugfix|vendor|doc|trivial).rst exclude: ^news/(.gitignore|.*\.(process|removal|feature|bugfix|vendor|doc|trivial).rst) files: ^news/ - -- repo: https://github.com/mgedmin/check-manifest - rev: '0.43' - hooks: - - id: check-manifest diff --git a/MANIFEST.in b/MANIFEST.in index 24d455378..2cf636ce3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,6 +17,7 @@ exclude .appveyor.yml exclude .travis.yml exclude .readthedocs.yml exclude .pre-commit-config.yaml +exclude .pre-commit-config-slow.yaml exclude tox.ini exclude noxfile.py diff --git a/noxfile.py b/noxfile.py index 29e3959e4..372defef5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -149,6 +149,9 @@ def lint(session): args = ["--all-files", "--show-diff-on-failure"] session.run("pre-commit", "run", *args) + session.run( + "pre-commit", "run", "-c", ".pre-commit-config-slow.yaml", *args + ) @nox.session diff --git a/tox.ini b/tox.ini index 9c20759af..e458e374b 100644 --- a/tox.ini +++ b/tox.ini @@ -64,6 +64,7 @@ commands_pre = deps = pre-commit commands = pre-commit run [] --all-files --show-diff-on-failure + pre-commit run [] -c .pre-commit-config-slow.yaml --all-files --show-diff-on-failure [testenv:vendoring] basepython = python3