Skip to content

Commit b3941de

Browse files
authored
Merge pull request #189 from TotallyNotRobots/nitpick
ci: add workflow to run nitpick
2 parents fe0e788 + 8d1abb4 commit b3941de

File tree

3 files changed

+159
-102
lines changed

3 files changed

+159
-102
lines changed

.github/workflows/nitpick.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Run nitpick to sync CI configs
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1' # Every Monday at 03:00 UTC
6+
workflow_dispatch:
7+
8+
env:
9+
HATCH_VERSION: "1.15.1"
10+
11+
jobs:
12+
nitpick:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
23+
with:
24+
python-version: '3.14'
25+
26+
- name: Install Hatch
27+
uses: pypa/hatch@install
28+
with:
29+
version: "${{ env.HATCH_VERSION }}"
30+
31+
- name: Run nitpick
32+
run: hatch run pre-commit:run nitpick --all || true
33+
shell: bash
34+
35+
- name: Run pre-commit
36+
shell: bash
37+
run: |
38+
n=0
39+
while [[ $n -lt 5 ]] && ! hatch run pre-commit:run; do
40+
((n++))
41+
done
42+
exit $?
43+
44+
- name: Create Pull Request
45+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
46+
with:
47+
commit-message: "ci(nitpick): Sync CI configs"
48+
title: "ci(nitpick): Sync CI configs"
49+
body: "Automated run of nitpick fix."
50+
branch: "nitpick"
51+
base: ${{ github.ref_name }}
52+
labels: "nitpick"
53+
reviewers: "linuxdaemon"
54+
assignees: "linuxdaemon"
55+
sign-commits: true

.github/workflows/python-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
with:
4747
version: "${{ env.HATCH_VERSION }}"
4848

49+
- run: hatch env find
50+
4951
- name: Run type check
5052
run: hatch run types:check
5153

.pre-commit-config.yaml

Lines changed: 102 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,104 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
4-
hooks:
5-
- id: trailing-whitespace
6-
args:
7-
- --markdown-linebreak-ext=md,markdown
8-
- id: end-of-file-fixer
9-
- id: check-yaml
10-
- id: check-added-large-files
11-
- id: check-ast
12-
- id: fix-byte-order-marker
13-
- id: check-merge-conflict
14-
- id: debug-statements
15-
- id: detect-private-key
16-
- id: check-builtin-literals
17-
- id: check-case-conflict
18-
- id: check-docstring-first
19-
- id: check-executables-have-shebangs
20-
- id: check-shebang-scripts-are-executable
21-
- id: check-symlinks
22-
- id: mixed-line-ending
23-
args:
24-
- --fix=lf
25-
- id: check-json
26-
exclude: ^\.(vscode|devcontainer)/
27-
- id: pretty-format-json
28-
exclude: ^\.(vscode|devcontainer)/
29-
args:
30-
- --indent
31-
- '4'
32-
- --autofix
33-
- --no-sort-keys
34-
- id: check-toml
35-
- repo: https://github.com/bwhmather/ssort
36-
rev: 2dd40ba37fdd472ce996668ea415077d756e651b # frozen: 0.15.0
37-
hooks:
38-
- id: ssort
39-
- repo: https://github.com/psf/black
40-
rev: af0ba72a73598c76189d6dd1b21d8532255d5942 # frozen: 25.9.0
41-
hooks:
42-
- id: black
43-
- repo: https://github.com/pycqa/isort
44-
rev: 0a09c783808cfe77bb3269250f663ff733d23302 # frozen: 7.0.0
45-
hooks:
46-
- id: isort
47-
- repo: https://github.com/pre-commit/pygrep-hooks
48-
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316
49-
hooks:
50-
- id: python-no-eval
51-
- id: python-no-log-warn
52-
- repo: https://github.com/ikamensh/flynt
53-
rev: 97be693bf18bc2f050667dd282d243e2824b81e2 # frozen: 1.0.6
54-
hooks:
55-
- id: flynt
56-
- repo: https://github.com/asottile/pyupgrade
57-
rev: f90119b1b8bd9e46949d9592972b2c4c27d62a97 # frozen: v3.21.0
58-
hooks:
59-
- id: pyupgrade
60-
args:
61-
- --py310-plus
62-
- repo: https://github.com/MarcoGorelli/auto-walrus
63-
rev: ba0661836089a532a710f68713a3e3e53f7f0113 # frozen: 0.3.4
64-
hooks:
65-
- id: auto-walrus
66-
additional_dependencies:
67-
- tomli ; python_version < '3.11'
68-
- repo: https://github.com/codespell-project/codespell
69-
rev: 63c8f8312b7559622c0d82815639671ae42132ac # frozen: v2.4.1
70-
hooks:
71-
- id: codespell
72-
additional_dependencies:
73-
- tomli ; python_version < '3.11'
74-
- repo: https://github.com/commitizen-tools/commitizen
75-
rev: cc981fcb065527b6de0033b0cbf0432e69781901 # frozen: v4.9.1
76-
hooks:
77-
- id: commitizen
78-
- repo: local
79-
hooks:
80-
# - id: hatch-fmt
81-
# entry: hatch fmt
82-
# language: system
83-
# name: hatch fmt
84-
# types:
85-
# - python
86-
- id: hatch-types
87-
entry: hatch run types:check
88-
language: system
89-
name: hatch types
90-
types:
91-
- python
92-
- repo: https://github.com/andreoliwa/nitpick
93-
rev: 'a1373f03f5a9394c75cc03e5da1b0cb6ff615dbb' # frozen: v0.38.0
94-
hooks:
95-
- id: nitpick
96-
- repo: https://github.com/PyCQA/autoflake
97-
rev: '0544741e2b4a22b472d9d93e37d4ea9153820bb1' # frozen: v2.3.1
98-
hooks:
99-
- id: autoflake
100-
minimum_pre_commit_version: 2.18.0
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
args:
7+
- --markdown-linebreak-ext=md,markdown
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-ast
12+
- id: fix-byte-order-marker
13+
- id: check-merge-conflict
14+
- id: debug-statements
15+
- id: detect-private-key
16+
- id: check-builtin-literals
17+
- id: check-case-conflict
18+
- id: check-docstring-first
19+
- id: check-executables-have-shebangs
20+
- id: check-shebang-scripts-are-executable
21+
- id: check-symlinks
22+
- id: mixed-line-ending
23+
args:
24+
- --fix=lf
25+
- id: check-json
26+
exclude: ^\.(vscode|devcontainer)/
27+
- id: pretty-format-json
28+
exclude: ^\.(vscode|devcontainer)/
29+
args:
30+
- --indent
31+
- '4'
32+
- --autofix
33+
- --no-sort-keys
34+
- id: check-toml
35+
- repo: https://github.com/bwhmather/ssort
36+
rev: 2dd40ba37fdd472ce996668ea415077d756e651b # frozen: 0.15.0
37+
hooks:
38+
- id: ssort
39+
- repo: https://github.com/psf/black
40+
rev: af0ba72a73598c76189d6dd1b21d8532255d5942 # frozen: 25.9.0
41+
hooks:
42+
- id: black
43+
- repo: https://github.com/pycqa/isort
44+
rev: 0a09c783808cfe77bb3269250f663ff733d23302 # frozen: 7.0.0
45+
hooks:
46+
- id: isort
47+
- repo: https://github.com/pre-commit/pygrep-hooks
48+
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316
49+
hooks:
50+
- id: python-no-eval
51+
- id: python-no-log-warn
52+
- repo: https://github.com/ikamensh/flynt
53+
rev: 97be693bf18bc2f050667dd282d243e2824b81e2 # frozen: 1.0.6
54+
hooks:
55+
- id: flynt
56+
- repo: https://github.com/asottile/pyupgrade
57+
rev: f90119b1b8bd9e46949d9592972b2c4c27d62a97 # frozen: v3.21.0
58+
hooks:
59+
- id: pyupgrade
60+
args:
61+
- --py310-plus
62+
- repo: https://github.com/MarcoGorelli/auto-walrus
63+
rev: ba0661836089a532a710f68713a3e3e53f7f0113 # frozen: 0.3.4
64+
hooks:
65+
- id: auto-walrus
66+
additional_dependencies:
67+
- tomli ; python_version < '3.11'
68+
- repo: https://github.com/codespell-project/codespell
69+
rev: 63c8f8312b7559622c0d82815639671ae42132ac # frozen: v2.4.1
70+
hooks:
71+
- id: codespell
72+
additional_dependencies:
73+
- tomli ; python_version < '3.11'
74+
- repo: https://github.com/commitizen-tools/commitizen
75+
rev: cc981fcb065527b6de0033b0cbf0432e69781901 # frozen: v4.9.1
76+
hooks:
77+
- id: commitizen
78+
- repo: local
79+
hooks:
80+
# - id: hatch-fmt
81+
# entry: hatch fmt
82+
# language: system
83+
# name: hatch fmt
84+
# types:
85+
# - python
86+
- id: hatch-types
87+
entry: hatch run types:check
88+
language: system
89+
name: hatch types
90+
types:
91+
- python
92+
- repo: https://github.com/andreoliwa/nitpick
93+
rev: 'a1373f03f5a9394c75cc03e5da1b0cb6ff615dbb' # frozen: v0.38.0
94+
hooks:
95+
- id: nitpick
96+
- repo: https://github.com/PyCQA/autoflake
97+
rev: '0544741e2b4a22b472d9d93e37d4ea9153820bb1' # frozen: v2.3.1
98+
hooks:
99+
- id: autoflake
100+
minimum_pre_commit_version: 4.3.0
101101
default_install_hook_types:
102-
- pre-commit
103-
- pre-push
104-
- commit-msg
102+
- pre-commit
103+
- pre-push
104+
- commit-msg

0 commit comments

Comments
 (0)