Skip to content

Commit 4bfc4b6

Browse files
author
Emmanuel Rondan
committed
adding pre-commit hooks config files
1 parent 249e79f commit 4bfc4b6

File tree

7 files changed

+29
-5
lines changed

7 files changed

+29
-5
lines changed

.bandit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
skips:
22
- B101 # assert_used, needed for mypy
3+
- B311
4+
- B320
5+
- B410
36
exclude_dirs: ['tests']

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 88

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# applying pre-commit hooks to the project

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,9 @@ jobs:
6565
run: tox
6666
- name: Upload coverage.xml to codecov
6767
uses: codecov/codecov-action@v1
68+
69+
pre-commit:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: pre-commit/[email protected]

.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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,15 @@ repos:
44
hooks:
55
- id: bandit
66
args: [-r, -c, .bandit.yml]
7+
- repo: https://github.com/psf/black.git
8+
rev: 24.8.0
9+
hooks:
10+
- id: black
11+
- repo: https://github.com/PyCQA/flake8
12+
rev: 7.1.1
13+
hooks:
14+
- id: flake8
15+
- repo: https://github.com/pycqa/isort
16+
rev: 5.13.2
17+
hooks:
18+
- id: isort

tox.ini

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ commands =
1010
py.test --doctest-modules --cov=scrapy_zyte_smartproxy {posargs:scrapy_zyte_smartproxy tests}
1111

1212
[testenv:pre-commit]
13-
basepython = python3
14-
deps =
15-
pre-commit
16-
commands =
17-
pre-commit run {posargs:--all-files}
13+
deps = pre-commit
14+
commands = pre-commit run --all-files --show-diff-on-failure
15+
skip_install = true
1816

1917
[testenv:mypy]
2018
basepython = python3.10

0 commit comments

Comments
 (0)