Skip to content

Commit 11f218d

Browse files
build(deps): add pydoclint as dependency for flake8 hook (#347)
- update config for flake8 - style: fix typo --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent 4053e88 commit 11f218d

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ci:
22
autoupdate_commit_msg: 'build(deps): pre-commit autoupdate'
3-
autofix_commit_msg: 'chore: apply auto fixes with pre-commit'
3+
autofix_commit_msg: 'style: apply auto fixes with pre-commit'
44
skip:
55
- pylint
66

@@ -52,6 +52,7 @@ repos:
5252
name: flake8-ignition-api
5353
files: ^ignition-api/src/
5454
args: [--config, ignition-api/tox.ini]
55+
additional_dependencies: [pydoclint]
5556
- repo: https://github.com/PyCQA/flake8
5657
rev: 7.3.0
5758
hooks:
@@ -68,12 +69,6 @@ repos:
6869
files: ^ignition-api/src/
6970
exclude: ^ignition-api/src/(ch|com|dev|java|javax|org)/
7071
args: [--config, ignition-api/tox.ini]
71-
- repo: https://github.com/jsh9/pydoclint
72-
rev: 0.6.7
73-
hooks:
74-
- id: pydoclint-flake8
75-
files: ^ignition-api/src/
76-
args: [--config=ignition-api/tox.ini, --extend-ignore=F401]
7772
- repo: https://github.com/commitizen-tools/commitizen
7873
rev: v4.8.3
7974
hooks:

ignition-api/tox.ini

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,33 @@ commands =
3232

3333
[testenv:style]
3434
description = apply style
35+
base_python = python3.12
3536
skip_install = true
3637
deps =
3738
black
3839
docformatter
3940
flake8==5.0.4
4041
isort
42+
pydoclint
4143
pydocstyle
4244
sort-all
45+
unimport
4346
commands =
44-
bash -c 'sort-all $(find src -name "*.py" -type f)'
47+
python -c \
48+
"import pathlib, subprocess; \
49+
files = [str(p) for p in pathlib.Path('src').rglob('*.py')]; \
50+
subprocess.run(['sort-all'] + files, check=True)"
4551
black --quiet src
46-
isort src
52+
unimport src
53+
isort --settings-file=tox.ini src
4754
docformatter \
4855
--in-place \
4956
--wrap-summaries 72 \
5057
--close-quotes-on-newline \
5158
--recursive \
5259
src
53-
flake8 src
54-
pydocstyle src
55-
allowlist_externals =
56-
bash
60+
flake8 --select=DOC --config=tox.ini src
61+
pydocstyle --config=tox.ini src{/}system
5762

5863
[type]
5964
base_python = python3.12
@@ -66,10 +71,15 @@ wrap-summaries = 72
6671
close-quotes-on-newline = true
6772

6873
[flake8]
69-
ignore = E741, F821
74+
ignore = DOC202, E741, F821
7075
max-complexity = 10
7176
max-doc-length = 72
7277
max-line-length = 120
78+
# pydoclint
79+
style = google
80+
arg-type-hints-in-docstring = False
81+
arg-type-hints-in-signature = False
82+
check-return-types = False
7383

7484
[isort]
7585
extra_standard_library = typing

0 commit comments

Comments
 (0)