This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new aa73bca2b5 Partially enable `B028` rule: no-explicit-stacklevel 
(#39000)
aa73bca2b5 is described below

commit aa73bca2b549b4c063d684d389e444b07ffaa888
Author: Andrey Anshin <andrey.ans...@taragol.is>
AuthorDate: Sun Apr 14 17:21:19 2024 +0400

    Partially enable `B028` rule: no-explicit-stacklevel (#39000)
---
 pyproject.toml | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/pyproject.toml b/pyproject.toml
index 84fc37ee39..1bc89bbea8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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
 ]
@@ -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"]
 
@@ -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"

Reply via email to