test: update snapshots with just whitespace changes

These snapshot changes should *all* only be a result of changes to
trailing whitespace in the output. I checked a psuedo random sample of
these, and the whitespace found in the previous snapshots seems to be an
artifact of the rendering and _not_ of the source data. So this seems
like a strict bug fix to me.

There are other snapshots with whitespace changes, but they also have
other changes that we split out into separate commits. Basically, we're
going to do approximately one commit per category of change.

This represents, by far, the biggest chunk of changes to snapshots as a
result of the `annotate-snippets` upgrade.
This commit is contained in:
Andrew Gallant 2025-01-07 10:45:21 -05:00 committed by Andrew Gallant
parent 2922490cb8
commit 0de8216a25
779 changed files with 3619 additions and 4333 deletions

View file

@ -623,7 +623,7 @@ fn stdin_override_parser_py() {
fn stdin_fix_when_not_fixable_should_still_print_contents() {
let mut cmd = RuffCheck::default().args(["--fix"]).build();
assert_cmd_snapshot!(cmd
.pass_stdin("import os\nimport sys\n\nif (1, 2):\n print(sys.version)\n"), @r"
.pass_stdin("import os\nimport sys\n\nif (1, 2):\n print(sys.version)\n"), @r###"
success: false
exit_code: 1
----- stdout -----
@ -636,14 +636,14 @@ fn stdin_fix_when_not_fixable_should_still_print_contents() {
-:3:4: F634 If test is a tuple, which is always `True`
|
1 | import sys
2 |
2 |
3 | if (1, 2):
| ^^^^^^ F634
4 | print(sys.version)
|
Found 2 errors (1 fixed, 1 remaining).
");
"###);
}
#[test]

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_linter/src/message/text.rs
expression: content
snapshot_kind: text
---
notebook.ipynb:cell 1:2:8: F401 [*] `os` imported but unused
|
@ -16,7 +15,7 @@ notebook.ipynb:cell 2:2:8: F401 [*] `math` imported but unused
1 | # cell 2
2 | import math
| ^^^^ F401
3 |
3 |
4 | print('hello world')
|
= help: Remove unused import: `math`

View file

@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/message/text.rs
expression: content
snapshot_kind: text
---
syntax_errors.py:1:15: SyntaxError: Expected one or more symbol names after import
|
1 | from os import
| ^
2 |
2 |
3 | if call(foo
4 | def bar():
|
@ -15,7 +14,7 @@ syntax_errors.py:1:15: SyntaxError: Expected one or more symbol names after impo
syntax_errors.py:3:12: SyntaxError: Expected ')', found newline
|
1 | from os import
2 |
2 |
3 | if call(foo
| ^
4 | def bar():

View file

@ -6,7 +6,7 @@ AIR001.py:11:1: AIR001 Task variable name should match the `task_id`: "my_task"
10 | my_task = PythonOperator(task_id="my_task", callable=my_callable)
11 | incorrect_name = PythonOperator(task_id="my_task") # AIR001
| ^^^^^^^^^^^^^^ AIR001
12 |
12 |
13 | my_task = AirbyteTriggerSyncOperator(task_id="my_task", callable=my_callable)
|
@ -15,7 +15,7 @@ AIR001.py:14:1: AIR001 Task variable name should match the `task_id`: "my_task"
13 | my_task = AirbyteTriggerSyncOperator(task_id="my_task", callable=my_callable)
14 | incorrect_name = AirbyteTriggerSyncOperator(task_id="my_task") # AIR001
| ^^^^^^^^^^^^^^ AIR001
15 |
15 |
16 | my_task = AppflowFlowRunOperator(task_id="my_task", callable=my_callable)
|
@ -24,6 +24,6 @@ AIR001.py:17:1: AIR001 Task variable name should match the `task_id`: "my_task"
16 | my_task = AppflowFlowRunOperator(task_id="my_task", callable=my_callable)
17 | incorrect_name = AppflowFlowRunOperator(task_id="my_task") # AIR001
| ^^^^^^^^^^^^^^ AIR001
18 |
18 |
19 | # Consider only from the `airflow.operators` (or providers operators) module
|

View file

@ -4,10 +4,10 @@ source: crates/ruff_linter/src/rules/airflow/mod.rs
AIR301.py:4:1: AIR301 DAG should have an explicit `schedule` argument
|
2 | from airflow.timetables.simple import NullTimetable
3 |
3 |
4 | DAG(dag_id="class_default_schedule")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
5 |
5 |
6 | DAG(dag_id="class_schedule", schedule="@hourly")
|

View file

@ -4,10 +4,10 @@ source: crates/ruff_linter/src/rules/airflow/mod.rs
AIR302_args.py:18:39: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
16 | DAG(dag_id="class_schedule", schedule="@hourly")
17 |
17 |
18 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
| ^^^^^^^^^^^^^^^^^ AIR302
19 |
19 |
20 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
= help: Use `schedule` instead
@ -25,7 +25,7 @@ AIR302_args.py:18:39: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
AIR302_args.py:20:31: AIR302 [*] `timetable` is removed in Airflow 3.0
|
18 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
19 |
19 |
20 | DAG(dag_id="class_timetable", timetable=NullTimetable())
| ^^^^^^^^^ AIR302
|
@ -238,14 +238,14 @@ AIR302_args.py:90:16: AIR302 `filename_template` is removed in Airflow 3.0
89 | ElasticsearchTaskHandler(filename_template="/tmp/test")
90 | GCSTaskHandler(filename_template="/tmp/test")
| ^^^^^^^^^^^^^^^^^ AIR302
91 |
91 |
92 | FabAuthManager(None)
|
AIR302_args.py:92:15: AIR302 `appbuilder` is removed in Airflow 3.0; The constructor takes no parameter now
|
90 | GCSTaskHandler(filename_template="/tmp/test")
91 |
91 |
92 | FabAuthManager(None)
| ^^^^^^ AIR302
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/airflow/mod.rs
snapshot_kind: text
---
AIR302_class_attribute.py:13:4: AIR302 `register_dataset_change` is removed in Airflow 3.0
|
@ -50,7 +49,7 @@ AIR302_class_attribute.py:17:4: AIR302 `notify_dataset_alias_created` is removed
16 | dm.notify_dataset_changed()
17 | dm.notify_dataset_alias_created()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
18 |
18 |
19 | hlc = HookLineageCollector()
|
= help: Use `notify_asset_alias_created` instead
@ -92,7 +91,7 @@ AIR302_class_attribute.py:23:5: AIR302 `collected_datasets` is removed in Airflo
22 | hlc.add_output_dataset()
23 | hlc.collected_datasets()
| ^^^^^^^^^^^^^^^^^^ AIR302
24 |
24 |
25 | aam = AwsAuthManager()
|
= help: Use `collected_assets` instead
@ -102,7 +101,7 @@ AIR302_class_attribute.py:26:5: AIR302 `is_authorized_dataset` is removed in Air
25 | aam = AwsAuthManager()
26 | aam.is_authorized_dataset()
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
27 |
27 |
28 | pm = ProvidersManager()
|
= help: Use `is_authorized_asset` instead
@ -113,7 +112,7 @@ AIR302_class_attribute.py:30:4: AIR302 `dataset_factories` is removed in Airflow
29 | pm.initialize_providers_asset_uri_resources()
30 | pm.dataset_factories
| ^^^^^^^^^^^^^^^^^ AIR302
31 |
31 |
32 | base_secret_backend = BaseSecretsBackend()
|
= help: Use `asset_factories` instead
@ -133,7 +132,7 @@ AIR302_class_attribute.py:34:21: AIR302 `get_connections` is removed in Airflow
33 | base_secret_backend.get_conn_uri()
34 | base_secret_backend.get_connections()
| ^^^^^^^^^^^^^^^ AIR302
35 |
35 |
36 | csm_backend = CloudSecretManagerBackend()
|
= help: Use `get_connection` instead
@ -153,7 +152,7 @@ AIR302_class_attribute.py:38:13: AIR302 `get_connections` is removed in Airflow
37 | csm_backend.get_conn_uri()
38 | csm_backend.get_connections()
| ^^^^^^^^^^^^^^^ AIR302
39 |
39 |
40 | vault_backend = VaultBackend()
|
= help: Use `get_connection` instead
@ -173,7 +172,7 @@ AIR302_class_attribute.py:42:15: AIR302 `get_connections` is removed in Airflow
41 | vault_backend.get_conn_uri()
42 | vault_backend.get_connections()
| ^^^^^^^^^^^^^^^ AIR302
43 |
43 |
44 | not_an_error = NotAir302SecretError()
|
= help: Use `get_connection` instead
@ -204,7 +203,7 @@ AIR302_class_attribute.py:56:18: AIR302 `dataset_to_openlineage_converters` is r
55 | provider_manager.dataset_uri_handlers
56 | provider_manager.dataset_to_openlineage_converters
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
57 |
57 |
58 | dl_info = DatasetLineageInfo()
|
= help: Use `asset_to_openlineage_converters` instead
@ -212,7 +211,7 @@ AIR302_class_attribute.py:56:18: AIR302 `dataset_to_openlineage_converters` is r
AIR302_class_attribute.py:58:11: AIR302 `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
|
56 | provider_manager.dataset_to_openlineage_converters
57 |
57 |
58 | dl_info = DatasetLineageInfo()
| ^^^^^^^^^^^^^^^^^^ AIR302
59 | dl_info.dataset

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/airflow/mod.rs
snapshot_kind: text
---
AIR302_names.py:105:1: AIR302 `airflow.PY36` is removed in Airflow 3.0
|
@ -71,7 +70,7 @@ AIR302_names.py:106:1: AIR302 `airflow.Dataset` is removed in Airflow 3.0
105 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
106 | DatasetFromRoot()
| ^^^^^^^^^^^^^^^ AIR302
107 |
107 |
108 | dataset_from_root = DatasetFromRoot()
|
= help: Use `airflow.sdk.definitions.asset.Asset` instead
@ -79,7 +78,7 @@ AIR302_names.py:106:1: AIR302 `airflow.Dataset` is removed in Airflow 3.0
AIR302_names.py:108:21: AIR302 `airflow.Dataset` is removed in Airflow 3.0
|
106 | DatasetFromRoot()
107 |
107 |
108 | dataset_from_root = DatasetFromRoot()
| ^^^^^^^^^^^^^^^ AIR302
109 | dataset_from_root.iter_datasets()
@ -102,7 +101,7 @@ AIR302_names.py:110:19: AIR302 `iter_dataset_aliases` is removed in Airflow 3.0
109 | dataset_from_root.iter_datasets()
110 | dataset_from_root.iter_dataset_aliases()
| ^^^^^^^^^^^^^^^^^^^^ AIR302
111 |
111 |
112 | # airflow.api_connexion.security
|
= help: Use `iter_asset_aliases` instead
@ -112,7 +111,7 @@ AIR302_names.py:113:1: AIR302 `airflow.api_connexion.security.requires_access` i
112 | # airflow.api_connexion.security
113 | requires_access, requires_access_dataset
| ^^^^^^^^^^^^^^^ AIR302
114 |
114 |
115 | # airflow.auth.managers
|
= help: Use `airflow.api_connexion.security.requires_access_*` instead
@ -122,7 +121,7 @@ AIR302_names.py:113:18: AIR302 `airflow.api_connexion.security.requires_access_d
112 | # airflow.api_connexion.security
113 | requires_access, requires_access_dataset
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR302
114 |
114 |
115 | # airflow.auth.managers
|
= help: Use `airflow.api_connexion.security.requires_access_asset` instead
@ -142,7 +141,7 @@ AIR302_names.py:117:1: AIR302 `airflow.auth.managers.models.resource_details.Dat
116 | is_authorized_dataset
117 | DatasetDetails()
| ^^^^^^^^^^^^^^ AIR302
118 |
118 |
119 | # airflow.configuration
|
= help: Use `airflow.auth.managers.models.resource_details.AssetDetails` instead
@ -216,7 +215,7 @@ AIR302_names.py:124:1: AIR302 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is
123 | # airflow.contrib.*
124 | AWSAthenaHook()
| ^^^^^^^^^^^^^ AIR302
125 |
125 |
126 | # airflow.datasets
|
@ -289,7 +288,7 @@ AIR302_names.py:133:1: AIR302 `airflow.datasets.metadata.Metadata` is removed in
132 | expand_alias_to_datasets
133 | Metadata()
| ^^^^^^^^ AIR302
134 |
134 |
135 | dataset_to_test_method_call = Dataset()
|
= help: Use `airflow.sdk.definitions.asset.metadata.Metadata` instead
@ -297,7 +296,7 @@ AIR302_names.py:133:1: AIR302 `airflow.datasets.metadata.Metadata` is removed in
AIR302_names.py:135:31: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
|
133 | Metadata()
134 |
134 |
135 | dataset_to_test_method_call = Dataset()
| ^^^^^^^ AIR302
136 | dataset_to_test_method_call.iter_datasets()
@ -320,7 +319,7 @@ AIR302_names.py:137:29: AIR302 `iter_dataset_aliases` is removed in Airflow 3.0
136 | dataset_to_test_method_call.iter_datasets()
137 | dataset_to_test_method_call.iter_dataset_aliases()
| ^^^^^^^^^^^^^^^^^^^^ AIR302
138 |
138 |
139 | alias_to_test_method_call = DatasetAlias()
|
= help: Use `iter_asset_aliases` instead
@ -328,7 +327,7 @@ AIR302_names.py:137:29: AIR302 `iter_dataset_aliases` is removed in Airflow 3.0
AIR302_names.py:139:29: AIR302 `airflow.datasets.DatasetAlias` is removed in Airflow 3.0
|
137 | dataset_to_test_method_call.iter_dataset_aliases()
138 |
138 |
139 | alias_to_test_method_call = DatasetAlias()
| ^^^^^^^^^^^^ AIR302
140 | alias_to_test_method_call.iter_datasets()
@ -351,7 +350,7 @@ AIR302_names.py:141:27: AIR302 `iter_dataset_aliases` is removed in Airflow 3.0
140 | alias_to_test_method_call.iter_datasets()
141 | alias_to_test_method_call.iter_dataset_aliases()
| ^^^^^^^^^^^^^^^^^^^^ AIR302
142 |
142 |
143 | any_to_test_method_call = DatasetAny()
|
= help: Use `iter_asset_aliases` instead
@ -359,7 +358,7 @@ AIR302_names.py:141:27: AIR302 `iter_dataset_aliases` is removed in Airflow 3.0
AIR302_names.py:143:27: AIR302 `airflow.datasets.DatasetAny` is removed in Airflow 3.0
|
141 | alias_to_test_method_call.iter_dataset_aliases()
142 |
142 |
143 | any_to_test_method_call = DatasetAny()
| ^^^^^^^^^^ AIR302
144 | any_to_test_method_call.iter_datasets()
@ -382,7 +381,7 @@ AIR302_names.py:145:25: AIR302 `iter_dataset_aliases` is removed in Airflow 3.0
144 | any_to_test_method_call.iter_datasets()
145 | any_to_test_method_call.iter_dataset_aliases()
| ^^^^^^^^^^^^^^^^^^^^ AIR302
146 |
146 |
147 | # airflow.datasets.manager
|
= help: Use `iter_asset_aliases` instead
@ -392,7 +391,7 @@ AIR302_names.py:148:19: AIR302 `airflow.datasets.manager.dataset_manager` is rem
147 | # airflow.datasets.manager
148 | DatasetManager(), dataset_manager, resolve_dataset_manager
| ^^^^^^^^^^^^^^^ AIR302
149 |
149 |
150 | # airflow.hooks
|
= help: Use `airflow.assets.manager` instead
@ -402,7 +401,7 @@ AIR302_names.py:148:36: AIR302 `airflow.datasets.manager.resolve_dataset_manager
147 | # airflow.datasets.manager
148 | DatasetManager(), dataset_manager, resolve_dataset_manager
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR302
149 |
149 |
150 | # airflow.hooks
|
= help: Use `airflow.assets.resolve_asset_manager` instead
@ -412,7 +411,7 @@ AIR302_names.py:151:1: AIR302 `airflow.hooks.base_hook.BaseHook` is removed in A
150 | # airflow.hooks
151 | BaseHook()
| ^^^^^^^^ AIR302
152 |
152 |
153 | # airflow.lineage.hook
|
= help: Use `airflow.hooks.base.BaseHook` instead
@ -422,7 +421,7 @@ AIR302_names.py:154:1: AIR302 `airflow.lineage.hook.DatasetLineageInfo` is remov
153 | # airflow.lineage.hook
154 | DatasetLineageInfo()
| ^^^^^^^^^^^^^^^^^^ AIR302
155 |
155 |
156 | # airflow.listeners.spec.dataset
|
= help: Use `airflow.lineage.hook.AssetLineageInfo` instead
@ -432,7 +431,7 @@ AIR302_names.py:157:1: AIR302 `airflow.listeners.spec.dataset.on_dataset_changed
156 | # airflow.listeners.spec.dataset
157 | on_dataset_changed, on_dataset_created
| ^^^^^^^^^^^^^^^^^^ AIR302
158 |
158 |
159 | # airflow.metrics.validators
|
= help: Use `airflow.listeners.spec.asset.on_asset_changed` instead
@ -442,7 +441,7 @@ AIR302_names.py:157:21: AIR302 `airflow.listeners.spec.dataset.on_dataset_create
156 | # airflow.listeners.spec.dataset
157 | on_dataset_changed, on_dataset_created
| ^^^^^^^^^^^^^^^^^^ AIR302
158 |
158 |
159 | # airflow.metrics.validators
|
= help: Use `airflow.listeners.spec.asset.on_asset_created` instead
@ -452,7 +451,7 @@ AIR302_names.py:160:1: AIR302 `airflow.metrics.validators.AllowListValidator` is
159 | # airflow.metrics.validators
160 | AllowListValidator(), BlockListValidator()
| ^^^^^^^^^^^^^^^^^^ AIR302
161 |
161 |
162 | # airflow.operators.dummy_operator
|
= help: Use `airflow.metrics.validators.PatternAllowListValidator` instead
@ -462,7 +461,7 @@ AIR302_names.py:160:23: AIR302 `airflow.metrics.validators.BlockListValidator` i
159 | # airflow.metrics.validators
160 | AllowListValidator(), BlockListValidator()
| ^^^^^^^^^^^^^^^^^^ AIR302
161 |
161 |
162 | # airflow.operators.dummy_operator
|
= help: Use `airflow.metrics.validators.PatternBlockListValidator` instead
@ -482,7 +481,7 @@ AIR302_names.py:164:16: AIR302 `airflow.operators.dummy_operator.DummyOperator`
163 | dummy_operator.EmptyOperator()
164 | dummy_operator.DummyOperator()
| ^^^^^^^^^^^^^ AIR302
165 |
165 |
166 | # airflow.operators.bash_operator
|
= help: Use `airflow.operators.empty.EmptyOperator` instead
@ -492,7 +491,7 @@ AIR302_names.py:167:1: AIR302 `airflow.operators.bash_operator.BashOperator` is
166 | # airflow.operators.bash_operator
167 | BashOperator()
| ^^^^^^^^^^^^ AIR302
168 |
168 |
169 | # airflow.operators.branch_operator
|
= help: Use `airflow.operators.bash.BashOperator` instead
@ -502,7 +501,7 @@ AIR302_names.py:170:1: AIR302 `airflow.operators.branch_operator.BaseBranchOpera
169 | # airflow.operators.branch_operator
170 | BaseBranchOperator()
| ^^^^^^^^^^^^^^^^^^ AIR302
171 |
171 |
172 | # airflow.operators.dagrun_operator
|
= help: Use `airflow.operators.branch.BaseBranchOperator` instead
@ -522,7 +521,7 @@ AIR302_names.py:174:1: AIR302 `airflow.operators.dagrun_operator.TriggerDagRunOp
173 | TriggerDagRunLink()
174 | TriggerDagRunOperator()
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
175 |
175 |
176 | # airflow.operators.dummy
|
= help: Use `airflow.operators.trigger_dagrun.TriggerDagRunOperator` instead
@ -532,7 +531,7 @@ AIR302_names.py:177:18: AIR302 `airflow.operators.dummy.DummyOperator` is remove
176 | # airflow.operators.dummy
177 | EmptyOperator(), DummyOperator()
| ^^^^^^^^^^^^^ AIR302
178 |
178 |
179 | # airflow.operators.email_operator
|
= help: Use `airflow.operators.empty.EmptyOperator` instead
@ -542,7 +541,7 @@ AIR302_names.py:180:1: AIR302 `airflow.operators.email_operator.EmailOperator` i
179 | # airflow.operators.email_operator
180 | EmailOperator()
| ^^^^^^^^^^^^^ AIR302
181 |
181 |
182 | # airflow.operators.latest_only_operator
|
= help: Use `airflow.operators.email.EmailOperator` instead
@ -552,7 +551,7 @@ AIR302_names.py:183:1: AIR302 `airflow.operators.latest_only_operator.LatestOnly
182 | # airflow.operators.latest_only_operator
183 | LatestOnlyOperator()
| ^^^^^^^^^^^^^^^^^^ AIR302
184 |
184 |
185 | # airflow.operators.python_operator
|
= help: Use `airflow.operators.latest_only.LatestOnlyOperator` instead
@ -594,7 +593,7 @@ AIR302_names.py:189:1: AIR302 `airflow.operators.python_operator.ShortCircuitOpe
188 | PythonVirtualenvOperator()
189 | ShortCircuitOperator()
| ^^^^^^^^^^^^^^^^^^^^ AIR302
190 |
190 |
191 | # airflow.operators.subdag.*
|
= help: Use `airflow.operators.python.ShortCircuitOperator` instead
@ -604,7 +603,7 @@ AIR302_names.py:192:1: AIR302 `airflow.operators.subdag.SubDagOperator` is remov
191 | # airflow.operators.subdag.*
192 | SubDagOperator()
| ^^^^^^^^^^^^^^ AIR302
193 |
193 |
194 | # airflow.providers.amazon
|
@ -645,7 +644,7 @@ AIR302_names.py:198:4: AIR302 `airflow.providers.amazon.aws.datasets.s3.sanitize
197 | s3.convert_dataset_to_openlineage
198 | s3.sanitize_uri
| ^^^^^^^^^^^^ AIR302
199 |
199 |
200 | # airflow.providers.common.io
|
= help: Use `airflow.providers.amazon.aws.assets.s3.sanitize_uri` instead
@ -676,7 +675,7 @@ AIR302_names.py:203:16: AIR302 `airflow.providers.common.io.datasets.file.saniti
202 | common_io_file.create_dataset
203 | common_io_file.sanitize_uri
| ^^^^^^^^^^^^ AIR302
204 |
204 |
205 | # airflow.providers.fab
|
= help: Use `airflow.providers.common.io.assets.file.sanitize_uri` instead
@ -686,7 +685,7 @@ AIR302_names.py:206:18: AIR302 `airflow.providers.fab.auth_manager.fab_auth_mana
205 | # airflow.providers.fab
206 | fab_auth_manager.is_authorized_dataset
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
207 |
207 |
208 | # airflow.providers.google
|
= help: Use `airflow.providers.fab.auth_manager.fab_auth_manager.is_authorized_asset` instead
@ -694,7 +693,7 @@ AIR302_names.py:206:18: AIR302 `airflow.providers.fab.auth_manager.fab_auth_mana
AIR302_names.py:211:5: AIR302 `airflow.providers.google.datasets.gcs.create_dataset` is removed in Airflow 3.0
|
209 | bigquery.sanitize_uri
210 |
210 |
211 | gcs.create_dataset
| ^^^^^^^^^^^^^^ AIR302
212 | gcs.sanitize_uri
@ -717,7 +716,7 @@ AIR302_names.py:213:5: AIR302 `airflow.providers.google.datasets.gcs.convert_dat
212 | gcs.sanitize_uri
213 | gcs.convert_dataset_to_openlineage
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
214 |
214 |
215 | # airflow.providers.mysql
|
= help: Use `airflow.providers.google.assets.gcs.convert_asset_to_openlineage` instead
@ -727,7 +726,7 @@ AIR302_names.py:216:7: AIR302 `airflow.providers.mysql.datasets.mysql.sanitize_u
215 | # airflow.providers.mysql
216 | mysql.sanitize_uri
| ^^^^^^^^^^^^ AIR302
217 |
217 |
218 | # airflow.providers.openlineage
|
= help: Use `airflow.providers.mysql.assets.mysql.sanitize_uri` instead
@ -737,7 +736,7 @@ AIR302_names.py:219:1: AIR302 `airflow.providers.openlineage.utils.utils.Dataset
218 | # airflow.providers.openlineage
219 | DatasetInfo(), translate_airflow_dataset
| ^^^^^^^^^^^ AIR302
220 |
220 |
221 | # airflow.providers.postgres
|
= help: Use `airflow.providers.openlineage.utils.utils.AssetInfo` instead
@ -747,7 +746,7 @@ AIR302_names.py:219:16: AIR302 `airflow.providers.openlineage.utils.utils.transl
218 | # airflow.providers.openlineage
219 | DatasetInfo(), translate_airflow_dataset
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
220 |
220 |
221 | # airflow.providers.postgres
|
= help: Use `airflow.providers.openlineage.utils.utils.translate_airflow_asset` instead
@ -757,7 +756,7 @@ AIR302_names.py:222:10: AIR302 `airflow.providers.postgres.datasets.postgres.san
221 | # airflow.providers.postgres
222 | postgres.sanitize_uri
| ^^^^^^^^^^^^ AIR302
223 |
223 |
224 | # airflow.providers.trino
|
= help: Use `airflow.providers.postgres.assets.postgres.sanitize_uri` instead
@ -767,7 +766,7 @@ AIR302_names.py:225:7: AIR302 `airflow.providers.trino.datasets.trino.sanitize_u
224 | # airflow.providers.trino
225 | trino.sanitize_uri
| ^^^^^^^^^^^^ AIR302
226 |
226 |
227 | # airflow.secrets
|
= help: Use `airflow.providers.trino.assets.trino.sanitize_uri` instead
@ -777,7 +776,7 @@ AIR302_names.py:228:1: AIR302 `airflow.secrets.local_filesystem.get_connection`
227 | # airflow.secrets
228 | get_connection, load_connections
| ^^^^^^^^^^^^^^ AIR302
229 |
229 |
230 | # airflow.security.permissions
|
= help: Use `airflow.secrets.local_filesystem.load_connections_dict` instead
@ -787,7 +786,7 @@ AIR302_names.py:228:17: AIR302 `airflow.secrets.local_filesystem.load_connection
227 | # airflow.secrets
228 | get_connection, load_connections
| ^^^^^^^^^^^^^^^^ AIR302
229 |
229 |
230 | # airflow.security.permissions
|
= help: Use `airflow.secrets.local_filesystem.load_connections_dict` instead
@ -797,7 +796,7 @@ AIR302_names.py:231:1: AIR302 `airflow.security.permissions.RESOURCE_DATASET` is
230 | # airflow.security.permissions
231 | RESOURCE_DATASET
| ^^^^^^^^^^^^^^^^ AIR302
232 |
232 |
233 | # airflow.sensors.base_sensor_operator
|
= help: Use `airflow.security.permissions.RESOURCE_ASSET` instead
@ -807,7 +806,7 @@ AIR302_names.py:234:1: AIR302 `airflow.sensors.base_sensor_operator.BaseSensorOp
233 | # airflow.sensors.base_sensor_operator
234 | BaseSensorOperator()
| ^^^^^^^^^^^^^^^^^^ AIR302
235 |
235 |
236 | # airflow.sensors.date_time_sensor
|
= help: Use `airflow.sensors.base.BaseSensorOperator` instead
@ -817,7 +816,7 @@ AIR302_names.py:237:1: AIR302 `airflow.sensors.date_time_sensor.DateTimeSensor`
236 | # airflow.sensors.date_time_sensor
237 | DateTimeSensor()
| ^^^^^^^^^^^^^^ AIR302
238 |
238 |
239 | # airflow.sensors.external_task
|
= help: Use `airflow.sensors.date_time.DateTimeSensor` instead
@ -827,7 +826,7 @@ AIR302_names.py:240:1: AIR302 `airflow.sensors.external_task.ExternalTaskSensorL
239 | # airflow.sensors.external_task
240 | ExternalTaskSensorLinkFromExternalTask()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
241 |
241 |
242 | # airflow.sensors.external_task_sensor
|
= help: Use `airflow.sensors.external_task.ExternalDagLink` instead
@ -858,7 +857,7 @@ AIR302_names.py:245:1: AIR302 `airflow.sensors.external_task_sensor.ExternalTask
244 | ExternalTaskSensor()
245 | ExternalTaskSensorLinkFromExternalTaskSensor()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
246 |
246 |
247 | # airflow.sensors.time_delta_sensor
|
= help: Use `airflow.sensors.external_task.ExternalDagLink` instead
@ -868,7 +867,7 @@ AIR302_names.py:248:1: AIR302 `airflow.sensors.time_delta_sensor.TimeDeltaSensor
247 | # airflow.sensors.time_delta_sensor
248 | TimeDeltaSensor()
| ^^^^^^^^^^^^^^^ AIR302
249 |
249 |
250 | # airflow.timetables
|
= help: Use `airflow.sensors.time_delta.TimeDeltaSensor` instead
@ -888,7 +887,7 @@ AIR302_names.py:252:1: AIR302 `airflow.timetables.simple.DatasetTriggeredTimetab
251 | DatasetOrTimeSchedule()
252 | DatasetTriggeredTimetable()
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
253 |
253 |
254 | # airflow.triggers.external_task
|
= help: Use `airflow.timetables.simple.AssetTriggeredTimetable` instead
@ -898,7 +897,7 @@ AIR302_names.py:255:1: AIR302 `airflow.triggers.external_task.TaskStateTrigger`
254 | # airflow.triggers.external_task
255 | TaskStateTrigger()
| ^^^^^^^^^^^^^^^^ AIR302
256 |
256 |
257 | # airflow.utils.date
|
@ -917,7 +916,7 @@ AIR302_names.py:259:7: AIR302 `airflow.utils.dates.days_ago` is removed in Airfl
258 | dates.date_range
259 | dates.days_ago
| ^^^^^^^^ AIR302
260 |
260 |
261 | date_range
|
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
@ -925,7 +924,7 @@ AIR302_names.py:259:7: AIR302 `airflow.utils.dates.days_ago` is removed in Airfl
AIR302_names.py:261:1: AIR302 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
259 | dates.days_ago
260 |
260 |
261 | date_range
| ^^^^^^^^^^ AIR302
262 | days_ago
@ -978,7 +977,7 @@ AIR302_names.py:266:1: AIR302 `airflow.utils.dates.scale_time_units` is removed
265 | round_time
266 | scale_time_units
| ^^^^^^^^^^^^^^^^ AIR302
267 |
267 |
268 | # This one was not deprecated.
|
@ -987,7 +986,7 @@ AIR302_names.py:273:1: AIR302 `airflow.utils.dag_cycle_tester.test_cycle` is rem
272 | # airflow.utils.dag_cycle_tester
273 | test_cycle
| ^^^^^^^^^^ AIR302
274 |
274 |
275 | # airflow.utils.decorators
|
@ -996,7 +995,7 @@ AIR302_names.py:276:1: AIR302 `airflow.utils.decorators.apply_defaults` is remov
275 | # airflow.utils.decorators
276 | apply_defaults
| ^^^^^^^^^^^^^^ AIR302
277 |
277 |
278 | # airflow.utils.file
|
@ -1005,7 +1004,7 @@ AIR302_names.py:279:22: AIR302 `airflow.utils.file.mkdirs` is removed in Airflow
278 | # airflow.utils.file
279 | TemporaryDirector(), mkdirs
| ^^^^^^ AIR302
280 |
280 |
281 | # airflow.utils.helpers
|
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
@ -1015,7 +1014,7 @@ AIR302_names.py:282:1: AIR302 `airflow.utils.helpers.chain` is removed in Airflo
281 | # airflow.utils.helpers
282 | chain, cross_downstream
| ^^^^^ AIR302
283 |
283 |
284 | # airflow.utils.state
|
= help: Use `airflow.models.baseoperator.chain` instead
@ -1025,7 +1024,7 @@ AIR302_names.py:282:8: AIR302 `airflow.utils.helpers.cross_downstream` is remove
281 | # airflow.utils.helpers
282 | chain, cross_downstream
| ^^^^^^^^^^^^^^^^ AIR302
283 |
283 |
284 | # airflow.utils.state
|
= help: Use `airflow.models.baseoperator.cross_downstream` instead
@ -1035,7 +1034,7 @@ AIR302_names.py:285:1: AIR302 `airflow.utils.state.SHUTDOWN` is removed in Airfl
284 | # airflow.utils.state
285 | SHUTDOWN, terminating_states
| ^^^^^^^^ AIR302
286 |
286 |
287 | # airflow.utils.trigger_rule
|
@ -1044,7 +1043,7 @@ AIR302_names.py:285:11: AIR302 `airflow.utils.state.terminating_states` is remov
284 | # airflow.utils.state
285 | SHUTDOWN, terminating_states
| ^^^^^^^^^^^^^^^^^^ AIR302
286 |
286 |
287 | # airflow.utils.trigger_rule
|
@ -1062,7 +1061,7 @@ AIR302_names.py:289:13: AIR302 `airflow.utils.trigger_rule.TriggerRule.NONE_FAIL
288 | TriggerRule.DUMMY
289 | TriggerRule.NONE_FAILED_OR_SKIPPED
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
290 |
290 |
291 | # airflow.www.auth
|
@ -1081,7 +1080,7 @@ AIR302_names.py:293:1: AIR302 `airflow.www.auth.has_access_dataset` is removed i
292 | has_access
293 | has_access_dataset
| ^^^^^^^^^^^^^^^^^^ AIR302
294 |
294 |
295 | # airflow.www.utils
|
= help: Use `airflow.www.auth.has_access_dataset.has_access_asset` instead

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/airflow/mod.rs
snapshot_kind: text
---
AIR303.py:159:1: AIR303 `airflow.hooks.S3_hook.provide_bucket_name` is moved into `amazon` provider in Airflow 3.0;
|
@ -116,7 +115,7 @@ AIR303.py:169:1: AIR303 `airflow.operators.s3_to_redshift_operator.S3ToRedshiftT
168 | S3ToRedshiftOperator()
169 | S3ToRedshiftTransfer()
| ^^^^^^^^^^^^^^^^^^^^ AIR303
170 |
170 |
171 | # apache-airflow-providers-celery
|
= help: Install `apache-airflow-provider-amazon>=1.0.0` and use `airflow.providers.amazon.aws.transfers.s3_to_redshift.S3ToRedshiftOperator` instead.
@ -158,7 +157,7 @@ AIR303.py:175:1: AIR303 `airflow.executors.celery_kubernetes_executor.CeleryKube
174 | CeleryExecutor()
175 | CeleryKubernetesExecutor()
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR303
176 |
176 |
177 | # apache-airflow-providers-common-sql
|
= help: Install `apache-airflow-provider-celery>=3.3.0` and use `airflow.providers.celery.executors.celery_kubernetes_executor.CeleryKubernetesExecutor` instead.
@ -453,7 +452,7 @@ AIR303.py:206:1: AIR303 `airflow.operators.check_operator.ValueCheckOperator` is
205 | ThresholdCheckOperator()
206 | ValueCheckOperator()
| ^^^^^^^^^^^^^^^^^^ AIR303
207 |
207 |
208 | # apache-airflow-providers-daskexecutor
|
= help: Install `apache-airflow-provider-common-sql>=1.1.0` and use `airflow.providers.common.sql.operators.sql.SQLValueCheckOperator` instead.
@ -463,7 +462,7 @@ AIR303.py:209:1: AIR303 `airflow.executors.dask_executor.DaskExecutor` is moved
208 | # apache-airflow-providers-daskexecutor
209 | DaskExecutor()
| ^^^^^^^^^^^^ AIR303
210 |
210 |
211 | # apache-airflow-providers-docker
|
= help: Install `apache-airflow-provider-daskexecutor>=1.0.0` and use `airflow.providers.daskexecutor.executors.dask_executor.DaskExecutor` instead.
@ -483,7 +482,7 @@ AIR303.py:213:1: AIR303 `airflow.operators.docker_operator.DockerOperator` is mo
212 | DockerHook()
213 | DockerOperator()
| ^^^^^^^^^^^^^^ AIR303
214 |
214 |
215 | # apache-airflow-providers-apache-druid
|
= help: Install `apache-airflow-provider-docker>=1.0.0` and use `airflow.providers.docker.operators.docker.DockerOperator` instead.
@ -514,7 +513,7 @@ AIR303.py:218:1: AIR303 `airflow.operators.druid_check_operator.DruidCheckOperat
217 | DruidHook()
218 | DruidCheckOperator()
| ^^^^^^^^^^^^^^^^^^ AIR303
219 |
219 |
220 | # apache-airflow-providers-apache-hdfs
|
= help: Install `apache-airflow-provider-apache-druid>=1.0.0` and use `DruidCheckOperator` instead.
@ -534,7 +533,7 @@ AIR303.py:222:1: AIR303 `airflow.sensors.web_hdfs_sensor.WebHdfsSensor` is moved
221 | WebHDFSHook()
222 | WebHdfsSensor()
| ^^^^^^^^^^^^^ AIR303
223 |
223 |
224 | # apache-airflow-providers-apache-hive
|
= help: Install `apache-airflow-provider-apache-hdfs>=1.0.0` and use `airflow.providers.apache.hdfs.sensors.web_hdfs.WebHdfsSensor` instead.
@ -708,7 +707,7 @@ AIR303.py:240:1: AIR303 `airflow.sensors.named_hive_partition_sensor.NamedHivePa
239 | MetastorePartitionSensor()
240 | NamedHivePartitionSensor()
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR303
241 |
241 |
242 | # apache-airflow-providers-http
|
= help: Install `apache-airflow-provider-apache-hive>=1.0.0` and use `airflow.providers.apache.hive.sensors.named_hive_partition.NamedHivePartitionSensor` instead.
@ -739,7 +738,7 @@ AIR303.py:245:1: AIR303 `airflow.operators.http_operator.SimpleHttpOperator` is
244 | HttpSensor()
245 | SimpleHttpOperator()
| ^^^^^^^^^^^^^^^^^^ AIR303
246 |
246 |
247 | # apache-airflow-providers-jdbc
|
= help: Install `apache-airflow-provider-http>=1.0.0` and use `airflow.providers.http.operators.http.SimpleHttpOperator` instead.
@ -770,7 +769,7 @@ AIR303.py:250:1: AIR303 `airflow.operators.jdbc_operator.JdbcOperator` is moved
249 | JdbcHook()
250 | JdbcOperator()
| ^^^^^^^^^^^^ AIR303
251 |
251 |
252 | # apache-airflow-providers-fab
|
= help: Install `apache-airflow-provider-jdbc>=1.0.0` and use `airflow.providers.jdbc.operators.jdbc.JdbcOperator` instead.
@ -844,7 +843,7 @@ AIR303.py:258:1: AIR303 `airflow.www.security.FabAirflowSecurityManagerOverride`
257 | FabAuthManager()
258 | FabAirflowSecurityManagerOverride()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR303
259 |
259 |
260 | # apache-airflow-providers-cncf-kubernetes
|
= help: Install `apache-airflow-provider-fab>=1.0.0` and use `airflow.providers.fab.auth_manager.security_manager.override.FabAirflowSecurityManagerOverride` instead.
@ -1062,7 +1061,7 @@ AIR303.py:280:1: AIR303 `airflow.kubernetes.secret.Secret` is moved into `cncf-k
279 | VolumeMount()
280 | Secret()
| ^^^^^^ AIR303
281 |
281 |
282 | add_pod_suffix()
|
= help: Install `apache-airflow-provider-cncf-kubernetes>=7.4.0` and use `airflow.providers.cncf.kubernetes.secret.Secret` instead.
@ -1070,7 +1069,7 @@ AIR303.py:280:1: AIR303 `airflow.kubernetes.secret.Secret` is moved into `cncf-k
AIR303.py:282:1: AIR303 `airflow.kubernetes.kubernetes_helper_functions.add_pod_suffix` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
280 | Secret()
281 |
281 |
282 | add_pod_suffix()
| ^^^^^^^^^^^^^^ AIR303
283 | add_pod_suffix2()
@ -1298,7 +1297,7 @@ AIR303.py:307:1: AIR303 `airflow.operators.mssql_to_hive.MsSqlToHiveTransfer` is
306 | MsSqlToHiveOperator()
307 | MsSqlToHiveTransfer()
| ^^^^^^^^^^^^^^^^^^^ AIR303
308 |
308 |
309 | # apache-airflow-providers-mysql
|
= help: Install `apache-airflow-provider-apache-hive>=1.0.0` and use `airflow.providers.apache.hive.transfers.mssql_to_hive.MsSqlToHiveOperator` instead.
@ -1384,7 +1383,7 @@ AIR303.py:317:1: AIR303 `airflow.operators.presto_to_mysql.PrestoToMySqlTransfer
316 | PrestoToMySqlOperator()
317 | PrestoToMySqlTransfer()
| ^^^^^^^^^^^^^^^^^^^^^ AIR303
318 |
318 |
319 | # apache-airflow-providers-oracle
|
= help: Install `apache-airflow-provider-mysql>=1.0.0` and use `airflow.providers.mysql.transfers.presto_to_mysql.PrestoToMySqlOperator` instead.
@ -1404,7 +1403,7 @@ AIR303.py:321:1: AIR303 `airflow.operators.oracle_operator.OracleOperator` is mo
320 | OracleHook()
321 | OracleOperator()
| ^^^^^^^^^^^^^^ AIR303
322 |
322 |
323 | # apache-airflow-providers-papermill
|
= help: Install `apache-airflow-provider-oracle>=1.0.0` and use `airflow.providers.oracle.operators.oracle.OracleOperator` instead.
@ -1414,7 +1413,7 @@ AIR303.py:324:1: AIR303 `airflow.operators.papermill_operator.PapermillOperator`
323 | # apache-airflow-providers-papermill
324 | PapermillOperator()
| ^^^^^^^^^^^^^^^^^ AIR303
325 |
325 |
326 | # apache-airflow-providers-apache-pig
|
= help: Install `apache-airflow-provider-papermill>=1.0.0` and use `airflow.providers.papermill.operators.papermill.PapermillOperator` instead.
@ -1434,7 +1433,7 @@ AIR303.py:328:1: AIR303 `airflow.operators.pig_operator.PigOperator` is moved in
327 | PigCliHook()
328 | PigOperator()
| ^^^^^^^^^^^ AIR303
329 |
329 |
330 | # apache-airflow-providers-postgres
|
= help: Install `apache-airflow-provider-apache-pig>=1.0.0` and use `airflow.providers.apache.pig.operators.pig.PigOperator` instead.
@ -1465,7 +1464,7 @@ AIR303.py:333:1: AIR303 `airflow.operators.postgres_operator.PostgresOperator` i
332 | PostgresHook()
333 | PostgresOperator()
| ^^^^^^^^^^^^^^^^ AIR303
334 |
334 |
335 | # apache-airflow-providers-presto
|
= help: Install `apache-airflow-provider-postgres>=1.0.0` and use `airflow.providers.postgres.operators.postgres.PostgresOperator` instead.
@ -1475,7 +1474,7 @@ AIR303.py:336:1: AIR303 `airflow.hooks.presto_hook.PrestoHook` is moved into `pr
335 | # apache-airflow-providers-presto
336 | PrestoHook()
| ^^^^^^^^^^ AIR303
337 |
337 |
338 | # apache-airflow-providers-samba
|
= help: Install `apache-airflow-provider-presto>=1.0.0` and use `airflow.providers.presto.hooks.presto.PrestoHook` instead.
@ -1485,7 +1484,7 @@ AIR303.py:339:1: AIR303 `airflow.hooks.samba_hook.SambaHook` is moved into `samb
338 | # apache-airflow-providers-samba
339 | SambaHook()
| ^^^^^^^^^ AIR303
340 |
340 |
341 | # apache-airflow-providers-slack
|
= help: Install `apache-airflow-provider-samba>=1.0.0` and use `airflow.providers.samba.hooks.samba.SambaHook` instead.
@ -1516,7 +1515,7 @@ AIR303.py:344:1: AIR303 `airflow.operators.slack_operator.SlackAPIPostOperator`
343 | SlackAPIOperator()
344 | SlackAPIPostOperator()
| ^^^^^^^^^^^^^^^^^^^^ AIR303
345 |
345 |
346 | # apache-airflow-providers-sqlite
|
= help: Install `apache-airflow-provider-slack>=1.0.0` and use `airflow.providers.slack.operators.slack.SlackAPIPostOperator` instead.
@ -1536,7 +1535,7 @@ AIR303.py:348:1: AIR303 `airflow.operators.sqlite_operator.SqliteOperator` is mo
347 | SqliteHook()
348 | SqliteOperator()
| ^^^^^^^^^^^^^^ AIR303
349 |
349 |
350 | # apache-airflow-providers-zendesk
|
= help: Install `apache-airflow-provider-sqlite>=1.0.0` and use `airflow.providers.sqlite.operators.sqlite.SqliteOperator` instead.

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/eradicate/mod.rs
snapshot_kind: text
---
ERA001.py:1:1: ERA001 Found commented-out code
|
@ -59,7 +58,7 @@ ERA001.py:5:1: ERA001 Found commented-out code
4 | a = 4
5 | #foo(1, 2, 3)
| ^^^^^^^^^^^^^ ERA001
6 |
6 |
7 | def foo(x, y, z):
|
= help: Remove commented-out code
@ -152,7 +151,7 @@ ERA001.py:27:5: ERA001 Found commented-out code
ERA001.py:32:1: ERA001 Found commented-out code
|
30 | #import os # noqa
31 |
31 |
32 | # case 1:
| ^^^^^^^^^ ERA001
33 | # try:
@ -349,7 +348,7 @@ ERA001.py:78:1: ERA001 Found commented-out code
77 | # "rich",
78 | # ]
| ^^^ ERA001
79 |
79 |
80 | # Script tag block followed by normal block (Ok)
|
= help: Remove commented-out code

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT101.py:6:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
4 | print(sys.version)
5 |
5 |
6 | print(sys.version[:3])
| ^^^^^^^^^^^ YTT101
7 | print(version[:3])
@ -26,6 +25,6 @@ YTT101.py:8:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.versio
7 | print(version[:3])
8 | print(v[:3])
| ^ YTT101
9 |
9 |
10 | # the tool is timid and only flags certain numeric slices
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT102.py:4:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
|
2 | from sys import version
3 |
3 |
4 | py_minor = sys.version[2]
| ^^^^^^^^^^^ YTT102
5 | py_minor = version[2]

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT103.py:4:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
2 | from sys import version
3 |
3 |
4 | version < "3.5"
| ^^^^^^^ YTT103
5 | sys.version < "3.5"

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT201.py:7:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
|
5 | PY3 = sys.version_info[0] >= 3
6 |
6 |
7 | PY3 = sys.version_info[0] == 3
| ^^^^^^^^^^^^^^^^^^^ YTT201
8 | PY3 = version_info[0] == 3

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT202.py:4:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2`
|
2 | from six import PY3
3 |
3 |
4 | if six.PY3:
| ^^^^^^^ YTT202
5 | print("3")

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT203.py:4:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple
|
2 | from sys import version_info
3 |
3 |
4 | sys.version_info[1] >= 5
| ^^^^^^^^^^^^^^^^^^^ YTT203
5 | version_info[1] < 6

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT204.py:4:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple
|
2 | from sys import version_info
3 |
3 |
4 | sys.version_info.minor <= 7
| ^^^^^^^^^^^^^^^^^^^^^^ YTT204
5 | version_info.minor > 8

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT301.py:4:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info`
|
2 | from sys import version
3 |
3 |
4 | py_major = sys.version[0]
| ^^^^^^^^^^^ YTT301
5 | py_major = version[0]

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT302.py:4:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info`
|
2 | from sys import version
3 |
3 |
4 | version < "3"
| ^^^^^^^ YTT302
5 | sys.version < "3"

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
---
YTT303.py:4:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info`
|
2 | from sys import version
3 |
3 |
4 | print(sys.version[:1])
| ^^^^^^^^^^^ YTT303
5 | print(version[:1])

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
---
ignore_fully_untyped.py:24:5: ANN201 [*] Missing return type annotation for public function `error_partially_typed_1`
|
@ -55,7 +54,7 @@ ignore_fully_untyped.py:32:5: ANN201 [*] Missing return type annotation for publ
ignore_fully_untyped.py:43:9: ANN201 [*] Missing return type annotation for public function `error_typed_self`
|
41 | pass
42 |
42 |
43 | def error_typed_self(self: X):
| ^^^^^^^^^^^^^^^^ ANN201
44 | pass

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
---
simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for special method `__str__`
|
@ -22,7 +21,7 @@ simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for speci
simple_magic_methods.py:5:9: ANN204 [*] Missing return type annotation for special method `__repr__`
|
3 | ...
4 |
4 |
5 | def __repr__(self):
| ^^^^^^^^ ANN204
6 | ...
@ -42,7 +41,7 @@ simple_magic_methods.py:5:9: ANN204 [*] Missing return type annotation for speci
simple_magic_methods.py:8:9: ANN204 [*] Missing return type annotation for special method `__len__`
|
6 | ...
7 |
7 |
8 | def __len__(self):
| ^^^^^^^ ANN204
9 | ...
@ -62,7 +61,7 @@ simple_magic_methods.py:8:9: ANN204 [*] Missing return type annotation for speci
simple_magic_methods.py:11:9: ANN204 [*] Missing return type annotation for special method `__length_hint__`
|
9 | ...
10 |
10 |
11 | def __length_hint__(self):
| ^^^^^^^^^^^^^^^ ANN204
12 | ...
@ -82,7 +81,7 @@ simple_magic_methods.py:11:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:14:9: ANN204 [*] Missing return type annotation for special method `__init__`
|
12 | ...
13 |
13 |
14 | def __init__(self):
| ^^^^^^^^ ANN204
15 | ...
@ -102,7 +101,7 @@ simple_magic_methods.py:14:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:17:9: ANN204 [*] Missing return type annotation for special method `__del__`
|
15 | ...
16 |
16 |
17 | def __del__(self):
| ^^^^^^^ ANN204
18 | ...
@ -122,7 +121,7 @@ simple_magic_methods.py:17:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:20:9: ANN204 [*] Missing return type annotation for special method `__bool__`
|
18 | ...
19 |
19 |
20 | def __bool__(self):
| ^^^^^^^^ ANN204
21 | ...
@ -142,7 +141,7 @@ simple_magic_methods.py:20:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:23:9: ANN204 [*] Missing return type annotation for special method `__bytes__`
|
21 | ...
22 |
22 |
23 | def __bytes__(self):
| ^^^^^^^^^ ANN204
24 | ...
@ -162,7 +161,7 @@ simple_magic_methods.py:23:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:26:9: ANN204 [*] Missing return type annotation for special method `__format__`
|
24 | ...
25 |
25 |
26 | def __format__(self, format_spec):
| ^^^^^^^^^^ ANN204
27 | ...
@ -182,7 +181,7 @@ simple_magic_methods.py:26:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:29:9: ANN204 [*] Missing return type annotation for special method `__contains__`
|
27 | ...
28 |
28 |
29 | def __contains__(self, item):
| ^^^^^^^^^^^^ ANN204
30 | ...
@ -202,7 +201,7 @@ simple_magic_methods.py:29:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:32:9: ANN204 [*] Missing return type annotation for special method `__complex__`
|
30 | ...
31 |
31 |
32 | def __complex__(self):
| ^^^^^^^^^^^ ANN204
33 | ...
@ -222,7 +221,7 @@ simple_magic_methods.py:32:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:35:9: ANN204 [*] Missing return type annotation for special method `__int__`
|
33 | ...
34 |
34 |
35 | def __int__(self):
| ^^^^^^^ ANN204
36 | ...
@ -242,7 +241,7 @@ simple_magic_methods.py:35:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:38:9: ANN204 [*] Missing return type annotation for special method `__float__`
|
36 | ...
37 |
37 |
38 | def __float__(self):
| ^^^^^^^^^ ANN204
39 | ...
@ -262,7 +261,7 @@ simple_magic_methods.py:38:9: ANN204 [*] Missing return type annotation for spec
simple_magic_methods.py:41:9: ANN204 [*] Missing return type annotation for special method `__index__`
|
39 | ...
40 |
40 |
41 | def __index__(self):
| ^^^^^^^^^ ANN204
42 | ...

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC105.py:30:5: ASYNC105 [*] Call to `trio.aclose_forcefully` is not immediately awaited
|
@ -468,7 +467,7 @@ ASYNC105.py:53:5: ASYNC105 [*] Call to `trio.lowlevel.wait_writable` is not imme
52 | trio.lowlevel.wait_task_rescheduled(foo)
53 | trio.lowlevel.wait_writable(foo)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ASYNC105
54 |
54 |
55 | async with await trio.open_file(foo): # Ok
|
= help: Add `await`
@ -486,7 +485,7 @@ ASYNC105.py:53:5: ASYNC105 [*] Call to `trio.lowlevel.wait_writable` is not imme
ASYNC105.py:58:16: ASYNC105 [*] Call to `trio.open_file` is not immediately awaited
|
56 | pass
57 |
57 |
58 | async with trio.open_file(foo): # ASYNC105
| ^^^^^^^^^^^^^^^^^^^ ASYNC105
59 | pass

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC115.py:5:11: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
3 | from trio import sleep
4 |
4 |
5 | await trio.sleep(0) # ASYNC115
| ^^^^^^^^^^^^^ ASYNC115
6 | await trio.sleep(1) # OK
@ -26,7 +25,7 @@ ASYNC115.py:5:11: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio
ASYNC115.py:11:5: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
9 | await trio.sleep() # OK
10 |
10 |
11 | trio.sleep(0) # ASYNC115
| ^^^^^^^^^^^^^ ASYNC115
12 | foo = 0
@ -47,10 +46,10 @@ ASYNC115.py:11:5: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio
ASYNC115.py:17:5: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
15 | time.sleep(0) # OK
16 |
16 |
17 | sleep(0) # ASYNC115
| ^^^^^^^^ ASYNC115
18 |
18 |
19 | bar = "bar"
|
= help: Replace with `trio.lowlevel.checkpoint()`
@ -68,7 +67,7 @@ ASYNC115.py:17:5: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio
ASYNC115.py:48:14: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
46 | import trio
47 |
47 |
48 | trio.run(trio.sleep(0)) # ASYNC115
| ^^^^^^^^^^^^^ ASYNC115
|
@ -137,7 +136,7 @@ ASYNC115.py:59:11: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `tri
ASYNC115.py:85:11: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `asyncio.sleep(0)`
|
83 | from anyio import sleep
84 |
84 |
85 | await anyio.sleep(0) # ASYNC115
| ^^^^^^^^^^^^^^ ASYNC115
86 | await anyio.sleep(1) # OK
@ -166,7 +165,7 @@ ASYNC115.py:85:11: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `
ASYNC115.py:91:5: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `asyncio.sleep(0)`
|
89 | await anyio.sleep() # OK
90 |
90 |
91 | anyio.sleep(0) # ASYNC115
| ^^^^^^^^^^^^^^ ASYNC115
92 | foo = 0
@ -195,10 +194,10 @@ ASYNC115.py:91:5: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `a
ASYNC115.py:97:5: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `asyncio.sleep(0)`
|
95 | time.sleep(0) # OK
96 |
96 |
97 | sleep(0) # ASYNC115
| ^^^^^^^^ ASYNC115
98 |
98 |
99 | bar = "bar"
|
= help: Replace with `asyncio.lowlevel.checkpoint()`
@ -224,7 +223,7 @@ ASYNC115.py:97:5: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `a
ASYNC115.py:128:15: ASYNC115 [*] Use `asyncio.lowlevel.checkpoint()` instead of `asyncio.sleep(0)`
|
126 | import anyio
127 |
127 |
128 | anyio.run(anyio.sleep(0)) # ASYNC115
| ^^^^^^^^^^^^^^ ASYNC115
|

View file

@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC116.py:11:11: ASYNC116 [*] `trio.sleep()` with >24 hour interval should usually be `trio.sleep_forever()`
|
10 | # These examples are probably not meant to ever wake up:
11 | await trio.sleep(100000) # error: 116, "async"
| ^^^^^^^^^^^^^^^^^^ ASYNC116
12 |
12 |
13 | # 'inf literal' overflow trick
|
= help: Replace with `trio.sleep_forever()`
@ -27,7 +26,7 @@ ASYNC116.py:14:11: ASYNC116 [*] `trio.sleep()` with >24 hour interval should usu
13 | # 'inf literal' overflow trick
14 | await trio.sleep(1e999) # error: 116, "async"
| ^^^^^^^^^^^^^^^^^ ASYNC116
15 |
15 |
16 | await trio.sleep(86399)
|
= help: Replace with `trio.sleep_forever()`
@ -68,7 +67,7 @@ ASYNC116.py:19:11: ASYNC116 [*] `trio.sleep()` with >24 hour interval should usu
18 | await trio.sleep(86400.01) # error: 116, "async"
19 | await trio.sleep(86401) # error: 116, "async"
| ^^^^^^^^^^^^^^^^^ ASYNC116
20 |
20 |
21 | await trio.sleep(-1) # will raise a runtime error
|
= help: Replace with `trio.sleep_forever()`
@ -153,7 +152,7 @@ ASYNC116.py:64:11: ASYNC116 [*] `asyncio.sleep()` with >24 hour interval should
63 | # These examples are probably not meant to ever wake up:
64 | await anyio.sleep(100000) # error: 116, "async"
| ^^^^^^^^^^^^^^^^^^^ ASYNC116
65 |
65 |
66 | # 'inf literal' overflow trick
|
= help: Replace with `asyncio.sleep_forever()`
@ -181,7 +180,7 @@ ASYNC116.py:67:11: ASYNC116 [*] `asyncio.sleep()` with >24 hour interval should
66 | # 'inf literal' overflow trick
67 | await anyio.sleep(1e999) # error: 116, "async"
| ^^^^^^^^^^^^^^^^^^ ASYNC116
68 |
68 |
69 | await anyio.sleep(86399)
|
= help: Replace with `asyncio.sleep_forever()`
@ -238,7 +237,7 @@ ASYNC116.py:72:11: ASYNC116 [*] `asyncio.sleep()` with >24 hour interval should
71 | await anyio.sleep(86400.01) # error: 116, "async"
72 | await anyio.sleep(86401) # error: 116, "async"
| ^^^^^^^^^^^^^^^^^^ ASYNC116
73 |
73 |
74 | await anyio.sleep(-1) # will raise a runtime error
|
= help: Replace with `asyncio.sleep_forever()`

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC210.py:8:5: ASYNC210 Async functions should not call blocking HTTP methods
|
@ -71,7 +70,7 @@ ASYNC210.py:32:11: ASYNC210 Async functions should not call blocking HTTP method
31 | print(requests.get()) # ASYNC210
32 | print(requests.get(requests.get())) # ASYNC210
| ^^^^^^^^^^^^ ASYNC210
33 |
33 |
34 | requests.options() # ASYNC210
|
@ -81,14 +80,14 @@ ASYNC210.py:32:24: ASYNC210 Async functions should not call blocking HTTP method
31 | print(requests.get()) # ASYNC210
32 | print(requests.get(requests.get())) # ASYNC210
| ^^^^^^^^^^^^ ASYNC210
33 |
33 |
34 | requests.options() # ASYNC210
|
ASYNC210.py:34:5: ASYNC210 Async functions should not call blocking HTTP methods
|
32 | print(requests.get(requests.get())) # ASYNC210
33 |
33 |
34 | requests.options() # ASYNC210
| ^^^^^^^^^^^^^^^^ ASYNC210
35 | requests.head() # ASYNC210
@ -146,7 +145,7 @@ ASYNC210.py:39:5: ASYNC210 Async functions should not call blocking HTTP methods
ASYNC210.py:42:5: ASYNC210 Async functions should not call blocking HTTP methods
|
40 | requests.foo()
41 |
41 |
42 | httpx.options("") # ASYNC210
| ^^^^^^^^^^^^^ ASYNC210
43 | httpx.head("") # ASYNC210
@ -204,7 +203,7 @@ ASYNC210.py:47:5: ASYNC210 Async functions should not call blocking HTTP methods
ASYNC210.py:50:5: ASYNC210 Async functions should not call blocking HTTP methods
|
48 | httpx.foo() # Ok
49 |
49 |
50 | urllib3.request() # ASYNC210
| ^^^^^^^^^^^^^^^ ASYNC210
51 | urllib3.request(...) # ASYNC210
@ -215,16 +214,16 @@ ASYNC210.py:51:5: ASYNC210 Async functions should not call blocking HTTP methods
50 | urllib3.request() # ASYNC210
51 | urllib3.request(...) # ASYNC210
| ^^^^^^^^^^^^^^^ ASYNC210
52 |
52 |
53 | urllib.request.urlopen("") # ASYNC210
|
ASYNC210.py:53:5: ASYNC210 Async functions should not call blocking HTTP methods
|
51 | urllib3.request(...) # ASYNC210
52 |
52 |
53 | urllib.request.urlopen("") # ASYNC210
| ^^^^^^^^^^^^^^^^^^^^^^ ASYNC210
54 |
54 |
55 | r = {}
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC22x.py:31:5: ASYNC220 Async functions should not create subprocesses with blocking methods
|
@ -45,7 +44,7 @@ ASYNC22x.py:76:5: ASYNC220 Async functions should not create subprocesses with b
75 | os.spawnl(mode=os.P_NOWAIT) # ASYNC220
76 | os.spawnl(mode=P_NOWAIT) # ASYNC220
| ^^^^^^^^^ ASYNC220
77 |
77 |
78 | P_WAIT = os.P_WAIT
|
@ -73,6 +72,6 @@ ASYNC22x.py:88:5: ASYNC220 Async functions should not create subprocesses with b
87 | os.spawnl(1) # ASYNC220
88 | os.spawnl(foo()) # ASYNC220
| ^^^^^^^^^ ASYNC220
89 |
89 |
90 | # ASYNC222
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC22x.py:8:5: ASYNC221 Async functions should not run processes with blocking methods
|
@ -32,14 +31,14 @@ ASYNC22x.py:32:5: ASYNC221 Async functions should not run processes with blockin
31 | subprocess.Popen() # ASYNC220
32 | os.system() # ASYNC221
| ^^^^^^^^^ ASYNC221
33 |
33 |
34 | system()
|
ASYNC22x.py:38:5: ASYNC221 Async functions should not run processes with blocking methods
|
36 | os.anything()
37 |
37 |
38 | subprocess.run() # ASYNC221
| ^^^^^^^^^^^^^^ ASYNC221
39 | subprocess.call() # ASYNC221
@ -90,7 +89,7 @@ ASYNC22x.py:43:5: ASYNC221 Async functions should not run processes with blockin
42 | subprocess.getoutput() # ASYNC221
43 | subprocess.getstatusoutput() # ASYNC221
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ASYNC221
44 |
44 |
45 | await async_fun(
|
@ -105,7 +104,7 @@ ASYNC22x.py:46:9: ASYNC221 Async functions should not run processes with blockin
ASYNC22x.py:54:5: ASYNC221 Async functions should not run processes with blocking methods
|
52 | subprocess()
53 |
53 |
54 | os.posix_spawn() # ASYNC221
| ^^^^^^^^^^^^^^ ASYNC221
55 | os.posix_spawnp() # ASYNC221
@ -116,14 +115,14 @@ ASYNC22x.py:55:5: ASYNC221 Async functions should not run processes with blockin
54 | os.posix_spawn() # ASYNC221
55 | os.posix_spawnp() # ASYNC221
| ^^^^^^^^^^^^^^^ ASYNC221
56 |
56 |
57 | os.spawn()
|
ASYNC22x.py:61:5: ASYNC221 Async functions should not run processes with blocking methods
|
59 | os.spawnllll()
60 |
60 |
61 | os.spawnl() # ASYNC221
| ^^^^^^^^^ ASYNC221
62 | os.spawnle() # ASYNC221
@ -194,7 +193,7 @@ ASYNC22x.py:68:5: ASYNC221 Async functions should not run processes with blockin
67 | os.spawnvp() # ASYNC221
68 | os.spawnvpe() # ASYNC221
| ^^^^^^^^^^^ ASYNC221
69 |
69 |
70 | P_NOWAIT = os.P_NOWAIT
|
@ -222,6 +221,6 @@ ASYNC22x.py:83:5: ASYNC221 Async functions should not run processes with blockin
82 | os.spawnl(mode=os.P_WAIT) # ASYNC221
83 | os.spawnl(mode=P_WAIT) # ASYNC221
| ^^^^^^^^^ ASYNC221
84 |
84 |
85 | # other weird cases: ASYNC220
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC22x.py:20:5: ASYNC222 Async functions should not wait on processes with blocking methods
|
@ -60,6 +59,6 @@ ASYNC22x.py:95:5: ASYNC222 Async functions should not wait on processes with blo
94 | os.waitid() # ASYNC222
95 | os.waitpid() # ASYNC222
| ^^^^^^^^^^ ASYNC222
96 |
96 |
97 | os.waitpi()
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
---
ASYNC230.py:6:5: ASYNC230 Async functions should not open files with blocking methods like `open`
|
@ -16,14 +15,14 @@ ASYNC230.py:7:5: ASYNC230 Async functions should not open files with blocking me
6 | open("") # ASYNC230
7 | io.open_code("") # ASYNC230
| ^^^^^^^^^^^^ ASYNC230
8 |
8 |
9 | with open(""): # ASYNC230
|
ASYNC230.py:9:10: ASYNC230 Async functions should not open files with blocking methods like `open`
|
7 | io.open_code("") # ASYNC230
8 |
8 |
9 | with open(""): # ASYNC230
| ^^^^ ASYNC230
10 | ...
@ -32,7 +31,7 @@ ASYNC230.py:9:10: ASYNC230 Async functions should not open files with blocking m
ASYNC230.py:12:10: ASYNC230 Async functions should not open files with blocking methods like `open`
|
10 | ...
11 |
11 |
12 | with open("") as f: # ASYNC230
| ^^^^ ASYNC230
13 | ...
@ -41,7 +40,7 @@ ASYNC230.py:12:10: ASYNC230 Async functions should not open files with blocking
ASYNC230.py:15:17: ASYNC230 Async functions should not open files with blocking methods like `open`
|
13 | ...
14 |
14 |
15 | with foo(), open(""): # ASYNC230
| ^^^^ ASYNC230
16 | ...
@ -50,7 +49,7 @@ ASYNC230.py:15:17: ASYNC230 Async functions should not open files with blocking
ASYNC230.py:18:16: ASYNC230 Async functions should not open files with blocking methods like `open`
|
16 | ...
17 |
17 |
18 | async with open(""): # ASYNC230
| ^^^^ ASYNC230
19 | ...
@ -96,7 +95,7 @@ ASYNC230.py:53:9: ASYNC230 Async functions should not open files with blocking m
ASYNC230.py:59:5: ASYNC230 Async functions should not open files with blocking methods like `open`
|
57 | (p1, p2) = (Path("foo"), Path("bar"))
58 |
58 |
59 | p1.open() # ASYNC230
| ^^^^^^^ ASYNC230
|

View file

@ -7,14 +7,14 @@ S102.py:3:5: S102 Use of `exec` detected
2 | # Error
3 | exec('x = 2')
| ^^^^ S102
4 |
4 |
5 | exec('y = 3')
|
S102.py:5:1: S102 Use of `exec` detected
|
3 | exec('x = 2')
4 |
4 |
5 | exec('y = 3')
| ^^^^ S102
|
@ -25,6 +25,6 @@ S102.py:11:5: S102 Use of `exec` detected
10 | from builtins import exec
11 | exec('') # Error
| ^^^^ S102
12 |
12 |
13 | def _():
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S103.py:6:25: S103 `os.chmod` setting a permissive mask `0o227` on file or directory
|
4 | keyfile = "foo"
5 |
5 |
6 | os.chmod("/etc/passwd", 0o227) # Error
| ^^^^^ S103
7 | os.chmod("/etc/passwd", 0o7) # Error

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S105.py:13:12: S105 Possible hardcoded password assigned to: "password"
|
@ -126,14 +125,14 @@ S105.py:25:19: S105 Possible hardcoded password assigned to: "password"
24 | password: str = "s3cr3t"
25 | password: Final = "s3cr3t"
| ^^^^^^^^ S105
26 |
26 |
27 | d["password"] = "s3cr3t"
|
S105.py:27:17: S105 Possible hardcoded password assigned to: "password"
|
25 | password: Final = "s3cr3t"
26 |
26 |
27 | d["password"] = "s3cr3t"
| ^^^^^^^^ S105
28 | d["pass"] = "s3cr3t"
@ -286,14 +285,14 @@ S105.py:49:19: S105 Possible hardcoded password assigned to: "secrete"
48 | MyClass.token = "s3cr3t"
49 | MyClass.secrete = "s3cr3t"
| ^^^^^^^^ S105
50 |
50 |
51 | password == "s3cr3t"
|
S105.py:51:13: S105 Possible hardcoded password assigned to: "password"
|
49 | MyClass.secrete = "s3cr3t"
50 |
50 |
51 | password == "s3cr3t"
| ^^^^^^^^ S105
52 | _pass == "s3cr3t"
@ -364,14 +363,14 @@ S105.py:58:21: S105 Possible hardcoded password assigned to: "password"
57 | secrete == "s3cr3t"
58 | password == safe == "s3cr3t"
| ^^^^^^^^ S105
59 |
59 |
60 | if token == "1\n2":
|
S105.py:60:13: S105 Possible hardcoded password assigned to: "token"
|
58 | password == safe == "s3cr3t"
59 |
59 |
60 | if token == "1\n2":
| ^^^^^^ S105
61 | pass
@ -380,7 +379,7 @@ S105.py:60:13: S105 Possible hardcoded password assigned to: "token"
S105.py:63:13: S105 Possible hardcoded password assigned to: "token"
|
61 | pass
62 |
62 |
63 | if token == "3\t4":
| ^^^^^^ S105
64 | pass
@ -389,7 +388,7 @@ S105.py:63:13: S105 Possible hardcoded password assigned to: "token"
S105.py:66:13: S105 Possible hardcoded password assigned to: "token"
|
64 | pass
65 |
65 |
66 | if token == "5\r6":
| ^^^^^^ S105
67 | pass

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
3 | f.write("def")
4 |
4 |
5 | with open("/tmp/abc", "w") as f:
| ^^^^^^^^^^ S108
6 | f.write("def")
@ -14,7 +13,7 @@ S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp
S108.py:8:13: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
6 | f.write("def")
7 |
7 |
8 | with open(f"/tmp/abc", "w") as f:
| ^^^^^^^^ S108
9 | f.write("def")
@ -23,7 +22,7 @@ S108.py:8:13: S108 Probable insecure usage of temporary file or directory: "/tmp
S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/var/tmp/123"
|
9 | f.write("def")
10 |
10 |
11 | with open("/var/tmp/123", "w") as f:
| ^^^^^^^^^^^^^^ S108
12 | f.write("def")
@ -32,7 +31,7 @@ S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/va
S108.py:14:11: S108 Probable insecure usage of temporary file or directory: "/dev/shm/unit/test"
|
12 | f.write("def")
13 |
13 |
14 | with open("/dev/shm/unit/test", "w") as f:
| ^^^^^^^^^^^^^^^^^^^^ S108
15 | f.write("def")
@ -49,7 +48,7 @@ S108.py:22:11: S108 Probable insecure usage of temporary file or directory: "/tm
S108.py:25:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
23 | f.write("def")
24 |
24 |
25 | with open("/tmp/abc" f"/tmp/abc", "w") as f:
| ^^^^^^^^^^ S108
26 | f.write("def")
@ -58,7 +57,7 @@ S108.py:25:11: S108 Probable insecure usage of temporary file or directory: "/tm
S108.py:25:24: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
23 | f.write("def")
24 |
24 |
25 | with open("/tmp/abc" f"/tmp/abc", "w") as f:
| ^^^^^^^^ S108
26 | f.write("def")

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
3 | f.write("def")
4 |
4 |
5 | with open("/tmp/abc", "w") as f:
| ^^^^^^^^^^ S108
6 | f.write("def")
@ -14,7 +13,7 @@ S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp
S108.py:8:13: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
6 | f.write("def")
7 |
7 |
8 | with open(f"/tmp/abc", "w") as f:
| ^^^^^^^^ S108
9 | f.write("def")
@ -23,7 +22,7 @@ S108.py:8:13: S108 Probable insecure usage of temporary file or directory: "/tmp
S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/var/tmp/123"
|
9 | f.write("def")
10 |
10 |
11 | with open("/var/tmp/123", "w") as f:
| ^^^^^^^^^^^^^^ S108
12 | f.write("def")
@ -32,7 +31,7 @@ S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/va
S108.py:14:11: S108 Probable insecure usage of temporary file or directory: "/dev/shm/unit/test"
|
12 | f.write("def")
13 |
13 |
14 | with open("/dev/shm/unit/test", "w") as f:
| ^^^^^^^^^^^^^^^^^^^^ S108
15 | f.write("def")
@ -57,7 +56,7 @@ S108.py:22:11: S108 Probable insecure usage of temporary file or directory: "/tm
S108.py:25:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
23 | f.write("def")
24 |
24 |
25 | with open("/tmp/abc" f"/tmp/abc", "w") as f:
| ^^^^^^^^^^ S108
26 | f.write("def")
@ -66,7 +65,7 @@ S108.py:25:11: S108 Probable insecure usage of temporary file or directory: "/tm
S108.py:25:24: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
|
23 | f.write("def")
24 |
24 |
25 | with open("/tmp/abc" f"/tmp/abc", "w") as f:
| ^^^^^^^^ S108
26 | f.write("def")

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
|
@ -9,7 +8,7 @@ S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
3 | / except Exception:
4 | | pass
| |________^ S110
5 |
5 |
6 | try:
|
@ -20,6 +19,6 @@ S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception
8 | / except:
9 | | pass
| |________^ S110
10 |
10 |
11 | try:
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
|
@ -9,7 +8,7 @@ S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
3 | / except Exception:
4 | | pass
| |________^ S110
5 |
5 |
6 | try:
|
@ -20,7 +19,7 @@ S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception
8 | / except:
9 | | pass
| |________^ S110
10 |
10 |
11 | try:
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S112.py:3:1: S112 `try`-`except`-`continue` detected, consider logging the exception
|
@ -9,7 +8,7 @@ S112.py:3:1: S112 `try`-`except`-`continue` detected, consider logging the excep
3 | / except Exception:
4 | | continue
| |____________^ S112
5 |
5 |
6 | try:
|
@ -20,7 +19,7 @@ S112.py:8:1: S112 `try`-`except`-`continue` detected, consider logging the excep
8 | / except:
9 | | continue
| |____________^ S112
10 |
10 |
11 | try:
|
@ -31,7 +30,7 @@ S112.py:13:1: S112 `try`-`except`-`continue` detected, consider logging the exce
13 | / except (Exception,):
14 | | continue
| |____________^ S112
15 |
15 |
16 | try:
|
@ -42,6 +41,6 @@ S112.py:18:1: S112 `try`-`except`-`continue` detected, consider logging the exce
18 | / except (Exception, ValueError):
19 | | continue
| |____________^ S112
20 |
20 |
21 | try:
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S113.py:46:1: S113 Probable use of `requests` call without timeout
|
@ -136,14 +135,14 @@ S113.py:59:36: S113 Probable use of `requests` call with timeout set to `None`
58 | requests.head('https://gmail.com')
59 | requests.head('https://gmail.com', timeout=None)
| ^^^^^^^^^^^^ S113
60 |
60 |
61 | httpx.get('https://gmail.com', timeout=None)
|
S113.py:61:32: S113 Probable use of `httpx` call with timeout set to `None`
|
59 | requests.head('https://gmail.com', timeout=None)
60 |
60 |
61 | httpx.get('https://gmail.com', timeout=None)
| ^^^^^^^^^^^^ S113
62 | httpx.post('https://gmail.com', timeout=None)
@ -224,14 +223,14 @@ S113.py:69:19: S113 Probable use of `httpx` call with timeout set to `None`
68 | httpx.Client(timeout=None)
69 | httpx.AsyncClient(timeout=None)
| ^^^^^^^^^^^^ S113
70 |
70 |
71 | with httpx.Client(timeout=None) as client:
|
S113.py:71:19: S113 Probable use of `httpx` call with timeout set to `None`
|
69 | httpx.AsyncClient(timeout=None)
70 |
70 |
71 | with httpx.Client(timeout=None) as client:
| ^^^^^^^^^^^^ S113
72 | client.get('https://gmail.com')

View file

@ -1,12 +1,11 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S201.py:10:9: S201 Use of `debug=True` in Flask app detected
|
9 | # OK
10 | app.run(debug=True)
| ^^^^^^^^^^ S201
11 |
11 |
12 | # Errors
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S301.py:3:1: S301 `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
|
1 | import pickle
2 |
2 |
3 | pickle.loads()
| ^^^^^^^^^^^^^^ S301
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S307.py:3:7: S307 Use of possibly insecure function; consider using `ast.literal_eval`
|
1 | import os
2 |
2 |
3 | print(eval("1+1")) # S307
| ^^^^^^^^^^^ S307
4 | print(eval("os.getcwd()")) # S307

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S310.py:6:1: S310 Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
|
@ -37,7 +36,7 @@ S310.py:11:1: S310 Audit URL open for permitted schemes. Allowing use of `file:`
10 | urllib.request.urlopen('file:///foo/bar/baz')
11 | urllib.request.urlopen(url)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ S310
12 |
12 |
13 | urllib.request.Request(url='http://www.google.com')
|
@ -76,14 +75,14 @@ S310.py:21:1: S310 Audit URL open for permitted schemes. Allowing use of `file:`
20 | urllib.request.Request('file:///foo/bar/baz')
21 | urllib.request.Request(url)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ S310
22 |
22 |
23 | urllib.request.URLopener().open(fullurl='http://www.google.com')
|
S310.py:23:1: S310 Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
|
21 | urllib.request.Request(url)
22 |
22 |
23 | urllib.request.URLopener().open(fullurl='http://www.google.com')
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ S310
24 | urllib.request.URLopener().open(fullurl=f'http://www.google.com')
@ -174,7 +173,7 @@ S310.py:32:1: S310 Audit URL open for permitted schemes. Allowing use of `file:`
31 | urllib.request.URLopener().open('file:///foo/bar/baz')
32 | urllib.request.URLopener().open(url)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ S310
33 |
33 |
34 | urllib.request.urlopen(url=urllib.request.Request('http://www.google.com'))
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S311.py:10:1: S311 Standard pseudo-random generators are not suitable for cryptographic purposes
|
@ -86,6 +85,6 @@ S311.py:18:1: S311 Standard pseudo-random generators are not suitable for crypto
17 | random.triangular()
18 | random.randbytes()
| ^^^^^^^^^^^^^^^^^^ S311
19 |
19 |
20 | # Unrelated
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S312.py:3:1: S312 Telnet-related functions are being called. Telnet is considered insecure. Use SSH or some other encrypted protocol.
|
1 | from telnetlib import Telnet
2 |
2 |
3 | Telnet("localhost", 23)
| ^^^^^^^^^^^^^^^^^^^^^^^ S312
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S324.py:7:13: S324 Probable use of insecure hash functions in `hashlib`: `md5`
|
@ -127,14 +126,14 @@ S324.py:20:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1`
19 | # usedforsecurity arg only available in Python 3.9+
20 | hashlib.new('sha1', usedforsecurity=True)
| ^^^^^^ S324
21 |
21 |
22 | crypt.crypt("test", salt=crypt.METHOD_CRYPT)
|
S324.py:22:26: S324 Probable use of insecure hash functions in `crypt`: `crypt.METHOD_CRYPT`
|
20 | hashlib.new('sha1', usedforsecurity=True)
21 |
21 |
22 | crypt.crypt("test", salt=crypt.METHOD_CRYPT)
| ^^^^^^^^^^^^^^^^^^ S324
23 | crypt.crypt("test", salt=crypt.METHOD_MD5)
@ -165,14 +164,14 @@ S324.py:25:21: S324 Probable use of insecure hash functions in `crypt`: `crypt.M
24 | crypt.crypt("test", salt=crypt.METHOD_BLOWFISH)
25 | crypt.crypt("test", crypt.METHOD_BLOWFISH)
| ^^^^^^^^^^^^^^^^^^^^^ S324
26 |
26 |
27 | crypt.mksalt(crypt.METHOD_CRYPT)
|
S324.py:27:14: S324 Probable use of insecure hash functions in `crypt`: `crypt.METHOD_CRYPT`
|
25 | crypt.crypt("test", crypt.METHOD_BLOWFISH)
26 |
26 |
27 | crypt.mksalt(crypt.METHOD_CRYPT)
| ^^^^^^^^^^^^^^^^^^ S324
28 | crypt.mksalt(crypt.METHOD_MD5)
@ -193,6 +192,6 @@ S324.py:29:14: S324 Probable use of insecure hash functions in `crypt`: `crypt.M
28 | crypt.mksalt(crypt.METHOD_MD5)
29 | crypt.mksalt(crypt.METHOD_BLOWFISH)
| ^^^^^^^^^^^^^^^^^^^^^ S324
30 |
30 |
31 | # OK
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S501.py:5:47: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks
|
@ -67,7 +66,7 @@ S501.py:17:48: S501 Probable use of `requests` call with `verify=False` disablin
16 | requests.head('https://gmail.com', timeout=30, verify=True)
17 | requests.head('https://gmail.com', timeout=30, verify=False)
| ^^^^^^^^^^^^ S501
18 |
18 |
19 | httpx.request('GET', 'https://gmail.com', verify=True)
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S502.py:6:13: S502 Call made with insecure SSL protocol: `PROTOCOL_SSLv3`
|
4 | from OpenSSL.SSL import Context
5 |
5 |
6 | wrap_socket(ssl_version=ssl.PROTOCOL_SSLv3) # S502
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ S502
7 | ssl.wrap_socket(ssl_version=ssl.PROTOCOL_TLSv1) # S502
@ -66,6 +65,6 @@ S502.py:12:9: S502 Call made with insecure SSL protocol: `TLSv1_METHOD`
11 | Context(method=SSL.SSLv3_METHOD) # S502
12 | Context(method=SSL.TLSv1_METHOD) # S502
| ^^^^^^^^^^^^^^^^^^^^^^^ S502
13 |
13 |
14 | wrap_socket(ssl_version=ssl.PROTOCOL_TLS_CLIENT) # OK
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S504.py:4:1: S504 `ssl.wrap_socket` called without an `ssl_version``
|
2 | from ssl import wrap_socket
3 |
3 |
4 | ssl.wrap_socket() # S504
| ^^^^^^^^^^^^^^^^^ S504
5 | wrap_socket() # S504

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S505.py:29:35: S505 DSA key sizes below 2048 bits are considered breakable
|
@ -136,6 +135,6 @@ S505.py:44:28: S505 DSA key sizes below 2048 bits are considered breakable
43 | pycryptodomex_dsa.generate(2047)
44 | pycryptodomex_rsa.generate(2047)
| ^^^^ S505
45 |
45 |
46 | # Don't crash when the size is variable.
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S506.py:10:9: S506 Probable use of unsafe `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`.
|
@ -16,6 +15,6 @@ S506.py:24:24: S506 Probable use of unsafe loader `Loader` with `yaml.load`. All
|
24 | yaml.load("{}", Loader=yaml.Loader)
| ^^^^^^^^^^^ S506
25 |
25 |
26 | # no issue should be found
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S507.py:15:40: S507 Paramiko call with policy set to automatically trust the unknown host key
|
@ -76,6 +75,6 @@ S507.py:22:54: S507 Paramiko call with policy set to automatically trust the unk
21 | ssh_client.set_missing_host_key_policy(policy=WarningPolicy)
22 | ssh_client_from_paramiko.set_missing_host_key_policy(paramiko.AutoAddPolicy)
| ^^^^^^^^^^^^^^^^^^^^^^ S507
23 |
23 |
24 | # Unrelated
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S508.py:3:25: S508 The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able.
|
1 | from pysnmp.hlapi import CommunityData
2 |
2 |
3 | CommunityData("public", mpModel=0) # S508
| ^^^^^^^^^ S508
4 | CommunityData("public", mpModel=1) # S508
@ -16,6 +15,6 @@ S508.py:4:25: S508 The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able.
3 | CommunityData("public", mpModel=0) # S508
4 | CommunityData("public", mpModel=1) # S508
| ^^^^^^^^^ S508
5 |
5 |
6 | CommunityData("public", mpModel=2) # OK
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S509.py:4:12: S509 You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure.
|
@ -14,6 +13,6 @@ S509.py:5:16: S509 You should not use SNMPv3 without encryption. `noAuthNoPriv`
4 | insecure = UsmUserData("securityName") # S509
5 | auth_no_priv = UsmUserData("securityName", "authName") # S509
| ^^^^^^^^^^^ S509
6 |
6 |
7 | less_insecure = UsmUserData("securityName", "authName", "privName") # OK
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S601.py:3:1: S601 Possible shell injection via Paramiko call; check inputs are properly sanitized
|
1 | import paramiko
2 |
2 |
3 | paramiko.exec_command('something; really; unsafe')
| ^^^^^^^^^^^^^^^^^^^^^ S601
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S602.py:4:1: S602 `subprocess` call with `shell=True` seems safe, but may be changed in the future; consider rewriting without `shell`
|
@ -46,7 +45,7 @@ S602.py:8:1: S602 `subprocess` call with `shell=True` seems safe, but may be cha
7 | check_output("true", shell=True)
8 | run("true", shell=True)
| ^^^ S602
9 |
9 |
10 | # Check values that truthy values are treated as true.
|
@ -84,7 +83,7 @@ S602.py:14:1: S602 `subprocess` call with truthy `shell` seems safe, but may be
13 | Popen("true", shell={1: 1})
14 | Popen("true", shell=(1,))
| ^^^^^ S602
15 |
15 |
16 | # Check command argument looks unsafe.
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S603.py:4:1: S603 `subprocess` call: check for execution of untrusted input
|
@ -46,7 +45,7 @@ S603.py:8:1: S603 `subprocess` call: check for execution of untrusted input
7 | check_output("true", shell=False)
8 | run("true", shell=False)
| ^^^ S603
9 |
9 |
10 | # Values that falsey values are treated as false.
|
@ -84,7 +83,7 @@ S603.py:14:1: S603 `subprocess` call: check for execution of untrusted input
13 | Popen("true", shell={})
14 | Popen("true", shell=None)
| ^^^^^ S603
15 |
15 |
16 | # Unknown values are treated as falsey.
|
@ -93,7 +92,7 @@ S603.py:17:1: S603 `subprocess` call: check for execution of untrusted input
16 | # Unknown values are treated as falsey.
17 | Popen("true", shell=True if True else False)
| ^^^^^ S603
18 |
18 |
19 | # No value is also caught.
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S607.py:9:11: S607 Starting a process with a partial executable path
|
@ -217,6 +216,6 @@ S607.py:37:14: S607 Starting a process with a partial executable path
36 | os.spawnvpe("true")
37 | os.startfile("true")
| ^^^^^^ S607
38 |
38 |
39 | # Check it does not fail for full paths.
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S609.py:4:10: S609 Possible wildcard injection in call due to `*` usage
|
2 | import subprocess
3 |
3 |
4 | os.popen("chmod +w foo*")
| ^^^^^^^^^^^^^^^ S609
5 | subprocess.Popen("/bin/chown root: *", shell=True)

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S610.py:4:44: S610 Use of Django `extra` can lead to SQL injection vulnerabilities
|
@ -56,7 +55,7 @@ S610.py:9:44: S610 Use of Django `extra` can lead to SQL injection vulnerabiliti
8 | User.objects.filter(username='admin').extra(where=['%secure' % 'nos'])
9 | User.objects.filter(username='admin').extra(where=['{}secure'.format('no')])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ S610
10 |
10 |
11 | query = '"username") AS "username", * FROM "auth_user" WHERE 1=1 OR "username"=? --'
|
@ -65,7 +64,7 @@ S610.py:12:44: S610 Use of Django `extra` can lead to SQL injection vulnerabilit
11 | query = '"username") AS "username", * FROM "auth_user" WHERE 1=1 OR "username"=? --'
12 | User.objects.filter(username='admin').extra(select={'test': query})
| ^^^^^^^^^^^^^^^^^^^^^^^^ S610
13 |
13 |
14 | where_var = ['1=1) OR 1=1 AND (1=1']
|
@ -74,7 +73,7 @@ S610.py:15:44: S610 Use of Django `extra` can lead to SQL injection vulnerabilit
14 | where_var = ['1=1) OR 1=1 AND (1=1']
15 | User.objects.filter(username='admin').extra(where=where_var)
| ^^^^^^^^^^^^^^^^^ S610
16 |
16 |
17 | where_str = '1=1) OR 1=1 AND (1=1'
|
@ -83,7 +82,7 @@ S610.py:18:44: S610 Use of Django `extra` can lead to SQL injection vulnerabilit
17 | where_str = '1=1) OR 1=1 AND (1=1'
18 | User.objects.filter(username='admin').extra(where=[where_str])
| ^^^^^^^^^^^^^^^^^^^ S610
19 |
19 |
20 | tables_var = ['django_content_type" WHERE "auth_user"."username"="admin']
|
@ -92,7 +91,7 @@ S610.py:21:25: S610 Use of Django `extra` can lead to SQL injection vulnerabilit
20 | tables_var = ['django_content_type" WHERE "auth_user"."username"="admin']
21 | User.objects.all().extra(tables=tables_var).distinct()
| ^^^^^^^^^^^^^^^^^^^ S610
22 |
22 |
23 | tables_str = 'django_content_type" WHERE "auth_user"."username"="admin'
|
@ -101,6 +100,6 @@ S610.py:24:25: S610 Use of Django `extra` can lead to SQL injection vulnerabilit
23 | tables_str = 'django_content_type" WHERE "auth_user"."username"="admin'
24 | User.objects.all().extra(tables=[tables_str]).distinct()
| ^^^^^^^^^^^^^^^^^^^^^ S610
25 |
25 |
26 | # OK
|

View file

@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S612.py:3:5: S612 Use of insecure `logging.config.listen` detected
|
1 | import logging.config
2 |
2 |
3 | t = logging.config.listen(9999)
| ^^^^^^^^^^^^^^^^^^^^^ S612
4 |
4 |
5 | def verify_func():
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S701.py:9:57: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function.
|
@ -28,14 +27,14 @@ S701.py:13:13: S701 Using jinja2 templates with `autoescape=False` is dangerous
12 | load=templateLoader,
13 | autoescape=False) # S701
| ^^^^^^^^^^^^^^^^ S701
14 |
14 |
15 | Environment(loader=templateLoader, # S701
|
S701.py:15:1: S701 By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True` or the `select_autoescape` function to mitigate XSS vulnerabilities.
|
13 | autoescape=False) # S701
14 |
14 |
15 | Environment(loader=templateLoader, # S701
| ^^^^^^^^^^^ S701
16 | load=templateLoader)

View file

@ -1,19 +1,18 @@
---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
---
S702.py:6:1: S702 Mako templates allow HTML and JavaScript rendering by default and are inherently open to XSS attacks
|
6 | Template("hello")
| ^^^^^^^^ S702
7 |
7 |
8 | mako.template.Template("hern")
|
S702.py:8:1: S702 Mako templates allow HTML and JavaScript rendering by default and are inherently open to XSS attacks
|
6 | Template("hello")
7 |
7 |
8 | mako.template.Template("hern")
| ^^^^^^^^^^^^^^^^^^^^^^ S702
9 | template.Template("hern")

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B003.py:9:1: B003 Assigning to `os.environ` doesn't clear the environment
|
7 | from os import environ
8 |
8 |
9 | os.environ = {}
| ^^^^^^^^^^ B003
10 | environ = {} # that's fine, assigning a new meaning to the module-level name

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B004.py:3:8: B004 [*] Using `hasattr(x, "__call__")` to test if x is callable is unreliable. Use `callable(x)` for consistent results.
|
@ -66,7 +65,7 @@ B004.py:14:8: B004 Using `hasattr(x, "__call__")` to test if x is callable is un
B004.py:24:8: B004 [*] Using `hasattr(x, "__call__")` to test if x is callable is unreliable. Use `callable(x)` for consistent results.
|
22 | return True
23 |
23 |
24 | if hasattr(o, "__call__"):
| ^^^^^^^^^^^^^^^^^^^^^^ B004
25 | print("STILL a bug!")

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B005.py:4:1: B005 Using `.strip()` with multi-character strings is misleading
|
@ -78,6 +77,6 @@ B005.py:24:1: B005 Using `.strip()` with multi-character strings is misleading
23 | s.strip("\ufeff") # no warning
24 | s.strip("\u0074\u0065\u0073\u0074") # warning
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B005
25 |
25 |
26 | from somewhere import other_type, strip
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B006_1.py:3:22: B006 [*] Do not use mutable data structures for argument defaults
|
1 | # Docstring followed by a newline
2 |
2 |
3 | def foobar(foor, bar={}):
| ^^ B006
4 | """

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B006_2.py:4:22: B006 [*] Do not use mutable data structures for argument defaults
|
2 | # Regression test for https://github.com/astral-sh/ruff/issues/7155
3 |
3 |
4 | def foobar(foor, bar={}):
| ^^ B006
5 | """

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B006_6.py:4:22: B006 [*] Do not use mutable data structures for argument defaults
|
2 | # Same as B006_2.py, but import instead of docstring
3 |
3 |
4 | def foobar(foor, bar={}):
| ^^ B006
5 | import os

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B006_7.py:4:22: B006 [*] Do not use mutable data structures for argument defaults
|
2 | # Same as B006_3.py, but import instead of docstring
3 |
3 |
4 | def foobar(foor, bar={}):
| ^^ B006
5 | import os

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B006_B008.py:63:25: B006 [*] Do not use mutable data structures for argument defaults
|
@ -62,7 +61,7 @@ B006_B008.py:77:31: B006 [*] Do not use mutable data structures for argument def
|
77 | def multiline_arg_wrong(value={
| _______________________________^
78 | |
78 | |
79 | | }):
| |_^ B006
80 | ...
@ -84,7 +83,7 @@ B006_B008.py:77:31: B006 [*] Do not use mutable data structures for argument def
B006_B008.py:82:36: B006 Do not use mutable data structures for argument defaults
|
80 | ...
81 |
81 |
82 | def single_line_func_wrong(value = {}): ...
| ^^ B006
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B007.py:6:5: B007 Loop control variable `i` not used within loop body
|
4 | print(i) # name no longer defined on Python 3; no warning yet
5 |
5 |
6 | for i in range(10): # name not used within the loop; B007
| ^ B007
7 | print(10)
@ -71,7 +70,7 @@ B007.py:34:10: B007 Loop control variable `bar` may not be used within loop body
B007.py:38:10: B007 Loop control variable `bar` may not be used within loop body
|
36 | print(FMT.format(**locals()))
37 |
37 |
38 | for foo, bar in [(1, 2)]:
| ^^^ B007
39 | if foo:
@ -82,7 +81,7 @@ B007.py:38:10: B007 Loop control variable `bar` may not be used within loop body
B007.py:42:10: B007 Loop control variable `bar` may not be used within loop body
|
40 | print(FMT.format(**globals()))
41 |
41 |
42 | for foo, bar in [(1, 2)]:
| ^^^ B007
43 | if foo:
@ -93,7 +92,7 @@ B007.py:42:10: B007 Loop control variable `bar` may not be used within loop body
B007.py:46:10: B007 Loop control variable `bar` may not be used within loop body
|
44 | print(FMT.format(**vars()))
45 |
45 |
46 | for foo, bar in [(1, 2)]:
| ^^^ B007
47 | print(FMT.format(foo=foo, bar=eval("bar")))

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B009_B010.py:19:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access.
|
@ -322,7 +321,7 @@ B009_B010.py:58:8: B009 [*] Do not call `getattr` with a constant attribute valu
57 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722458885
58 | assert getattr(func, '_rpc')is True
| ^^^^^^^^^^^^^^^^^^^^^ B009
59 |
59 |
60 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1732387247
|
= help: Replace `getattr` with attribute access
@ -343,7 +342,7 @@ B009_B010.py:65:1: B009 [*] Do not call `getattr` with a constant attribute valu
65 | / getattr(self.
66 | | registration.registry, '__name__')
| |_____________________________________^ B009
67 |
67 |
68 | import builtins
|
= help: Replace `getattr` with attribute access

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B009_B010.py:50:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access.
|
@ -111,7 +110,7 @@ B009_B010.py:55:1: B010 [*] Do not call `setattr` with a constant attribute valu
54 | setattr(foo, r"abc123", None)
55 | setattr(foo.bar, r"baz", None)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B010
56 |
56 |
57 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722458885
|
= help: Replace `setattr` with assignment

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B012.py:5:9: B012 `return` inside `finally` blocks cause exceptions to be silenced
|
@ -44,7 +43,7 @@ B012.py:44:21: B012 `return` inside `finally` blocks cause exceptions to be sile
43 | finally:
44 | return # warning
| ^^^^^^ B012
45 |
45 |
46 | finally:
|
@ -54,7 +53,7 @@ B012.py:66:13: B012 `break` inside `finally` blocks cause exceptions to be silen
65 | finally:
66 | break # warning
| ^^^^^ B012
67 |
67 |
68 | def j():
|
@ -64,7 +63,7 @@ B012.py:78:13: B012 `continue` inside `finally` blocks cause exceptions to be si
77 | finally:
78 | continue # warning
| ^^^^^^^^ B012
79 |
79 |
80 | def j():
|
@ -82,7 +81,7 @@ B012.py:101:9: B012 `continue` inside `finally` blocks cause exceptions to be si
100 | finally:
101 | continue # warning
| ^^^^^^^^ B012
102 |
102 |
103 | while True:
|

View file

@ -1,21 +1,20 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B015.py:3:1: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it.
|
1 | assert 1 == 1
2 |
2 |
3 | 1 == 1
| ^^^^^^ B015
4 |
4 |
5 | assert 1 in (1, 2)
|
B015.py:7:1: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it.
|
5 | assert 1 in (1, 2)
6 |
6 |
7 | 1 in (1, 2)
| ^^^^^^^^^^^ B015
|
@ -23,7 +22,7 @@ B015.py:7:1: B015 Pointless comparison. Did you mean to assign a value? Otherwis
B015.py:17:5: B015 Pointless comparison at end of function scope. Did you mean to return the expression result?
|
15 | assert 1 in (1, 2)
16 |
16 |
17 | 1 in (1, 2)
| ^^^^^^^^^^^ B015
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B016.py:6:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception?
|
4 | """
5 |
5 |
6 | raise False
| ^^^^^ B016
7 | raise 1

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B017.py:23:14: B017 Do not assert blind exception: `Exception`
|
@ -30,7 +29,7 @@ B017.py:45:10: B017 Do not assert blind exception: `Exception`
B017.py:48:10: B017 Do not assert blind exception: `Exception`
|
46 | raise ValueError("Hello")
47 |
47 |
48 | with pytest.raises(Exception), pytest.raises(ValueError):
| ^^^^^^^^^^^^^^^^^^^^^^^^ B017
49 | raise ValueError("Hello")
@ -39,7 +38,7 @@ B017.py:48:10: B017 Do not assert blind exception: `Exception`
B017.py:57:36: B017 Do not assert blind exception: `Exception`
|
55 | raise ValueError("This is also fine")
56 |
56 |
57 | with contextlib.nullcontext(), pytest.raises(Exception):
| ^^^^^^^^^^^^^^^^^^^^^^^^ B017
58 | raise ValueError("Multiple context managers")

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B019.py:78:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
@ -14,7 +13,7 @@ B019.py:78:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:82:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
80 | ...
81 |
81 |
82 | @cache
| ^^^^^^ B019
83 | def another_cached_instance_method(self, y):
@ -24,7 +23,7 @@ B019.py:82:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:86:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
84 | ...
85 |
85 |
86 | @functools.cache()
| ^^^^^^^^^^^^^^^^^^ B019
87 | def called_cached_instance_method(self, y):
@ -34,7 +33,7 @@ B019.py:86:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:90:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
88 | ...
89 |
89 |
90 | @cache()
| ^^^^^^^^ B019
91 | def another_called_cached_instance_method(self, y):
@ -44,7 +43,7 @@ B019.py:90:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:94:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
92 | ...
93 |
93 |
94 | @functools.lru_cache
| ^^^^^^^^^^^^^^^^^^^^ B019
95 | def lru_cached_instance_method(self, y):
@ -54,7 +53,7 @@ B019.py:94:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:98:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
96 | ...
97 |
97 |
98 | @lru_cache
| ^^^^^^^^^^ B019
99 | def another_lru_cached_instance_method(self, y):
@ -64,7 +63,7 @@ B019.py:98:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:102:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
100 | ...
101 |
101 |
102 | @functools.lru_cache()
| ^^^^^^^^^^^^^^^^^^^^^^ B019
103 | def called_lru_cached_instance_method(self, y):
@ -74,7 +73,7 @@ B019.py:102:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods
B019.py:106:5: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
104 | ...
105 |
105 |
106 | @lru_cache()
| ^^^^^^^^^^^^ B019
107 | def another_called_lru_cached_instance_method(self, y):

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B020.py:8:5: B020 Loop control variable `items` overrides iterable it iterates
|
6 | items = [1, 2, 3]
7 |
7 |
8 | for items in items:
| ^^^^^ B020
9 | print(items)
@ -14,7 +13,7 @@ B020.py:8:5: B020 Loop control variable `items` overrides iterable it iterates
B020.py:21:10: B020 Loop control variable `values` overrides iterable it iterates
|
19 | print(f"{key}, {value}")
20 |
20 |
21 | for key, values in values.items():
| ^^^^^^ B020
22 | print(f"{key}, {values}")

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B021.py:1:1: B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
|
@ -9,7 +8,7 @@ B021.py:1:1: B021 f-string used as docstring. Python will interpret this as a jo
3 | | B021 - on lines 14, 22, 30, 38, 46, 54, 62, 70, 73
4 | | """
| |___^ B021
5 |
5 |
6 | VARIABLE = "world"
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B022.py:9:6: B022 No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant
|
7 | from contextlib import suppress
8 |
8 |
9 | with contextlib.suppress():
| ^^^^^^^^^^^^^^^^^^^^^ B022
10 | raise ValueError
@ -14,7 +13,7 @@ B022.py:9:6: B022 No arguments passed to `contextlib.suppress`. No exceptions wi
B022.py:12:6: B022 No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant
|
10 | raise ValueError
11 |
11 |
12 | with suppress():
| ^^^^^^^^^^ B022
13 | raise ValueError

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B023.py:12:30: B023 Function definition does not bind loop variable `x`
|
@ -17,7 +16,7 @@ B023.py:13:30: B023 Function definition does not bind loop variable `y`
12 | functions.append(lambda: x)
13 | functions.append(lambda: y) # not just the loop var
| ^ B023
14 |
14 |
15 | def f_bad_1():
|
@ -26,7 +25,7 @@ B023.py:16:16: B023 Function definition does not bind loop variable `x`
15 | def f_bad_1():
16 | return x
| ^ B023
17 |
17 |
18 | # Actually OK
|
@ -72,14 +71,14 @@ B023.py:40:34: B023 Function definition does not bind loop variable `x`
39 | async for x in pointless_async_iterable():
40 | functions.append(lambda: x) # error
| ^ B023
41 |
41 |
42 | [lambda: x async for x in pointless_async_iterable()] # error
|
B023.py:42:14: B023 Function definition does not bind loop variable `x`
|
40 | functions.append(lambda: x) # error
41 |
41 |
42 | [lambda: x async for x in pointless_async_iterable()] # error
| ^ B023
|
@ -146,7 +145,7 @@ B023.py:68:10: B023 Function definition does not bind loop variable `l`
67 | j = None # OK because it's an assignment
68 | [l for k in range(2)] # error for l, not for k
| ^ B023
69 |
69 |
70 | assert a and functions
|
@ -202,7 +201,7 @@ B023.py:121:37: B023 Function definition does not bind loop variable `x`
120 | list(filter(bool, [None, lambda: x]))
121 | all(reduce(bool, [None, lambda: x]))
| ^ B023
122 |
122 |
123 | # But all these should be OK:
|
@ -211,7 +210,7 @@ B023.py:171:29: B023 Function definition does not bind loop variable `name`
170 | if foo(name):
171 | return [lambda: name] # known false alarm
| ^^^^ B023
172 |
172 |
173 | if False:
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B028.py:8:1: B028 [*] No explicit `stacklevel` keyword argument found
|
6 | """
7 |
7 |
8 | warnings.warn("test", DeprecationWarning)
| ^^^^^^^^^^^^^ B028
9 | warnings.warn("test", DeprecationWarning, source=None)
@ -47,7 +46,7 @@ B028.py:9:1: B028 [*] No explicit `stacklevel` keyword argument found
B028.py:22:1: B028 [*] No explicit `stacklevel` keyword argument found
|
20 | warnings.warn(*args, **kwargs)
21 |
21 |
22 | warnings.warn(
| ^^^^^^^^^^^^^ B028
23 | "test",

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B029.py:8:1: B029 Using `except ():` with an empty tuple does not catch anything; add exceptions to handle
|
@ -9,7 +8,7 @@ B029.py:8:1: B029 Using `except ():` with an empty tuple does not catch anything
8 | / except ():
9 | | pass
| |________^ B029
10 |
10 |
11 | try:
|
@ -20,7 +19,7 @@ B029.py:13:1: B029 Using `except ():` with an empty tuple does not catch anythin
13 | / except () as e:
14 | | pass
| |________^ B029
15 |
15 |
16 | try:
|
@ -31,7 +30,7 @@ B029.py:18:1: B029 Using `except* ():` with an empty tuple does not catch anythi
18 | / except* ():
19 | | pass
| |________^ B029
20 |
20 |
21 | try:
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B031.py:27:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage
|
@ -18,7 +17,7 @@ B031.py:29:33: B031 Using the generator returned from `itertools.groupby()` more
28 | # We're outside the nested loop and used the group again.
29 | collect_shop_items(shopper, section_items) # B031
| ^^^^^^^^^^^^^ B031
30 |
30 |
31 | for _section, section_items in groupby(items, key=lambda p: p[1]):
|
@ -45,7 +44,7 @@ B031.py:46:29: B031 Using the generator returned from `itertools.groupby()` more
45 | for _section, section_items in groupby(items, key=lambda p: p[1]):
46 | collection.append([list(section_items) for _ in range(3)]) # B031
| ^^^^^^^^^^^^^ B031
47 |
47 |
48 | unique_items = set()
|
@ -63,7 +62,7 @@ B031.py:79:37: B031 Using the generator returned from `itertools.groupby()` more
78 | for shopper in shoppers:
79 | collect_shop_items(shopper, section_items) # B031
| ^^^^^^^^^^^^^ B031
80 |
80 |
81 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]):
|
@ -72,7 +71,7 @@ B031.py:82:38: B031 Using the generator returned from `itertools.groupby()` more
81 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]):
82 | _ = [collect_shop_items(shopper, section_items) for shopper in shoppers] # B031
| ^^^^^^^^^^^^^ B031
83 |
83 |
84 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]):
|
@ -82,7 +81,7 @@ B031.py:94:65: B031 Using the generator returned from `itertools.groupby()` more
93 | # The iterator is being used for the second time.
94 | _ = [(item1, item2) for item1 in section_items for item2 in section_items] # B031
| ^^^^^^^^^^^^^ B031
95 |
95 |
96 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]):
|
@ -92,7 +91,7 @@ B031.py:101:37: B031 Using the generator returned from `itertools.groupby()` mor
100 | collect_shop_items(shopper, section_items)
101 | collect_shop_items(shopper, section_items) # B031
| ^^^^^^^^^^^^^ B031
102 |
102 |
103 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]):
|
@ -152,7 +151,7 @@ B031.py:126:33: B031 Using the generator returned from `itertools.groupby()` mor
125 | # Now, it should detect
126 | collect_shop_items(shopper, section_items) # B031
| ^^^^^^^^^^^^^ B031
127 |
127 |
128 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]):
|
@ -192,7 +191,7 @@ B031.py:144:33: B031 Using the generator returned from `itertools.groupby()` mor
143 | # Now, it should detect
144 | collect_shop_items(shopper, section_items) # B031
| ^^^^^^^^^^^^^ B031
145 |
145 |
146 | for group in groupby(items, key=lambda p: p[1]):
|
@ -211,7 +210,7 @@ B031.py:210:37: B031 Using the generator returned from `itertools.groupby()` mor
209 | collect_shop_items(shopper, section_items)
210 | collect_shop_items(shopper, section_items)
| ^^^^^^^^^^^^^ B031
211 |
211 |
212 | # Should trigger, since only one branch has a return statement.
|
@ -221,6 +220,6 @@ B031.py:219:33: B031 Using the generator returned from `itertools.groupby()` mor
218 | collect_shop_items(shopper, section_items)
219 | collect_shop_items(shopper, section_items) # B031
| ^^^^^^^^^^^^^ B031
220 |
220 |
221 | # Let's redefine the `groupby` function to make sure we pick up the correct one.
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B032.py:9:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?
|
7 | dct = {"a": 1}
8 |
8 |
9 | dct["b"]: 2
| ^^^^^^^^^^^ B032
10 | dct.b: 2
@ -16,14 +15,14 @@ B032.py:10:1: B032 Possible unintentional type annotation (using `:`). Did you m
9 | dct["b"]: 2
10 | dct.b: 2
| ^^^^^^^^ B032
11 |
11 |
12 | dct["b"]: "test"
|
B032.py:12:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?
|
10 | dct.b: 2
11 |
11 |
12 | dct["b"]: "test"
| ^^^^^^^^^^^^^^^^ B032
13 | dct.b: "test"
@ -34,7 +33,7 @@ B032.py:13:1: B032 Possible unintentional type annotation (using `:`). Did you m
12 | dct["b"]: "test"
13 | dct.b: "test"
| ^^^^^^^^^^^^^ B032
14 |
14 |
15 | test = "test"
|
@ -72,6 +71,6 @@ B032.py:19:1: B032 Possible unintentional type annotation (using `:`). Did you m
18 | dct.b: test
19 | dct.b: test.lower()
| ^^^^^^^^^^^^^^^^^^^ B032
20 |
20 |
21 | # Do not flag below
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B033.py:4:35: B033 [*] Sets should not contain duplicate item `"value1"`
|
@ -174,7 +173,7 @@ B033.py:22:28: B033 [*] Sets should not contain duplicate items, but `False` and
21 | }
22 | incorrect_set = {False, 1, 0}
| ^ B033
23 |
23 |
24 | ###
|
= help: Remove duplicate item

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B034.py:5:1: B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
|
@ -96,6 +95,6 @@ B034.py:14:1: B034 `re.sub` should pass `count` and `flags` as keyword arguments
13 | re.split(" ", "a a a a", 2, re.I)
14 | sub("a", "b", "aaa", re.IGNORECASE)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
15 |
15 |
16 | # OK
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B039.py:21:26: B039 Do not use mutable data structures for `ContextVar` defaults
|
@ -116,7 +115,7 @@ B039.py:31:36: B039 Do not use mutable data structures for `ContextVar` defaults
30 | ContextVar("cv", default=set[str]())
31 | ContextVar[set[str]]("cv", default=set[str]())
| ^^^^^^^^^^ B039
32 |
32 |
33 | def bar() -> list[int]:
|
= help: Replace with `None`; initialize with `.set()``
@ -124,7 +123,7 @@ B039.py:31:36: B039 Do not use mutable data structures for `ContextVar` defaults
B039.py:36:26: B039 Do not use mutable data structures for `ContextVar` defaults
|
34 | return [1, 2, 3]
35 |
35 |
36 | ContextVar("cv", default=bar())
| ^^^^^ B039
37 | ContextVar("cv", default=time.time())
@ -136,7 +135,7 @@ B039.py:37:26: B039 Do not use mutable data structures for `ContextVar` defaults
36 | ContextVar("cv", default=bar())
37 | ContextVar("cv", default=time.time())
| ^^^^^^^^^^^ B039
38 |
38 |
39 | def baz(): ...
|
= help: Replace with `None`; initialize with `.set()``

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B901.py:9:9: B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior
|
@ -8,7 +7,7 @@ B901.py:9:9: B901 Using `yield` and `return {value}` in a generator function can
8 | if True:
9 | return [1, 2, 3]
| ^^^^^^^^^^^^^^^^ B901
10 |
10 |
11 | yield 3
|
@ -17,6 +16,6 @@ B901.py:36:5: B901 Using `yield` and `return {value}` in a generator function ca
35 | def broken2():
36 | return [3, 2, 1]
| ^^^^^^^^^^^^^^^^ B901
37 |
37 |
38 | yield from not_broken()
|

View file

@ -13,27 +13,27 @@ class_as_data_structure.py:6:1: B903 Class could be dataclass or namedtuple
class_as_data_structure.py:40:1: B903 Class could be dataclass or namedtuple
|
38 | ...
39 |
39 |
40 | / class C: # B903
41 | | c: int
42 | | def __init__(self,d:list):
43 | | self.d = d
| |__________________^ B903
44 |
44 |
45 | class D: # B903
|
class_as_data_structure.py:45:1: B903 Class could be dataclass or namedtuple
|
43 | self.d = d
44 |
44 |
45 | / class D: # B903
46 | | """This class has a docstring."""
47 | | # this next method is an init
48 | | def __init__(self,e:dict):
49 | | self.e = e
| |__________________^ B903
50 |
50 |
51 | # <--- begin flake8-bugbear tests below
|
@ -41,7 +41,7 @@ class_as_data_structure.py:63:1: B903 Class could be dataclass or namedtuple
|
63 | / class NoWarningsClassAttributes:
64 | | spam = "ham"
65 | |
65 | |
66 | | def __init__(self, foo:int, bar:list):
67 | | self.foo = foo
68 | | self.bar = bar
@ -61,11 +61,11 @@ class_as_data_structure.py:91:1: B903 Class could be dataclass or namedtuple
|
91 | / class WarningsWithDocstring:
92 | | """A docstring should not be an impediment to a warning"""
93 | |
93 | |
94 | | def __init__(self, foo:int, bar:list):
95 | | self.foo = foo
96 | | self.bar = bar
| |______________________^ B903
97 |
97 |
98 | # <-- end flake8-bugbear tests
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B904.py:10:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
|
@ -66,7 +65,7 @@ B904.py:73:13: B904 Within an `except` clause, raise exceptions with `raise ...
72 | case 0:
73 | raise RuntimeError("boom!")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B904
74 |
74 |
75 | try:
|
@ -86,7 +85,7 @@ B904.py:81:9: B904 Within an `except*` clause, raise exceptions with `raise ...
80 | else:
81 | raise RuntimeError("bang!")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B904
82 |
82 |
83 | try:
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B905.py:4:1: B905 [*] `zip()` without an explicit `strict=` parameter
|
@ -132,7 +131,7 @@ B905.py:9:1: B905 [*] `zip()` without an explicit `strict=` parameter
8 | zip(zip("a"), strict=False)
9 | zip(zip("a", strict=True))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ B905
10 |
10 |
11 | # OK
|
= help: Add explicit value for parameter `strict=`
@ -172,7 +171,7 @@ B905.py:25:1: B905 [*] `zip()` without an explicit `strict=` parameter
24 | zip([1, 2, 3], repeat(1, 1))
25 | zip([1, 2, 3], repeat(1, times=4))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B905
26 |
26 |
27 | import builtins
|
= help: Add explicit value for parameter `strict=`

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B909.py:12:5: B909 Mutation to loop iterable `some_list` during iteration
|
@ -97,7 +96,7 @@ B909.py:21:5: B909 Mutation to loop iterable `some_list` during iteration
20 | some_list.pop(1)
21 | some_list.pop()
| ^^^^^^^^^^^^^ B909
22 |
22 |
23 | # conditional break should error
|
@ -136,7 +135,7 @@ B909.py:49:5: B909 Mutation to loop iterable `mydicts` during iteration
48 | mydicts.setdefault("foo", 1)
49 | mydicts.update({"foo": "bar"})
| ^^^^^^^^^^^^^^ B909
50 |
50 |
51 | # no errors
|
@ -195,7 +194,7 @@ B909.py:67:5: B909 Mutation to loop iterable `myset` during iteration
66 | myset.add(4)
67 | myset.discard(3)
| ^^^^^^^^^^^^^ B909
68 |
68 |
69 | # no errors
|
@ -261,7 +260,7 @@ B909.py:97:5: B909 Mutation to loop iterable `foo` during iteration
96 | foo[1:2] = bar
97 | foo[1:2:3] = bar
| ^^^^^^^^^^^^^^^^ B909
98 |
98 |
99 | foo = {1, 2, 3}
|
@ -318,7 +317,7 @@ B909.py:136:9: B909 Mutation to loop iterable `foo` during iteration
135 | else:
136 | foo.remove(1)
| ^^^^^^^^^^ B909
137 |
137 |
138 | # should error
|
@ -366,7 +365,7 @@ B909.py:159:5: B909 Mutation to loop iterable `some_list` during iteration
158 | some_list.remove(elem)
159 | some_list.discard(elem)
| ^^^^^^^^^^^^^^^^^ B909
160 |
160 |
161 | # should not error
|
@ -376,6 +375,6 @@ B909.py:167:5: B909 Mutation to loop iterable `some_list` during iteration
166 | for i, elem in enumerate(some_list):
167 | some_list.pop(0)
| ^^^^^^^^^^^^^ B909
168 |
168 |
169 | # should not error (list)
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
snapshot_kind: text
---
B911.py:5:1: B911 `itertools.batched()` without an explicit `strict` parameter
|
@ -50,7 +49,7 @@ B911.py:9:1: B911 `itertools.batched()` without an explicit `strict` parameter
8 | batched((foo for foo in cycle()))
9 | batched(itertools.batched([1, 2, 3], strict=True))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B911
10 |
10 |
11 | # Errors (limited iterators).
|
= help: Add an explicit `strict` parameter
@ -70,7 +69,7 @@ B911.py:13:1: B911 `itertools.batched()` without an explicit `strict` parameter
12 | batched(repeat(1, 1))
13 | batched(repeat(1, times=4))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B911
14 |
14 |
15 | # No fix
|
= help: Add an explicit `strict` parameter
@ -80,7 +79,7 @@ B911.py:16:1: B911 `itertools.batched()` without an explicit `strict` parameter
15 | # No fix
16 | batched([], **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^ B911
17 |
17 |
18 | # No errors
|
= help: Add an explicit `strict` parameter
@ -133,7 +132,7 @@ B911.py:39:1: B911 `itertools.batched()` without an explicit `strict` parameter
38 | itertools.batched((foo for foo in cycle()))
39 | itertools.batched(itertools.batched([1, 2, 3], strict=True))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B911
40 |
40 |
41 | # Errors (limited iterators).
|
= help: Add an explicit `strict` parameter
@ -153,7 +152,7 @@ B911.py:43:1: B911 `itertools.batched()` without an explicit `strict` parameter
42 | itertools.batched(repeat(1, 1))
43 | itertools.batched(repeat(1, times=4))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B911
44 |
44 |
45 | # No fix
|
= help: Add an explicit `strict` parameter
@ -163,7 +162,7 @@ B911.py:46:1: B911 `itertools.batched()` without an explicit `strict` parameter
45 | # No fix
46 | itertools.batched([], **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B911
47 |
47 |
48 | # No errors
|
= help: Add an explicit `strict` parameter

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_builtins/mod.rs
snapshot_kind: text
---
A001.py:5:1: A001 Variable `print` is shadowing a Python builtin
|
3 | from directory import new as dir
4 |
4 |
5 | print = 1
| ^^^^^ A001
6 | copyright: 'annotation' = 2
@ -55,7 +54,7 @@ A001.py:9:1: A001 Variable `min` is shadowing a Python builtin
8 | float = object = 4
9 | min, max = 5, 6
| ^^^ A001
10 |
10 |
11 | id = 4
|
@ -65,24 +64,24 @@ A001.py:9:6: A001 Variable `max` is shadowing a Python builtin
8 | float = object = 4
9 | min, max = 5, 6
| ^^^ A001
10 |
10 |
11 | id = 4
|
A001.py:11:1: A001 Variable `id` is shadowing a Python builtin
|
9 | min, max = 5, 6
10 |
10 |
11 | id = 4
| ^^ A001
12 |
12 |
13 | def bytes():
|
A001.py:13:5: A001 Variable `bytes` is shadowing a Python builtin
|
11 | id = 4
12 |
12 |
13 | def bytes():
| ^^^^^ A001
14 | pass
@ -91,7 +90,7 @@ A001.py:13:5: A001 Variable `bytes` is shadowing a Python builtin
A001.py:16:7: A001 Variable `slice` is shadowing a Python builtin
|
14 | pass
15 |
15 |
16 | class slice:
| ^^^^^ A001
17 | pass
@ -109,7 +108,7 @@ A001.py:21:23: A001 Variable `ValueError` is shadowing a Python builtin
A001.py:24:5: A001 Variable `memoryview` is shadowing a Python builtin
|
22 | ...
23 |
23 |
24 | for memoryview, *bytearray in []:
| ^^^^^^^^^^ A001
25 | pass
@ -118,7 +117,7 @@ A001.py:24:5: A001 Variable `memoryview` is shadowing a Python builtin
A001.py:24:18: A001 Variable `bytearray` is shadowing a Python builtin
|
22 | ...
23 |
23 |
24 | for memoryview, *bytearray in []:
| ^^^^^^^^^ A001
25 | pass
@ -127,7 +126,7 @@ A001.py:24:18: A001 Variable `bytearray` is shadowing a Python builtin
A001.py:27:22: A001 Variable `str` is shadowing a Python builtin
|
25 | pass
26 |
26 |
27 | with open('file') as str, open('file2') as (all, any):
| ^^^ A001
28 | pass
@ -136,7 +135,7 @@ A001.py:27:22: A001 Variable `str` is shadowing a Python builtin
A001.py:27:45: A001 Variable `all` is shadowing a Python builtin
|
25 | pass
26 |
26 |
27 | with open('file') as str, open('file2') as (all, any):
| ^^^ A001
28 | pass
@ -145,7 +144,7 @@ A001.py:27:45: A001 Variable `all` is shadowing a Python builtin
A001.py:27:50: A001 Variable `any` is shadowing a Python builtin
|
25 | pass
26 |
26 |
27 | with open('file') as str, open('file2') as (all, any):
| ^^^ A001
28 | pass
@ -154,7 +153,7 @@ A001.py:27:50: A001 Variable `any` is shadowing a Python builtin
A001.py:30:8: A001 Variable `sum` is shadowing a Python builtin
|
28 | pass
29 |
29 |
30 | [0 for sum in ()]
| ^^^ A001
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_builtins/mod.rs
snapshot_kind: text
---
A001.py:5:1: A001 Variable `print` is shadowing a Python builtin
|
3 | from directory import new as dir
4 |
4 |
5 | print = 1
| ^^^^^ A001
6 | copyright: 'annotation' = 2
@ -55,7 +54,7 @@ A001.py:9:1: A001 Variable `min` is shadowing a Python builtin
8 | float = object = 4
9 | min, max = 5, 6
| ^^^ A001
10 |
10 |
11 | id = 4
|
@ -65,14 +64,14 @@ A001.py:9:6: A001 Variable `max` is shadowing a Python builtin
8 | float = object = 4
9 | min, max = 5, 6
| ^^^ A001
10 |
10 |
11 | id = 4
|
A001.py:13:5: A001 Variable `bytes` is shadowing a Python builtin
|
11 | id = 4
12 |
12 |
13 | def bytes():
| ^^^^^ A001
14 | pass
@ -81,7 +80,7 @@ A001.py:13:5: A001 Variable `bytes` is shadowing a Python builtin
A001.py:16:7: A001 Variable `slice` is shadowing a Python builtin
|
14 | pass
15 |
15 |
16 | class slice:
| ^^^^^ A001
17 | pass
@ -99,7 +98,7 @@ A001.py:21:23: A001 Variable `ValueError` is shadowing a Python builtin
A001.py:24:5: A001 Variable `memoryview` is shadowing a Python builtin
|
22 | ...
23 |
23 |
24 | for memoryview, *bytearray in []:
| ^^^^^^^^^^ A001
25 | pass
@ -108,7 +107,7 @@ A001.py:24:5: A001 Variable `memoryview` is shadowing a Python builtin
A001.py:24:18: A001 Variable `bytearray` is shadowing a Python builtin
|
22 | ...
23 |
23 |
24 | for memoryview, *bytearray in []:
| ^^^^^^^^^ A001
25 | pass
@ -117,7 +116,7 @@ A001.py:24:18: A001 Variable `bytearray` is shadowing a Python builtin
A001.py:27:22: A001 Variable `str` is shadowing a Python builtin
|
25 | pass
26 |
26 |
27 | with open('file') as str, open('file2') as (all, any):
| ^^^ A001
28 | pass
@ -126,7 +125,7 @@ A001.py:27:22: A001 Variable `str` is shadowing a Python builtin
A001.py:27:45: A001 Variable `all` is shadowing a Python builtin
|
25 | pass
26 |
26 |
27 | with open('file') as str, open('file2') as (all, any):
| ^^^ A001
28 | pass
@ -135,7 +134,7 @@ A001.py:27:45: A001 Variable `all` is shadowing a Python builtin
A001.py:27:50: A001 Variable `any` is shadowing a Python builtin
|
25 | pass
26 |
26 |
27 | with open('file') as str, open('file2') as (all, any):
| ^^^ A001
28 | pass
@ -144,7 +143,7 @@ A001.py:27:50: A001 Variable `any` is shadowing a Python builtin
A001.py:30:8: A001 Variable `sum` is shadowing a Python builtin
|
28 | pass
29 |
29 |
30 | [0 for sum in ()]
| ^^^ A001
|

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_builtins/mod.rs
snapshot_kind: text
---
A003.py:17:31: A003 Python builtin is shadowed by method `str` from line 14
|
15 | pass
16 |
16 |
17 | def method_usage(self) -> str:
| ^^^ A003
18 | pass
@ -14,7 +13,7 @@ A003.py:17:31: A003 Python builtin is shadowed by method `str` from line 14
A003.py:20:34: A003 Python builtin is shadowed by class attribute `id` from line 3
|
18 | pass
19 |
19 |
20 | def attribute_usage(self) -> id:
| ^^ A003
21 | pass

View file

@ -1,11 +1,10 @@
---
source: crates/ruff_linter/src/rules/flake8_builtins/mod.rs
snapshot_kind: text
---
A003.py:17:31: A003 Python builtin is shadowed by method `str` from line 14
|
15 | pass
16 |
16 |
17 | def method_usage(self) -> str:
| ^^^ A003
18 | pass

Some files were not shown because too many files have changed in this diff Show more