Skip to content

Commit 79f844b

Browse files
authored
chore(py): add unused-noqa lint rule (#12615)
1 parent 2d762f0 commit 79f844b

File tree

32 files changed

+42
-35
lines changed

32 files changed

+42
-35
lines changed

metadata-ingestion-modules/airflow-plugin/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ extend-select = [
4444
"G010", # logging.warn -> logging.warning
4545
"I", # isort
4646
"TID", # flake8-tidy-imports
47+
"RUF100", # unused-noqa
4748
]
4849
ignore = [
4950
"E501", # Line length violations (handled by formatter)

metadata-ingestion-modules/airflow-plugin/src/datahub_airflow_plugin/datahub_listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# To placate mypy on Airflow versions that don't have the listener API,
6161
# we define a dummy hookimpl that's an identity function.
6262

63-
def hookimpl(f: _F) -> _F: # type: ignore[misc] # noqa: F811
63+
def hookimpl(f: _F) -> _F: # type: ignore[misc]
6464
return f
6565

6666
else:

metadata-ingestion-modules/airflow-plugin/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pathlib
22
import site
33

4-
from datahub.testing.pytest_hooks import ( # noqa: F401,E402
4+
from datahub.testing.pytest_hooks import ( # noqa: F401
55
load_golden_flags,
66
pytest_addoption,
77
)

metadata-ingestion-modules/dagster-plugin/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ extend-select = [
4444
"G010", # logging.warn -> logging.warning
4545
"I", # isort
4646
"TID", # flake8-tidy-imports
47+
"RUF100", # unused-noqa
4748
]
4849
ignore = [
4950
"E501", # Line length violations (handled by formatter)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from datahub.testing.pytest_hooks import ( # noqa: F401,E402
1+
from datahub.testing.pytest_hooks import ( # noqa: F401
22
load_golden_flags,
33
pytest_addoption,
44
)

metadata-ingestion-modules/gx-plugin/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ extend-select = [
4444
"G010", # logging.warn -> logging.warning
4545
"I", # isort
4646
"TID", # flake8-tidy-imports
47+
"RUF100", # unused-noqa
4748
]
4849
ignore = [
4950
"E501", # Line length violations (handled by formatter)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datahub.testing.docker_utils import docker_compose_runner # noqa: F401
2-
from datahub.testing.pytest_hooks import ( # noqa: F401,E402
2+
from datahub.testing.pytest_hooks import ( # noqa: F401
33
load_golden_flags,
44
pytest_addoption,
55
)

metadata-ingestion-modules/prefect-plugin/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ extend-select = [
4444
"G010", # logging.warn -> logging.warning
4545
"I", # isort
4646
"TID", # flake8-tidy-imports
47+
"RUF100", # unused-noqa
4748
]
4849
ignore = [
4950
"E501", # Line length violations (handled by formatter)

metadata-ingestion/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ extend-select = [
2929
"G010", # logging.warn -> logging.warning
3030
"I", # isort
3131
"TID", # flake8-tidy-imports
32+
"RUF100", # unused-noqa
3233
]
3334
extend-ignore = [
3435
"E501", # Handled by formatter
@@ -38,6 +39,8 @@ extend-ignore = [
3839
"E203", # Ignore whitespace before ':' (matches Black)
3940
"B019", # Allow usages of functools.lru_cache
4041
"B008", # Allow function call in argument defaults
42+
"RUF012", # mutable-class-default; incompatible with pydantic
43+
"RUF015", # unnecessary-iterable-allocation-for-first-element
4144
# TODO: Enable these later
4245
"B006", # Mutable args
4346
"B017", # Do not assert blind exception

metadata-ingestion/src/datahub/cli/docker_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def detect_quickstart_arch(arch: Optional[str]) -> Architectures:
430430
return quickstart_arch
431431

432432

433-
@docker.command() # noqa: C901
433+
@docker.command()
434434
@click.option(
435435
"--version",
436436
type=str,
@@ -592,7 +592,7 @@ def detect_quickstart_arch(arch: Optional[str]) -> Architectures:
592592
"arch",
593593
]
594594
)
595-
def quickstart( # noqa: C901
595+
def quickstart(
596596
version: Optional[str],
597597
build_locally: bool,
598598
pull_images: bool,

0 commit comments

Comments
 (0)