Skip to content

Commit 483ade4

Browse files
add pytest linter
Signed-off-by: Ruslan Senatorov <55090151+ruslansenatorov@users.noreply.github.com>
1 parent 694d88d commit 483ade4

1 file changed

Lines changed: 58 additions & 27 deletions

File tree

.pre-commit-config.yaml

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
repos:
2-
- repo: https://github.com/mwouts/jupytext
3-
rev: "v1.16.4b"
4-
hooks:
5-
- id: jupytext
6-
entry: jupytext
7-
language: python
8-
types: [jupyter]
9-
args:
10-
- --from=ipynb
11-
- --to=py:light
12-
- --set-formats=ipynb,py:light
13-
- --quiet
14-
- --sync
15-
- --warn-only
16-
exclude: '.*\.md$'
172
- repo: https://github.com/PyCQA/docformatter
183
rev: "eb1df347edd128b30cd3368dddc3aa65edcfac38"
194
hooks:
205
- id: docformatter
216
args: [--in-place, --wrap-descriptions=79, --style=google]
7+
- repo: https://github.com/asottile/add-trailing-comma
8+
rev: "v3.1.0"
9+
hooks:
10+
- id: add-trailing-comma
2211
- repo: https://github.com/psf/black.git
2312
rev: "24.10.0"
2413
hooks:
2514
- id: black
26-
15+
- repo: https://github.com/mwouts/jupytext
16+
rev: v1.14.1
17+
hooks:
18+
- id: jupytext
19+
entry: jupytext --to py *.ipynb
20+
language: python
21+
types: [jupyter]
22+
args:
23+
- --from=ipynb
24+
- --to=py:percent
25+
- --pipe=black
26+
- --pipe=isort - --profile black --filter-files
27+
- --opt=notebook_metadata_filter=-kernelspec
28+
- --sync
29+
- --pre-commit
30+
- --paired-paths
31+
additional_dependencies:
32+
- black==22.10.0
33+
- isort==5.11.5
34+
exclude: '.*\.md$'
2735
- repo: https://github.com/nbQA-dev/nbQA
2836
rev: 1.9.0
2937
hooks:
@@ -44,11 +52,9 @@ repos:
4452
rev: "5.13.2"
4553
hooks:
4654
- id: isort
47-
entry: isort
4855
args:
49-
- --profile=black
56+
- --check
5057
- --float-to-top
51-
5258
- repo: https://github.com/nbQA-dev/nbQA
5359
rev: "1.9.0"
5460
hooks:
@@ -79,8 +85,18 @@ repos:
7985
types_or: [jupyter, markdown]
8086
additional_dependencies: [isort]
8187
args:
82-
- --profile=black
83-
- --float-to-top
88+
- --check
89+
- --float-to-top
90+
91+
- repo: https://github.com/pre-commit/pre-commit-hooks
92+
rev: "v5.0.0"
93+
hooks:
94+
- id: trailing-whitespace
95+
- id: end-of-file-fixer
96+
- id: check-yaml
97+
- id: debug-statements
98+
- id: name-tests-test
99+
- id: requirements-txt-fixer
84100

85101
- repo: https://github.com/codespell-project/codespell
86102
rev: v2.3.0
@@ -97,7 +113,7 @@ repos:
97113
hooks:
98114
- id: nbqa-flake8
99115
args:
100-
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391,F401
116+
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391
101117
- --exclude=.*,__init__.py
102118
name: nbqa-flake8
103119
description: Run 'flake8' on a Jupyter Notebook
@@ -115,7 +131,7 @@ repos:
115131
hooks:
116132
- id: flake8
117133
args:
118-
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391,F401
134+
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391
119135
- --exclude=.*,__init__.py
120136
additional_dependencies:
121137
- flake8-variables-names
@@ -220,11 +236,11 @@ repos:
220236
- --ignore=no_check*,__init__.py
221237
- --max-line-length=79
222238
- --const-naming-style=any
223-
- --disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0305,C0303,E2515
239+
- --disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0305
224240

225241

226-
- repo: https://github.com/pylint-dev/pylint
227-
rev: "v3.3.1"
242+
- repo: https://github.com/pre-commit/mirrors-pylint
243+
rev: "v3.0.0a5"
228244
hooks:
229245
- id: pylint
230246
name: pylint
@@ -236,7 +252,7 @@ repos:
236252
"--ignore=no_check*,__init__.py",
237253
"--max-line-length=79",
238254
"--const-naming-style=any",
239-
"--disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0305,line-too-long,C0303,E2515"
255+
"--disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0305,line-too-long",
240256
]
241257
additional_dependencies: [pylint]
242258

@@ -251,3 +267,18 @@ repos:
251267
require_serial: true
252268
types_or: [jupyter, markdown]
253269
additional_dependencies: [pydocstyle]
270+
271+
- repo: https://github.com/christophmeissner/pytest-pre-commit
272+
rev: 1.0.0
273+
hooks:
274+
- id: pytest
275+
name: "Run pytest with HTML report"
276+
entry: pytest
277+
args:
278+
- "--html=calculator_report.html"
279+
- "--self-contained-html"
280+
language: python
281+
pass_filenames: false
282+
always_run: true
283+
additional_dependencies: [pytest-html]
284+

0 commit comments

Comments
 (0)