Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit b50c008

Browse files
authored
Re-enable some linting (#14821)
* Re-enable some linting * Newsfile * Remove comment
1 parent dd9e71d commit b50c008

File tree

7 files changed

+9
-21
lines changed

7 files changed

+9
-21
lines changed

changelog.d/14821.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Re-enable some linting that was disabled when we switched to ruff.

pyproject.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ line-length = 88
4848
# E731: do not assign a lambda expression, use a def
4949
# E501: Line too long (black enforces this for us)
5050
#
51-
# See https://github.com/charliermarsh/ruff/#pyflakes
52-
# F401: unused import
53-
# F811: Redefinition of unused
54-
# F821: Undefined name
55-
#
5651
# flake8-bugbear compatible checks. Its error codes are described at
5752
# https://github.com/charliermarsh/ruff/#flake8-bugbear
5853
# B019: Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
@@ -64,9 +59,6 @@ ignore = [
6459
"B024",
6560
"E501",
6661
"E731",
67-
"F401",
68-
"F811",
69-
"F821",
7062
]
7163
select = [
7264
# pycodestyle checks.

stubs/sortedcontainers/sortedlist.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ from __future__ import annotations
77
from typing import (
88
Any,
99
Callable,
10-
Generic,
1110
Iterable,
1211
Iterator,
1312
List,

stubs/sortedcontainers/sortedset.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
from __future__ import annotations
66

77
from typing import (
8-
AbstractSet,
98
Any,
109
Callable,
11-
Generic,
1210
Hashable,
1311
Iterable,
1412
Iterator,

stubs/synapse/synapse_rust/push.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Any, Collection, Dict, Mapping, Optional, Sequence, Set, Tuple, Union
15+
from typing import Any, Collection, Dict, Mapping, Optional, Sequence, Tuple, Union
1616

1717
from synapse.types import JsonDict
1818

synapse/config/_base.pyi

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import argparse
42
from typing import (
53
Any,
@@ -20,7 +18,7 @@ from typing import (
2018

2119
import jinja2
2220

23-
from synapse.config import (
21+
from synapse.config import ( # noqa: F401
2422
account_validity,
2523
api,
2624
appservice,
@@ -169,7 +167,7 @@ class RootConfig:
169167
self, section_name: Literal["caches"]
170168
) -> cache.CacheConfig: ...
171169
@overload
172-
def reload_config_section(self, section_name: str) -> Config: ...
170+
def reload_config_section(self, section_name: str) -> "Config": ...
173171

174172
class Config:
175173
root: RootConfig
@@ -202,9 +200,9 @@ def find_config_files(search_paths: List[str]) -> List[str]: ...
202200
class ShardedWorkerHandlingConfig:
203201
instances: List[str]
204202
def __init__(self, instances: List[str]) -> None: ...
205-
def should_handle(self, instance_name: str, key: str) -> bool: ...
203+
def should_handle(self, instance_name: str, key: str) -> bool: ... # noqa: F811
206204

207205
class RoutableShardedWorkerHandlingConfig(ShardedWorkerHandlingConfig):
208-
def get_instance(self, key: str) -> str: ...
206+
def get_instance(self, key: str) -> str: ... # noqa: F811
209207

210208
def read_file(file_path: Any, config_path: Iterable[str]) -> str: ...

tests/storage/test_event_push_actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_count_aggregation(self) -> None:
154154
# Create a user to receive notifications and send receipts.
155155
user_id, token, _, other_token, room_id = self._create_users_and_room()
156156

157-
last_event_id: str
157+
last_event_id = ""
158158

159159
def _assert_counts(notif_count: int, highlight_count: int) -> None:
160160
counts = self.get_success(
@@ -289,7 +289,7 @@ def test_count_aggregation_threads(self) -> None:
289289
user_id, token, _, other_token, room_id = self._create_users_and_room()
290290
thread_id: str
291291

292-
last_event_id: str
292+
last_event_id = ""
293293

294294
def _assert_counts(
295295
notif_count: int,
@@ -471,7 +471,7 @@ def test_count_aggregation_mixed(self) -> None:
471471
user_id, token, _, other_token, room_id = self._create_users_and_room()
472472
thread_id: str
473473

474-
last_event_id: str
474+
last_event_id = ""
475475

476476
def _assert_counts(
477477
notif_count: int,

0 commit comments

Comments
 (0)