Skip to content

Commit 95600ce

Browse files
authored
chore(deps): update dependency ruff to v0.14.11 (#904)
This fixes a few new issues spotted by ruff. That's it!
1 parent aa1cdfe commit 95600ce

File tree

5 files changed

+58
-39
lines changed

5 files changed

+58
-39
lines changed

mergify_cli/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,5 @@
1515

1616
from __future__ import annotations
1717

18-
import importlib.metadata
19-
20-
import rich.console
21-
22-
23-
console = rich.console.Console(log_path=False, log_time=False)
24-
25-
VERSION = importlib.metadata.version("mergify-cli")
18+
from mergify_cli._globals import VERSION as VERSION
19+
from mergify_cli._globals import console as console

mergify_cli/_globals.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Copyright © 2021-2024 Mergify SAS
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
# not use this file except in compliance with the License. You may obtain
6+
# a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
16+
from __future__ import annotations
17+
18+
import importlib.metadata
19+
20+
import rich.console
21+
22+
23+
console = rich.console.Console(log_path=False, log_time=False)
24+
25+
VERSION = importlib.metadata.version("mergify-cli")

mergify_cli/ci/scopes/cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ class DetectedScope(pydantic.BaseModel):
124124
scopes: set[str]
125125

126126
def save_to_file(self, file: str) -> None:
127-
with pathlib.Path(file).open("w", encoding="utf-8") as f:
128-
f.write(self.model_dump_json())
127+
pathlib.Path(file).write_text(self.model_dump_json(), encoding="utf-8")
129128

130129
@classmethod
131130
def load_from_file(cls, filename: str) -> DetectedScope:
132-
with pathlib.Path(filename).open("r", encoding="utf-8") as f:
133-
try:
134-
return cls.model_validate_json(f.read())
135-
except pydantic.ValidationError as e:
136-
raise InvalidDetectedScopeError(str(e))
131+
try:
132+
return cls.model_validate_json(
133+
pathlib.Path(filename).read_text(encoding="utf-8"),
134+
)
135+
except pydantic.ValidationError as e:
136+
raise InvalidDetectedScopeError(str(e)) from e
137137

138138

139139
def detect(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mergify = "mergify_cli.cli:main"
2626
dev = [
2727
"mypy==1.19.1",
2828
"mypy-extensions==1.1.0",
29-
"ruff==0.14.9",
29+
"ruff==0.14.11",
3030
"pytest==9.0.2",
3131
"poethepoet==0.40.0",
3232
"pytest-asyncio==1.3.0",

uv.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)