Skip to content

Commit 20de685

Browse files
Bump ruff from 0.3.7 to 0.5.0 (#17381)
1 parent 8e9e6f1 commit 20de685

File tree

13 files changed

+41
-36
lines changed

13 files changed

+41
-36
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- 'pyproject.toml'
7474
- 'poetry.lock'
7575
- '.github/workflows/tests.yml'
76-
76+
7777
linting_readme:
7878
- 'README.rst'
7979
@@ -139,7 +139,7 @@ jobs:
139139

140140
- name: Semantic checks (ruff)
141141
# --quiet suppresses the update check.
142-
run: poetry run ruff --quiet .
142+
run: poetry run ruff check --quiet .
143143

144144
lint-mypy:
145145
runs-on: ubuntu-latest

changelog.d/17381.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix linting errors from new `ruff` version.

poetry.lock

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

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ target-version = ['py38', 'py39', 'py310', 'py311']
4343
[tool.ruff]
4444
line-length = 88
4545

46+
[tool.ruff.lint]
4647
# See https://beta.ruff.rs/docs/rules/#error-e
4748
# for error codes. The ones we ignore are:
4849
# E501: Line too long (black enforces this for us)
@@ -321,7 +322,7 @@ all = [
321322
# This helps prevents merge conflicts when running a batch of dependabot updates.
322323
isort = ">=5.10.1"
323324
black = ">=22.7.0"
324-
ruff = "0.3.7"
325+
ruff = "0.5.0"
325326
# Type checking only works with the pydantic.v1 compat module from pydantic v2
326327
pydantic = "^2"
327328

scripts-dev/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ python3 -m black "${files[@]}"
112112

113113
# Catch any common programming mistakes in Python code.
114114
# --quiet suppresses the update check.
115-
ruff --quiet --fix "${files[@]}"
115+
ruff check --quiet --fix "${files[@]}"
116116

117117
# Catch any common programming mistakes in Rust code.
118118
#

synapse/_scripts/generate_workers_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545

4646
class MockHomeserver(HomeServer):
47-
DATASTORE_CLASS = DataStore # type: ignore
47+
DATASTORE_CLASS = DataStore
4848

4949
def __init__(self, config: HomeServerConfig, worker_app: Optional[str]) -> None:
5050
super().__init__(config.server.server_name, config=config)

synapse/_scripts/update_synapse_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
class MockHomeserver(HomeServer):
44-
DATASTORE_CLASS = DataStore # type: ignore [assignment]
44+
DATASTORE_CLASS = DataStore
4545

4646
def __init__(self, config: HomeServerConfig):
4747
super().__init__(

synapse/app/admin_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def __init__(
110110

111111

112112
class AdminCmdServer(HomeServer):
113-
DATASTORE_CLASS = AdminCmdStore # type: ignore
113+
DATASTORE_CLASS = AdminCmdStore
114114

115115

116116
async def export_data_command(hs: HomeServer, args: argparse.Namespace) -> None:

synapse/app/generic_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class GenericWorkerStore(
163163

164164

165165
class GenericWorkerServer(HomeServer):
166-
DATASTORE_CLASS = GenericWorkerStore # type: ignore
166+
DATASTORE_CLASS = GenericWorkerStore
167167

168168
def _listen_http(self, listener_config: ListenerConfig) -> None:
169169
assert listener_config.http_options is not None

synapse/app/homeserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def gz_wrap(r: Resource) -> Resource:
8181

8282

8383
class SynapseHomeServer(HomeServer):
84-
DATASTORE_CLASS = DataStore # type: ignore
84+
DATASTORE_CLASS = DataStore
8585

8686
def _listener_http(
8787
self,

0 commit comments

Comments
 (0)