Skip to content

Commit 6e896d3

Browse files
[pre-commit.ci] pre-commit autoupdate (#10869)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.12 → v0.13.0](astral-sh/ruff-pre-commit@v0.12.12...v0.13.0) * fix ruff errors --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
1 parent 336c869 commit 6e896d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+150
-114
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: sort-simple-yaml
2323
- id: trailing-whitespace
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: 'v0.12.12'
25+
rev: 'v0.13.0'
2626
hooks:
2727
- id: ruff-check
2828
args: [--fix, --exit-non-zero-on-fix]

dvc/api/dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ def get(name: str) -> Union[DatachainDataset, DVCDataset, URLDataset]:
6464
for file in dataset.lock.files
6565
]
6666
return URLDataset(type="url", files=files, path=versioned_path)
67+
raise AssertionError("unreachable")

dvc/commands/check_ignore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, args):
1616

1717
def _show_results(self, result: "CheckIgnoreResult"):
1818
if not result.match and not self.args.details:
19-
return
19+
return None
2020

2121
if self.args.details:
2222
pattern_infos = result.pattern_infos

dvc/commands/dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def display(self, name: str, dataset: "Dataset", new: "Dataset"):
8383
return CmdDatasetAdd.display(name, new, action)
8484
if dataset == new:
8585
ui.write("[yellow]Nothing to update[/]", styled=True)
86-
return
86+
return None
8787

8888
assert new.lock
8989

@@ -112,6 +112,7 @@ def display(self, name: str, dataset: "Dataset", new: "Dataset"):
112112
assert new.type == "url"
113113
stats = diff_files(dataset.lock.files, new.lock.files)
114114
log_changes(stats)
115+
return None
115116

116117
def run(self):
117118
from difflib import get_close_matches

dvc/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def get_dir(cls, level):
139139
return global_config_dir()
140140
if level == "system":
141141
return system_config_dir()
142+
return None
142143

143144
@cached_property
144145
def files(self) -> dict[str, str]:

dvc/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_connection(self, onerror: Optional[Callable[[], Any]] = None) -> None:
8484
except Exception as exc:
8585
if callable(onerror):
8686
onerror()
87-
logger.exception(
87+
logger.exception( # noqa: LOG007
8888
"Could not connect to the database. "
8989
"Check your database credentials and try again.",
9090
exc_info=False,

dvc/dvcfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def dump(self, stage, **kwargs) -> None:
203203

204204
def dump_stages(self, stages, **kwargs) -> None:
205205
if not stages:
206-
return
206+
return None
207207

208208
assert len(stages) == 1, "SingleStageFile can only dump one stage."
209209
return self.dump(stages[0], **kwargs)

dvc/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from dvc.stage import Stage
1010

1111

12-
class DvcException(Exception):
12+
class DvcException(Exception): # noqa: N818
1313
"""Base class for all dvc exceptions."""
1414

1515
def __init__(self, msg, *args):

dvc/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def log_to_root(message, *args, **kwargs):
5555
setattr(logging, method_name, log_to_root)
5656

5757

58-
class LoggingException(Exception):
58+
class LoggingException(Exception): # noqa: N818
5959
def __init__(self, record):
6060
msg = f"failed to log {record!s}"
6161
super().__init__(msg)

dvc/output.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,12 +1473,13 @@ def merge_version_meta(
14731473
):
14741474
"""Merge version meta for files which are unchanged from other."""
14751475
if not self.hash_info:
1476-
return
1476+
return None
14771477
if self.hash_info.isdir:
14781478
return self._merge_dir_version_meta(old_hi, old_obj)
14791479
if self.hash_info != old_hi:
1480-
return
1480+
return None
14811481
self.meta = old_meta
1482+
return None
14821483

14831484
def _merge_dir_version_meta(
14841485
self, old_hi: "HashInfo", old_obj: Optional[Union["HashFile", "Tree"]]

0 commit comments

Comments
 (0)