Skip to content

Commit aac6232

Browse files
authored
build: add flake8-print plugin and update pre-commit (#1134)
Signed-off-by: behnazh-w <[email protected]>
1 parent 006c42a commit aac6232

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ ignore = E203,E266,E501,W503,D105,D404,PT009
4747
# D107: Missing docstring in __init__
4848
# PT004: Fixture does not return anything, add leading underscore
4949
# B903: Data class should either be immutable or use __slots__ to save memory
50+
# T201: Check for Print statements in python files.
5051
per-file-ignores =
5152
__init__.py:D104
5253
tests/*:D400,D200,D102,D104,D107,PT004
5354
src/macaron/database/views.py:B903
55+
tests/schema_validation/json_schema_validate.py:T201
56+
tests/integration/cases/run_macaron_sh_script_unit_test/test_run_macaron_sh.py:T201
5457

5558
max-line-length = 120
5659
show-source = true

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717

1818
# Commitizen enforces semantic and conventional commit messages.
1919
- repo: https://github.com/commitizen-tools/commitizen
20-
rev: v4.4.1
20+
rev: v4.8.3
2121
hooks:
2222
- id: commitizen
2323
name: Check conventional commit message
@@ -50,7 +50,7 @@ repos:
5050

5151
# Upgrade and rewrite Python idioms.
5252
- repo: https://github.com/asottile/pyupgrade
53-
rev: v3.19.1
53+
rev: v3.20.0
5454
hooks:
5555
- id: pyupgrade
5656
name: Upgrade code idioms
@@ -60,13 +60,13 @@ repos:
6060
# Similar to pylint, with a few more/different checks. For more available
6161
# extensions: https://github.com/DmytroLitvinov/awesome-flake8-extensions
6262
- repo: https://github.com/pycqa/flake8
63-
rev: 7.1.2
63+
rev: 7.3.0
6464
hooks:
6565
- id: flake8
6666
name: Check flake8 issues
6767
files: ^src/macaron/|^tests/
6868
types: [text, python]
69-
additional_dependencies: [flake8-bugbear==22.10.27, flake8-builtins==2.0.1, flake8-comprehensions==3.10.1, flake8-docstrings==1.6.0, flake8-mutable==1.2.0, flake8-noqa==1.4.0, flake8-pytest-style==1.6.0, flake8-rst-docstrings==0.3.0, pep8-naming==0.13.2]
69+
additional_dependencies: [flake8-bugbear==22.10.27, flake8-builtins==2.0.1, flake8-comprehensions==3.10.1, flake8-docstrings==1.6.0, flake8-mutable==1.2.0, flake8-noqa==1.4.0, flake8-pytest-style==1.6.0, flake8-rst-docstrings==0.3.0, flake8-print==5.0.0, pep8-naming==0.13.2]
7070
exclude: ^tests/malware_analyzer/pypi/resources/sourcecode_samples.*
7171
args: [--config, .flake8]
7272

@@ -110,7 +110,7 @@ repos:
110110

111111
# Check for potential security issues.
112112
- repo: https://github.com/PyCQA/bandit
113-
rev: 1.8.3
113+
rev: 1.8.6
114114
hooks:
115115
- id: bandit
116116
name: Check for security issues
@@ -164,7 +164,7 @@ repos:
164164

165165
# Check and prettify the configuration files.
166166
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
167-
rev: v2.14.0
167+
rev: v2.15.0
168168
hooks:
169169
- id: pretty-format-ini
170170
args: [--autofix]
@@ -224,7 +224,7 @@ repos:
224224

225225
# A linter for Golang
226226
- repo: https://github.com/golangci/golangci-lint
227-
rev: v1.64.6
227+
rev: v2.3.0
228228
hooks:
229229
- id: golangci-lint
230230

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ docs = [
8989
"sphinx-togglebutton >=0.3.2,<1.0.0",
9090
]
9191
hooks = [
92-
"pre-commit >=4.0.0,<4.2.0",
92+
"pre-commit >=4.2.0,<5.0.0",
9393
]
9494
# Note that the `custom_exit_code` and `env` plugins may currently be unmaintained.
9595
test = [

tests/test_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _response_generator(target_value: int) -> Callable[[Request], Response]:
9191

9292
def generator(request: Request) -> Response: # pylint: disable=unused-argument
9393
"""Add the next value as a header and adjust the status code based on the value."""
94-
nonlocal value, target_value
94+
nonlocal value
9595
value += 1
9696
response = Response()
9797
response.status_code = 403 if value <= (target_value + 1) else 200

0 commit comments

Comments
 (0)