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

Commit

Permalink
Re-enable some linting (#14821)
Browse files Browse the repository at this point in the history
* Re-enable some linting

* Newsfile

* Remove comment
  • Loading branch information
erikjohnston committed Jan 12, 2023
1 parent dd9e71d commit b50c008
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 21 deletions.
1 change: 1 addition & 0 deletions changelog.d/14821.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Re-enable some linting that was disabled when we switched to ruff.
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ line-length = 88
# E731: do not assign a lambda expression, use a def
# E501: Line too long (black enforces this for us)
#
# See https://github.com/charliermarsh/ruff/#pyflakes
# F401: unused import
# F811: Redefinition of unused
# F821: Undefined name
#
# flake8-bugbear compatible checks. Its error codes are described at
# https://github.com/charliermarsh/ruff/#flake8-bugbear
# B019: Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
Expand All @@ -64,9 +59,6 @@ ignore = [
"B024",
"E501",
"E731",
"F401",
"F811",
"F821",
]
select = [
# pycodestyle checks.
Expand Down
1 change: 0 additions & 1 deletion stubs/sortedcontainers/sortedlist.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ from __future__ import annotations
from typing import (
Any,
Callable,
Generic,
Iterable,
Iterator,
List,
Expand Down
2 changes: 0 additions & 2 deletions stubs/sortedcontainers/sortedset.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from __future__ import annotations

from typing import (
AbstractSet,
Any,
Callable,
Generic,
Hashable,
Iterable,
Iterator,
Expand Down
2 changes: 1 addition & 1 deletion stubs/synapse/synapse_rust/push.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Collection, Dict, Mapping, Optional, Sequence, Set, Tuple, Union
from typing import Any, Collection, Dict, Mapping, Optional, Sequence, Tuple, Union

from synapse.types import JsonDict

Expand Down
10 changes: 4 additions & 6 deletions synapse/config/_base.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import argparse
from typing import (
Any,
Expand All @@ -20,7 +18,7 @@ from typing import (

import jinja2

from synapse.config import (
from synapse.config import ( # noqa: F401
account_validity,
api,
appservice,
Expand Down Expand Up @@ -169,7 +167,7 @@ class RootConfig:
self, section_name: Literal["caches"]
) -> cache.CacheConfig: ...
@overload
def reload_config_section(self, section_name: str) -> Config: ...
def reload_config_section(self, section_name: str) -> "Config": ...

class Config:
root: RootConfig
Expand Down Expand Up @@ -202,9 +200,9 @@ def find_config_files(search_paths: List[str]) -> List[str]: ...
class ShardedWorkerHandlingConfig:
instances: List[str]
def __init__(self, instances: List[str]) -> None: ...
def should_handle(self, instance_name: str, key: str) -> bool: ...
def should_handle(self, instance_name: str, key: str) -> bool: ... # noqa: F811

class RoutableShardedWorkerHandlingConfig(ShardedWorkerHandlingConfig):
def get_instance(self, key: str) -> str: ...
def get_instance(self, key: str) -> str: ... # noqa: F811

def read_file(file_path: Any, config_path: Iterable[str]) -> str: ...
6 changes: 3 additions & 3 deletions tests/storage/test_event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_count_aggregation(self) -> None:
# Create a user to receive notifications and send receipts.
user_id, token, _, other_token, room_id = self._create_users_and_room()

last_event_id: str
last_event_id = ""

def _assert_counts(notif_count: int, highlight_count: int) -> None:
counts = self.get_success(
Expand Down Expand Up @@ -289,7 +289,7 @@ def test_count_aggregation_threads(self) -> None:
user_id, token, _, other_token, room_id = self._create_users_and_room()
thread_id: str

last_event_id: str
last_event_id = ""

def _assert_counts(
notif_count: int,
Expand Down Expand Up @@ -471,7 +471,7 @@ def test_count_aggregation_mixed(self) -> None:
user_id, token, _, other_token, room_id = self._create_users_and_room()
thread_id: str

last_event_id: str
last_event_id = ""

def _assert_counts(
notif_count: int,
Expand Down

0 comments on commit b50c008

Please sign in to comment.