Skip to content

Commit c8c95e3

Browse files
author
Emmanuel Rondan
committed
adding config files for pre-commit
1 parent 0475327 commit c8c95e3

File tree

6 files changed

+30
-39
lines changed

6 files changed

+30
-39
lines changed

.bandit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ skips:
22
- B101
33
- B320
44
- B410
5+
- B101
6+
- B311
7+
exclude_dirs: ['tests']

.git-blame-ignore-revs

Whitespace-only changes.

.github/workflows/checks.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ jobs:
1010
include:
1111
- python-version: "3.12"
1212
env:
13-
TOXENV: security
14-
- python-version: "3.12"
15-
env:
16-
TOXENV: flake8
13+
TOXENV: pre-commit
1714
- python-version: "3.12"
1815
env:
1916
TOXENV: pylint
@@ -23,9 +20,6 @@ jobs:
2320
- python-version: "3.12"
2421
env:
2522
TOXENV: typing
26-
- python-version: "3.12"
27-
env:
28-
TOXENV: black
2923
- python-version: "3.12"
3024
env:
3125
TOXENV: twinecheck

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile = black

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/PyCQA/bandit
3+
rev: 1.7.7
4+
hooks:
5+
- id: bandit
6+
args: [-r, -c, .bandit.yml]
7+
- repo: https://github.com/PyCQA/flake8
8+
rev: 7.0.0
9+
hooks:
10+
- id: flake8
11+
- repo: https://github.com/psf/black.git
12+
rev: 24.1.1
13+
hooks:
14+
- id: black
15+
- repo: https://github.com/pycqa/isort
16+
rev: 5.13.2
17+
hooks:
18+
- id: isort

tox.ini

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,19 @@
11
[tox]
2-
envlist = security,flake8,typing,pylint,black,docs,twinecheck,py38,py39,py310,py311,py312,pypy3.9,pypy3.10
2+
envlist = pylint,docs,twinecheck,py38,py39,py310,py311,py312,pypy3.9,pypy3.10
33

44
[testenv]
55
usedevelop = True
66
deps =
77
-r{toxinidir}/tests/requirements.txt
88
commands = py.test --cov=parsel --cov-report=xml {posargs:docs parsel tests}
99

10-
[testenv:security]
11-
deps =
12-
bandit
13-
commands =
14-
bandit -r -c .bandit.yml {posargs:parsel}
15-
16-
[testenv:flake8]
17-
deps =
18-
{[testenv]deps}
19-
flake8==5.0.4
20-
commands =
21-
flake8 {posargs: parsel tests setup.py}
22-
23-
[testenv:typing]
24-
deps =
25-
{[testenv]deps}
26-
types-jmespath==1.0.2.6
27-
types-lxml==2022.11.8
28-
types-psutil==5.9.5.6
29-
types-setuptools==67.2.0.1
30-
py==1.11.0
31-
mypy==1.0.0
32-
commands =
33-
mypy {posargs:parsel tests} --strict
34-
3510
[testenv:pylint]
3611
deps =
3712
{[testenv]deps}
3813
pylint==3.0.0
3914
commands =
4015
pylint docs parsel tests setup.py
4116

42-
[testenv:black]
43-
deps =
44-
black==22.10.0
45-
commands =
46-
black --line-length=79 {posargs:--check parsel tests setup.py}
47-
4817
[docs]
4918
changedir = docs
5019
deps = -rdocs/requirements.txt
@@ -67,3 +36,8 @@ deps =
6736
commands =
6837
python -m build --sdist
6938
twine check dist/*
39+
40+
[testenv:pre-commit]
41+
deps = pre-commit
42+
commands = pre-commit run --all-files --show-diff-on-failure
43+
skip_install = true

0 commit comments

Comments
 (0)