Skip to content

Commit

Permalink
Partially enable B028 rule: no-explicit-stacklevel (apache#39000)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taragolis authored and utkarsharma2 committed Apr 22, 2024
1 parent f31b735 commit 3a65efa
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ extend-select = [
"B006", # Checks for uses of mutable objects as function argument defaults.
"B017", # Checks for pytest.raises context managers that catch Exception or BaseException.
"B019", # Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
"B028", # No explicit stacklevel keyword argument found
"TRY002", # Prohibit use of `raise Exception`, use specific exceptions instead.
"RUF006", # Checks for asyncio dangling task
]
Expand Down Expand Up @@ -322,7 +323,7 @@ required-imports = ["from __future__ import annotations"]
combine-as-imports = true

[tool.ruff.lint.per-file-ignores]
"airflow/__init__.py" = ["F401"]
"airflow/__init__.py" = ["F401", "B028"]
"airflow/models/__init__.py" = ["F401", "TCH004"]
"airflow/models/sqla_models.py" = ["F401"]

Expand Down Expand Up @@ -381,6 +382,35 @@ combine-as-imports = true
"tests/providers/qdrant/operators/test_qdrant.py" = ["E402"]
"tests/providers/snowflake/operators/test_snowflake_sql.py" = ["E402"]

# All the modules which do not follow B028 yet: https://docs.astral.sh/ruff/rules/no-explicit-stacklevel/
"airflow/api_connexion/endpoints/forward_to_fab_endpoint.py" = ["B028"]
"airflow/cli/commands/connection_command.py" = ["B028"]
"airflow/cli/commands/dag_command.py" = ["B028"]
"airflow/cli/commands/db_command.py" = ["B028"]
"airflow/configuration.py" = ["B028"]
"airflow/decorators/task_group.py" = ["B028"]
"airflow/jobs/scheduler_job_runner.py" = ["B028"]
"airflow/jobs/triggerer_job_runner.py" = ["B028"]
"airflow/kubernetes/pre_7_4_0_compatibility/pod_generator.py" = ["B028"]
"airflow/logging_config.py" = ["B028"]
"airflow/metrics/otel_logger.py" = ["B028"]
"airflow/metrics/validators.py" = ["B028"]
"airflow/models/baseoperator.py" = ["B028"]
"airflow/models/connection.py" = ["B028"]
"airflow/models/mappedoperator.py" = ["B028"]
"airflow/models/param.py" = ["B028"]
"airflow/models/xcom.py" = ["B028"]
"airflow/providers_manager.py" = ["B028"]
"airflow/serialization/serialized_objects.py" = ["B028"]
"airflow/settings.py" = ["B028"]
"airflow/utils/context.py" = ["B028"]
"airflow/utils/dot_renderer.py" = ["B028"]
"airflow/www/app.py" = ["B028"]
"airflow/www/extensions/init_views.py" = ["B028"]
"airflow/providers/jdbc/hooks/jdbc.py" = ["B028"]
"airflow/providers/microsoft/azure/hooks/synapse.py" = ["B028"]
"helm_tests/airflow_aux/test_basic_helm_chart.py" = ["B028"]

[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
Expand Down

0 comments on commit 3a65efa

Please sign in to comment.