Skip to content

Commit 11735e5

Browse files
committed
Upgrade pre-commit hook versions
Signed-off-by: Pedro Algarvio <[email protected]>
1 parent 22aa1d7 commit 11735e5

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ repos:
5353
# <---- Local Hooks ------------------------------------------------------------------------------------------------
5454

5555
- repo: https://github.com/s0undt3ch/python-tools-scripts
56-
rev: "0.12.0"
56+
rev: "0.17.0"
5757
hooks:
5858
- id: tools
5959
alias: actionlint
@@ -79,7 +79,7 @@ repos:
7979

8080
# ----- Code Formatting and Analysis ---------------------------------------------------------->
8181
- repo: https://github.com/charliermarsh/ruff-pre-commit
82-
rev: "v0.0.265"
82+
rev: "v0.0.277"
8383
hooks:
8484
- id: ruff
8585
args:
@@ -94,7 +94,7 @@ repos:
9494
exclude: src/saf/version.py
9595

9696
- repo: https://github.com/asottile/blacken-docs
97-
rev: 1.13.0
97+
rev: 1.14.0
9898
hooks:
9999
- id: blacken-docs
100100
args: [--skip-errors]
@@ -103,7 +103,7 @@ repos:
103103
- black==23.3.0
104104

105105
- repo: https://github.com/pre-commit/mirrors-mypy
106-
rev: v1.2.0
106+
rev: v1.4.1
107107
hooks:
108108
- id: mypy
109109
name: Run mypy against the code base

changelog/68.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Several trivial/internal updates to the project:
22

33
* Allow the `nox -e build` target to also build the examples package
44
* When updating `examples/requirements/all.txt` only care about `*.txt` files
5+
* Upgrade pre-commit hook versions

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def _tests(session, onedir=False, examples=False):
235235
"xml",
236236
"-o",
237237
str(COVERAGE_REPORT_PROJECT),
238-
f"--omit={str(tests_root / '*')}",
238+
f"--omit={tests_root / '*'!s}",
239239
"--include=src/saf/*",
240240
)
241241
# Generate report for tests code coverage
@@ -245,7 +245,7 @@ def _tests(session, onedir=False, examples=False):
245245
"-o",
246246
str(COVERAGE_REPORT_TESTS),
247247
"--omit=src/saf/*",
248-
f"--include={str(tests_root / '*')}",
248+
f"--include={tests_root / '*'!s}",
249249
)
250250
try:
251251
session.run("coverage", "report", "--show-missing", "--include=src/saf/*")

pyproject.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ extend-include = [
7373
]
7474
ignore = [
7575
# D* pydocstyle
76-
"D200", # Reformat to one line
77-
"D212", # Remove whitespace after opening quotes
78-
"COM", # flake8-commas - Black takes care of this
79-
"ERA", # eradicate
80-
"SIM108", # Use ternary operator `A = X if Y else Z` instead of `if`-`else`-block
76+
"D200", # Reformat to one line
77+
"D212", # Remove whitespace after opening quotes
78+
"COM", # flake8-commas - Black takes care of this
79+
"ERA", # eradicate
80+
"SIM108", # Use ternary operator `A = X if Y else Z` instead of `if`-`else`-block
81+
"PERF203", # `try`-`except` within a loop incurs performance overhead"
82+
"PERF401", # Use a list comprehension to create a transformed list
83+
"PERF402", # Use `list` or `list.copy` to create a copy of a list
8184
]
8285
ignore-init-module-imports = true
8386
builtins = [
@@ -108,6 +111,9 @@ format = "grouped"
108111
"SLF001", # Private member accessed"
109112
"ARG003", # Unused class method argument: `kwargs`
110113
]
114+
"src/saf/pipeline.py" = [
115+
"PERF401", # Use a list comprehension to create a transformed list"
116+
]
111117
"src/saf/collect/file.py" = [
112118
"TCH003", # Move standard library import `pathlib` into a type-checking block
113119
]
@@ -132,6 +138,7 @@ format = "grouped"
132138
"PLR0912",
133139
"DTZ005",
134140
"FBT002",
141+
"PLR0913", # Too many arguments to function call"
135142
"PLR0915", # Too many statements
136143
]
137144
"tools/**/*.py" = [

src/saf/collect/salt_exec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import Type
1515

1616
import salt.loader
17+
from pydantic import Field
1718

1819
from saf.models import CollectConfigBase
1920
from saf.models import CollectedEvent
@@ -29,8 +30,8 @@ class SaltExecConfig(CollectConfigBase):
2930

3031
interval: float = 5
3132
fn: str = "test.ping"
32-
args: List[Any] = []
33-
kwargs: Dict[str, Any] = {}
33+
args: List[Any] = Field(factory=list)
34+
kwargs: Dict[str, Any] = Field(factory=dict)
3435

3536

3637
def get_config_schema() -> Type[SaltExecConfig]:

src/saf/process/jupyter_notebook.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from typing import Optional
1515
from typing import Type
1616

17+
from pydantic import Field
18+
1719
from saf.models import CollectedEvent
1820
from saf.models import PipelineRunContext
1921
from saf.models import ProcessConfigBase
@@ -28,8 +30,8 @@ class JupyterNotebookConfig(ProcessConfigBase):
2830

2931
notebook: pathlib.Path
3032
output_notebook: Optional[pathlib.Path]
31-
params: Dict[str, Any] = {}
32-
papermill_kwargs: Dict[str, Any] = {}
33+
params: Dict[str, Any] = Field(factory=dict)
34+
papermill_kwargs: Dict[str, Any] = Field(factory=dict)
3335
output_tag: Optional[str]
3436
input_keys: List[str]
3537

0 commit comments

Comments
 (0)