Skip to content

Commit 9c5b459

Browse files
Bump version of linters in pre-commit (#3204)
### Changes black - 24.10.0 isort - 5.13.0 ruff - v0.9.2 markdownlint - 0.43.0
1 parent bfac8cf commit 9c5b459

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ MD034: false # Bare URL used
77
MD036: false # Emphasis used instead of a heading
88
MD037: false # Spaces inside emphasis markers
99
MD041: false # First line
10+
MD045: false # no-alt-text

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/psf/black
6-
rev: 24.4.2
6+
rev: 24.10.0
77
hooks:
88
- id: black
99
files: '^.*\.py'
1010

1111
- repo: https://github.com/pycqa/isort
12-
rev: 5.12.0
12+
rev: 5.13.0
1313
hooks:
1414
- id: isort
1515
name: isort (python)
1616

1717
- repo: https://github.com/astral-sh/ruff-pre-commit
1818
# Ruff version.
19-
rev: v0.3.7
19+
rev: v0.9.2
2020
hooks:
2121
- id: ruff
2222

2323
- repo: https://github.com/igorshubovych/markdownlint-cli
24-
rev: v0.33.0
24+
rev: v0.43.0
2525
hooks:
2626
- id: markdownlint
2727
args: [--config=.markdownlint.yaml]

nncf/common/logging/track_progress.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ class WeightedProgress(Progress):
6969
def update(self, task_id: TaskID, **kwargs: Any) -> None:
7070
task = self._tasks[task_id]
7171

72-
advance = kwargs.get("advance", None)
72+
advance = kwargs.get("advance")
7373
if advance is not None:
7474
kwargs["advance"] = self.weighted_advance(task, advance)
7575

76-
completed = kwargs.get("completed", None)
76+
completed = kwargs.get("completed")
7777
if completed is not None:
7878
kwargs["completed"] = self.get_weighted_completed(task, completed)
7979

@@ -88,7 +88,7 @@ def advance(self, task_id: TaskID, advance: float = 1) -> None:
8888
def reset(self, task_id: TaskID, **kwargs: Any) -> None:
8989
task = self._tasks[task_id]
9090

91-
completed = kwargs.get("completed", None)
91+
completed = kwargs.get("completed")
9292
if completed is not None:
9393
kwargs["completed"] = self.get_weighted_completed(task, completed)
9494

tests/torch/ptq/test_wrap_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_wrap_model_with_example_input(example_input, model_cls):
7070
nncf_network = wrap_model(model, example_input)
7171

7272
def check_type(x):
73-
assert type(x) == torch.Tensor
73+
assert type(x) is torch.Tensor
7474
return x
7575

7676
objwalk(example_input, lambda x: True, check_type)

tests/torch/test_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _check_pre_post_ops(modified_model, recovered_model):
158158

159159

160160
def _check_hook_are_equal(hook, recovered_hook):
161-
assert type(hook) == type(recovered_hook)
161+
assert type(hook) is type(recovered_hook)
162162
if isinstance(hook, DummyOpWithState):
163163
assert hook.get_config() == recovered_hook.get_config()
164164
return

tests/torch2/function_hook/test_function_hook_mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_execute_post_hooks(example_outputs: Union[torch.Tensor, List[torch.Tens
107107
ctx = FunctionHookMode(nn.Identity(), hook_storage)
108108
op_meta = OpMeta("/relu/0", torch.relu)
109109
ret_val = ctx.execute_post_hooks(example_outputs, op_meta)
110-
assert type(example_outputs) == type(ret_val)
110+
assert type(example_outputs) is type(ret_val)
111111

112112
assert hook_port_0.call_count == 1
113113
if isinstance(example_outputs, torch.Tensor):

0 commit comments

Comments
 (0)