Skip to content

Commit 0d54193

Browse files
authored
Merge pull request #656 from fizyk/pre-commit
Use pre-commit, drop old linters workflow (and add rstcheck) - closes…
2 parents f5168c8 + 8509ee7 commit 0d54193

20 files changed

+94
-32
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
include =
33
matchbox/*
44
tests/*
5-
benchmarks/*
5+
benchmarks/*

.github/workflows/automerge.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ jobs:
1616
secrets:
1717
app_id: ${{ secrets.MERGE_APP_ID }}
1818
private_key: ${{ secrets.MERGE_APP_PRIVATE_KEY }}
19-

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ on:
88

99
jobs:
1010
build:
11-
uses: fizyk/actions-reuse/.github/workflows/shared-pypi.yml@v3.0.2
11+
uses: fizyk/actions-reuse/.github/workflows/shared-pypi.yml@v3.0.2

.github/workflows/linters.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ on:
66

77
jobs:
88
pr-check:
9-
uses: fizyk/actions-reuse/.github/workflows/shared-pr-check.yml@v3.0.2
9+
uses: fizyk/actions-reuse/.github/workflows/shared-pr-check.yml@v3.0.2

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Run linters
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
10+
jobs:
11+
pre-commit:
12+
uses: fizyk/actions-reuse/.github/workflows/shared-pre-commit.yml@v3.0.1

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ jobs:
99
with:
1010
publish: true
1111
secrets:
12-
pypi_token: ${{ secrets.pypi_token }}
12+
pypi_token: ${{ secrets.pypi_token }}

.github/workflows/sphinx-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
publish_dir: build/html/
2626
destination_dir: docs/
2727
enable_jekyll: false
28-
keep_files: false
28+
keep_files: false

.pre-commit-config.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
ci:
3+
skip: [pipenv, mypy]
4+
5+
# See https://pre-commit.com for more information
6+
# See https://pre-commit.com/hooks.html for more hooks
7+
minimum_pre_commit_version: 4.0.0
8+
default_stages: [pre-commit]
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v5.0.0
12+
hooks:
13+
- id: check-added-large-files
14+
- id: check-case-conflict
15+
- id: check-merge-conflict
16+
- id: trailing-whitespace
17+
- id: check-toml
18+
- id: end-of-file-fixer
19+
- id: mixed-line-ending
20+
- id: check-yaml
21+
- id: pretty-format-json
22+
- id: detect-private-key
23+
- id: debug-statements
24+
25+
- repo: https://github.com/psf/black
26+
rev: 25.1.0
27+
hooks:
28+
- id: black
29+
entry: black --config pyproject.toml .
30+
31+
- repo: https://github.com/astral-sh/ruff-pre-commit
32+
rev: v0.9.6
33+
hooks:
34+
- id: ruff
35+
args: [--fix, --exit-non-zero-on-fix, --respect-gitignore, --show-fixes]
36+
37+
- repo: https://github.com/rstcheck/rstcheck
38+
rev: v6.2.4
39+
hooks:
40+
- id: rstcheck
41+
additional_dependencies: [sphinx, toml]
42+
43+
- repo: local
44+
hooks:
45+
- id: pipenv
46+
stages: [pre-commit, manual]
47+
language: system
48+
name: Install dependencies for the local linters
49+
entry: bash -c "pip install pipenv && pipenv install --dev"
50+
types_or:
51+
- python
52+
- toml # Pipfile
53+
pass_filenames: false
54+
- id: mypy
55+
stages: [pre-commit, manual]
56+
name: mypy
57+
entry: pipenv run mypy .
58+
language: system
59+
types_or:
60+
- python
61+
- toml # Pipfile
62+
pass_filenames: false

.rstcheck.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[rstcheck]
2+
report_level = warning
3+
ignore_directives =
4+
automodule

0 commit comments

Comments
 (0)