-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deprecation message for top-level lint settings #9582
Add deprecation message for top-level lint settings #9582
Conversation
d3fb8e9
to
dde7306
Compare
@@ -1132,6 +1135,201 @@ pub fn resolve_src(src: &[String], project_root: &Path) -> Result<Vec<PathBuf>> | |||
Ok(paths) | |||
} | |||
|
|||
fn warn_about_deprecated_top_level_lint_options(top_level_options: &LintCommonOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit silly, but writing a macro for it didn't feel worth the time because we shouldn't be adding any new options to LintCommonOptions
anyway.
.map(|option| format!("{option} -> lint.{option}")) | ||
.join(",\n "); | ||
|
||
warn_user!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit unfortunate that we don't know the configuration file name (relative to the project directory)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to get it... Want me to try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to do it. It can be done as a separate PR because I'm fairly certain we already emit other warnings without mentioning the configuration file name.
CodSpeed Performance ReportMerging #9582 will not alter performanceComparing Summary
|
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
D413 | 2714 | 2714 | 0 | 0 | 0 |
SIM103 | 10 | 5 | 5 | 0 | 0 |
PLE0237 | 2 | 2 | 0 | 0 | 0 |
F401 | 2 | 0 | 2 | 0 | 0 |
F821 | 1 | 0 | 1 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+2994 -8 violations, +1884 -0 fixes in 19 projects; 24 projects unchanged)
DisnakeDev/disnake (+961 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ disnake/abc.py:100:5: D413 [*] Missing blank line after last section ("Attributes") + disnake/abc.py:1073:9: D413 [*] Missing blank line after last section ("Returns") + disnake/abc.py:1153:9: D413 [*] Missing blank line after last section ("Raises") + disnake/abc.py:120:5: D413 [*] Missing blank line after last section ("Attributes") + disnake/abc.py:1288:9: D413 [*] Missing blank line after last section ("Returns") + disnake/abc.py:1377:9: D413 [*] Missing blank line after last section ("Returns") ... 842 additional changes omitted for rule D413 + disnake/abc.py:201:17: RUF023 [*] `_Overwrites.__slots__` is not sorted + disnake/activity.py:289:17: RUF023 [*] `Activity.__slots__` is not sorted + disnake/activity.py:530:17: RUF023 [*] `Streaming.__slots__` is not sorted + disnake/activity.py:619:17: RUF023 [*] `Spotify.__slots__` is not sorted ... 951 additional changes omitted for project
RasaHQ/rasa (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ rasa/core/evaluation/marker_stats.py:114:51: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead + rasa/core/featurizers/single_state_featurizer.py:119:20: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead + tests/core/featurizers/test_precomputation.py:110:17: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
aiven/aiven-client (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ aiven/client/cli.py:847:9: PLR1702 Too many nested blocks (6 > 5)
apache/airflow (+39 -1 violations, +1118 -0 fixes)
ruff check --no-cache --exit-zero --preview --select ALL
- airflow/__init__.py:95:5: RET506 Unnecessary `elif` after `raise` statement + airflow/__init__.py:95:5: RET506 [*] Unnecessary `elif` after `raise` statement - airflow/api_connexion/endpoints/config_endpoint.py:119:5: RET505 Unnecessary `elif` after `return` statement + airflow/api_connexion/endpoints/config_endpoint.py:119:5: RET505 [*] Unnecessary `elif` after `return` statement - airflow/api_connexion/endpoints/config_endpoint.py:85:5: RET505 Unnecessary `elif` after `return` statement + airflow/api_connexion/endpoints/config_endpoint.py:85:5: RET505 [*] Unnecessary `elif` after `return` statement - airflow/api_connexion/endpoints/dag_run_endpoint.py:441:5: RET505 Unnecessary `else` after `return` statement + airflow/api_connexion/endpoints/dag_run_endpoint.py:441:5: RET505 [*] Unnecessary `else` after `return` statement ... 815 additional changes omitted for rule RET505 - airflow/api_connexion/endpoints/forward_to_fab_endpoint.py:47:9: RET506 Unnecessary `else` after `raise` statement + airflow/api_connexion/endpoints/forward_to_fab_endpoint.py:47:9: RET506 [*] Unnecessary `else` after `raise` statement - airflow/cli/commands/dag_command.py:237:5: RET506 Unnecessary `elif` after `raise` statement ... 1147 additional changes omitted for project
aws/aws-sam-cli (+4 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ samcli/commands/sync/command.py:325:5: PLR1702 Too many nested blocks (7 > 5) + samcli/lib/package/utils.py:262:5: PLR1702 Too many nested blocks (7 > 5) + samcli/lib/utils/subprocess_utils.py:87:5: PLR1702 Too many nested blocks (6 > 5) + samcli/lib/utils/subprocess_utils.py:87:5: PLR1702 Too many nested blocks (6 > 5)
bokeh/bokeh (+97 -0 violations, +306 -0 fixes)
ruff check --no-cache --exit-zero --preview --select ALL
- examples/server/app/clustering/main.py:88:5: RET505 Unnecessary `elif` after `return` statement + examples/server/app/clustering/main.py:88:5: RET505 [*] Unnecessary `elif` after `return` statement - release/checks.py:105:9: RET505 Unnecessary `else` after `return` statement + release/checks.py:105:9: RET505 [*] Unnecessary `else` after `return` statement - release/checks.py:119:9: RET505 Unnecessary `else` after `return` statement + release/checks.py:119:9: RET505 [*] Unnecessary `else` after `return` statement ... 239 additional changes omitted for rule RET505 - src/bokeh/application/application.py:169:9: RET506 Unnecessary `elif` after `raise` statement + src/bokeh/application/application.py:169:9: RET506 [*] Unnecessary `elif` after `raise` statement + src/bokeh/application/application.py:250:9: D413 [*] Missing blank line after last section ("Returns") - src/bokeh/application/handlers/directory.py:154:9: RET506 Unnecessary `elif` after `raise` statement ... 393 additional changes omitted for project
demisto/content (+3 -3 violations, +38 -0 fixes)
ruff check --no-cache --exit-zero --preview
- Packs/ARIAPacketIntelligence/Integrations/ARIAPacketIntelligence/ARIAPacketIntelligence.py:383:13: RET508 Unnecessary `elif` after `break` statement + Packs/ARIAPacketIntelligence/Integrations/ARIAPacketIntelligence/ARIAPacketIntelligence.py:383:13: RET508 [*] Unnecessary `elif` after `break` statement - Packs/ARIAPacketIntelligence/Integrations/ARIAPacketIntelligence/ARIAPacketIntelligence.py:501:13: RET508 Unnecessary `elif` after `break` statement + Packs/ARIAPacketIntelligence/Integrations/ARIAPacketIntelligence/ARIAPacketIntelligence.py:501:13: RET508 [*] Unnecessary `elif` after `break` statement - Packs/CheckpointFirewall/Scripts/CheckpointFWBackupStatus/CheckpointFWBackupStatus.py:30:21: RET508 Unnecessary `else` after `break` statement + Packs/CheckpointFirewall/Scripts/CheckpointFWBackupStatus/CheckpointFWBackupStatus.py:30:21: RET508 [*] Unnecessary `else` after `break` statement ... 33 additional changes omitted for rule RET508 - Packs/ContentManagement/Scripts/ConfigurationSetup/ConfigurationSetup.py:221:5: SIM103 Return the condition `res['Type'] == entryTypes['error'] and 'Item not found' in res['Contents']` directly + Packs/ContentManagement/Scripts/ConfigurationSetup/ConfigurationSetup.py:221:5: SIM103 Return the condition directly + Packs/Malwarebytes/Integrations/Malwarebytes/Malwarebytes.py:1432:13: SIM103 Return the condition `data.get("statusCode") == 201` directly - Packs/Malwarebytes/Integrations/Malwarebytes/Malwarebytes.py:1432:13: SIM103 Return the condition `data.get('statusCode') == 201` directly ... 34 additional changes omitted for project
freedomofpress/securedrop (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ admin/bootstrap.py:85:5: PLR1702 Too many nested blocks (6 > 5) + securedrop/pretty_bad_protocol/_parsers.py:294:9: PLR1702 Too many nested blocks (6 > 5)
ibis-project/ibis (+537 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ ci/check_disallowed_imports.py:24:5: PLR1702 Too many nested blocks (6 > 5) + ibis/__init__.py:39:5: D413 [*] Missing blank line after last section ("Examples") + ibis/backends/base/__init__.py:100:9: D413 [*] Missing blank line after last section ("Returns") + ibis/backends/base/__init__.py:1063:9: D413 [*] Missing blank line after last section ("Returns") + ibis/backends/base/__init__.py:1098:9: D413 [*] Missing blank line after last section ("Parameters") + ibis/backends/base/__init__.py:110:9: D413 [*] Missing blank line after last section ("Returns") + ibis/backends/base/__init__.py:1114:9: D413 [*] Missing blank line after last section ("Parameters") ... 491 additional changes omitted for rule D413 + ibis/backends/dask/tests/execution/conftest.py:71:20: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead + ibis/backends/pandas/aggcontext.py:254:17: RUF023 [*] `AggregationContext.__slots__` is not sorted + ibis/common/annotations.py:103:17: RUF023 [*] `Annotation.__slots__` is not sorted ... 527 additional changes omitted for project
mlflow/mlflow (+0 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
- examples/llms/RAG/question-generation-retrieval-evaluation.ipynb:cell 14:1:1: F821 Undefined name `df` - examples/llms/RAG/question-generation-retrieval-evaluation.ipynb:cell 4:14:8: F401 [*] `requests` imported but unused - examples/llms/RAG/question-generation-retrieval-evaluation.ipynb:cell 4:16:17: F401 [*] `bs4.BeautifulSoup` imported but unused
pandas-dev/pandas (+40 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ pandas/core/dtypes/dtypes.py:1218:9: PLR1702 Too many nested blocks (6 > 5) + pandas/core/generic.py:7331:9: PLR1702 Too many nested blocks (6 > 5) + pandas/core/generic.py:7331:9: PLR1702 Too many nested blocks (6 > 5) + pandas/core/generic.py:7331:9: PLR1702 Too many nested blocks (7 > 5) + pandas/core/indexes/multi.py:3211:9: PLR1702 Too many nested blocks (6 > 5) + pandas/core/indexing.py:1828:9: PLR1702 Too many nested blocks (6 > 5) + pandas/core/indexing.py:1828:9: PLR1702 Too many nested blocks (7 > 5) + pandas/core/internals/array_manager.py:266:9: PLR1702 Too many nested blocks (6 > 5) + pandas/core/internals/construction.py:811:5: PLR1702 Too many nested blocks (6 > 5) + pandas/core/reshape/merge.py:1015:9: PLR1702 Too many nested blocks (6 > 5) ... 30 additional changes omitted for project
pypa/build (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ src/build/__main__.py:37:14: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
pypa/cibuildwheel (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ cibuildwheel/util.py:558:24: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
reflex-dev/reflex (+1247 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ integration/benchmarks/benchmarks.py:12:5: D413 [*] Missing blank line after last section ("Returns") + integration/benchmarks/benchmarks.py:48:5: D413 [*] Missing blank line after last section ("Returns") + integration/benchmarks/benchmarks.py:75:5: D413 [*] Missing blank line after last section ("Returns") + integration/benchmarks/helpers.py:16:5: D413 [*] Missing blank line after last section ("Args") + integration/benchmarks/test_compile_benchmark.py:104:5: D413 [*] Missing blank line after last section ("Args") + integration/benchmarks/test_compile_benchmark.py:114:5: D413 [*] Missing blank line after last section ("Args") + integration/benchmarks/test_compile_benchmark.py:30:9: D413 [*] Missing blank line after last section ("Args") + integration/benchmarks/test_compile_benchmark.py:39:5: D413 [*] Missing blank line after last section ("Returns") + integration/benchmarks/test_compile_benchmark.py:51:5: D413 [*] Missing blank line after last section ("Returns") + integration/benchmarks/test_compile_benchmark.py:70:5: D413 [*] Missing blank line after last section ("Args") + integration/benchmarks/test_compile_benchmark.py:80:5: D413 [*] Missing blank line after last section ("Args") + integration/benchmarks/test_compile_benchmark.py:90:5: D413 [*] Missing blank line after last section ("Args") ... 1235 additional changes omitted for project
... Truncated remaining completed project reports due to GitHub comment length restrictions
Changes by rule (12 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
D413 | 2714 | 2714 | 0 | 0 | 0 |
RET505 | 1432 | 0 | 0 | 1432 | 0 |
RET506 | 374 | 0 | 0 | 374 | 0 |
RUF023 | 150 | 150 | 0 | 0 | 0 |
PLR1702 | 95 | 95 | 0 | 0 | 0 |
RET508 | 50 | 0 | 0 | 50 | 0 |
RUF025 | 28 | 28 | 0 | 0 | 0 |
RET507 | 28 | 0 | 0 | 28 | 0 |
SIM103 | 10 | 5 | 5 | 0 | 0 |
PLE0237 | 2 | 2 | 0 | 0 | 0 |
F401 | 2 | 0 | 2 | 0 | 0 |
F821 | 1 | 0 | 1 | 0 | 0 |
.map(|option| format!("{option} -> lint.{option}")) | ||
.join(",\n "); | ||
|
||
warn_user!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to get it... Want me to try?
c9dbc2d
to
827f3a5
Compare
dde7306
to
6c22a40
Compare
827f3a5
to
b506995
Compare
47f27f7
to
0962140
Compare
0962140
to
fac766f
Compare
Summary
This PR adds deprecation warnings for the top-level lint settings we moved into the
lint
section.Test Plan
See updated CLI snapshot tests