Skip to content

Commit 21bfe14

Browse files
[pre-commit.ci] pre-commit autoupdate (#75)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.3.2 → v0.3.4](astral-sh/ruff-pre-commit@v0.3.2...v0.3.4) * Update Ruff configuration * Fix linter warnings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update CHANGELOG --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
1 parent 20019b6 commit 21bfe14

File tree

4 files changed

+21
-27
lines changed

4 files changed

+21
-27
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656
additional_dependencies: [black==23.3.0]
5757

5858
- repo: https://github.com/astral-sh/ruff-pre-commit
59-
rev: v0.3.2
59+
rev: v0.3.4
6060
hooks:
6161
- id: ruff-format
6262
name: ruff (format)
@@ -68,6 +68,6 @@ repos:
6868
args:
6969
- --fix
7070
- --exit-non-zero-on-fix
71-
- --show-source
71+
- --output-format=full
7272
- --show-fixes
7373
- --preview

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Update GitHub Actions `github/codeql-action` from v2 to v3
1313
- Update `adrienverge/yamllint.git` hook to v1.35.1
14-
- Update `astral-sh/ruff-pre-commit` hook to v0.3.2
14+
- Update `astral-sh/ruff-pre-commit` hook to v0.3.4
1515
- Update `Lucas-C/pre-commit-hooks` hook to v1.5.5
1616

1717
## [v1.5.1] - 2023-12-15

pylint_secure_coding_standard.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,9 @@ def _is_shell_true_call(node):
209209
return True
210210

211211
# asyncio module
212-
if (node.func.expr.name == 'asyncio' and node.func.attrname == 'create_subprocess_shell') or (
212+
return (node.func.expr.name == 'asyncio' and node.func.attrname == 'create_subprocess_shell') or (
213213
node.func.expr.name == 'loop' and node.func.attrname == 'subprocess_shell'
214-
):
215-
return True
216-
217-
return False
214+
)
218215

219216

220217
def _is_pdb_call(node):
@@ -225,22 +222,19 @@ def _is_pdb_call(node):
225222
):
226223
# Cover:
227224
return True
228-
if isinstance(node.func, astroid.Name) and node.func.name == 'Pdb':
229-
# Cover:
230-
return True
231-
return False
225+
226+
# Cover:
227+
return isinstance(node.func, astroid.Name) and node.func.name == 'Pdb'
232228

233229

234230
def _is_mktemp_call(node):
235231
if isinstance(node.func, astroid.Attribute) and node.func.attrname == 'mktemp':
236232
# Cover:
237233
# * pdb.func().
238234
return True
239-
if isinstance(node.func, astroid.Name) and node.func.name == 'mktemp':
240-
# Cover:
241-
# * Pdb().
242-
return True
243-
return False
235+
# Cover:
236+
# * Pdb().
237+
return isinstance(node.func, astroid.Name) and node.func.name == 'mktemp'
244238

245239

246240
def _is_yaml_unsafe_call(node):
@@ -283,12 +277,10 @@ def _is_yaml_unsafe_call(node):
283277
# * yaml.load(x, FullLoader).
284278
return True
285279

286-
if isinstance(node.func, astroid.Name) and node.func.name in {'unsafe_load', 'full_load'}:
287-
# Cover:
288-
# * unsafe_load(...).
289-
# * full_load(...).
290-
return True
291-
return False
280+
# Cover:
281+
# * unsafe_load(...).
282+
# * full_load(...).
283+
return isinstance(node.func, astroid.Name) and node.func.name in {'unsafe_load', 'full_load'}
292284

293285

294286
# ==============================================================================

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ build-backend = "setuptools.build_meta"
88
line-length = 120
99
target-version = 'py38'
1010

11+
[tool.ruff.lint]
12+
1113
select = ['F', # pyflakes
1214
'E', # pycodestyle
1315
'W', # pycodestyle
@@ -93,24 +95,24 @@ skip-magic-trailing-comma = false
9395
'tests/*.py' = ['S101', 'SLF001', 'PLR0913', 'PLR2004', 'D']
9496

9597

96-
[tool.ruff.flake8-annotations]
98+
[tool.ruff.lint.flake8-annotations]
9799
allow-star-arg-any = true
98100
ignore-fully-untyped = true
99101
mypy-init-return = true
100102
suppress-dummy-args = true
101103
suppress-none-returning = true
102104

103-
[tool.ruff.flake8-quotes]
105+
[tool.ruff.lint.flake8-quotes]
104106
docstring-quotes = 'double'
105107
inline-quotes = 'single'
106108
multiline-quotes = 'single'
107109

108-
[tool.ruff.isort]
110+
[tool.ruff.lint.isort]
109111
combine-as-imports = true
110112
section-order = ["future", "standard-library", "first-party", "third-party", "local-folder"]
111113
split-on-trailing-comma = false
112114

113-
[tool.ruff.pydocstyle]
115+
[tool.ruff.lint.pydocstyle]
114116
convention = 'google'
115117

116118

0 commit comments

Comments
 (0)