Skip to content

[flake8-builtins] Remove builtins- prefix from option names #16092

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

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Feb 11, 2025

Summary

Resolves #15368.

The following options have been renamed:

  • builtins-allowed-modulesallowed-modules
  • builtins-ignorelistignorelist
  • builtins-strict-checkingstrict-checking

To preserve compatibility, the old names are kept as Serde aliases.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Feb 11, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+30 -9 violations, +0 -0 fixes in 4 projects; 51 projects unchanged)

apache/airflow (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- providers/fab/src/airflow/providers/fab/auth_manager/security_manager/override.py:2307:19: RUF035 Unsafe use of `markupsafe.Markup` detected
+ providers/fab/src/airflow/providers/fab/auth_manager/security_manager/override.py:2307:19: S704 Unsafe use of `markupsafe.Markup` detected

apache/superset (+7 -7 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- superset/connectors/sqla/models.py:1308:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/connectors/sqla/models.py:1308:16: S704 Unsafe use of `markupsafe.Markup` detected
- superset/models/dashboard.py:225:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/models/dashboard.py:225:16: S704 Unsafe use of `markupsafe.Markup` detected
- superset/models/helpers.py:538:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/models/helpers.py:538:16: S704 Unsafe use of `markupsafe.Markup` detected
- superset/models/helpers.py:567:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/models/helpers.py:567:16: S704 Unsafe use of `markupsafe.Markup` detected
- superset/models/slice.py:338:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/models/slice.py:338:16: S704 Unsafe use of `markupsafe.Markup` detected
- superset/models/sql_lab.py:445:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/models/sql_lab.py:445:16: S704 Unsafe use of `markupsafe.Markup` detected
- superset/utils/core.py:485:16: RUF035 Unsafe use of `markupsafe.Markup` detected
+ superset/utils/core.py:485:16: S704 Unsafe use of `markupsafe.Markup` detected

freedomofpress/securedrop (+21 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview

+ securedrop/journalist_app/account.py:100:20: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/account.py:87:20: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/admin.py:224:32: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/admin.py:279:20: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/admin.py:295:20: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/col.py:103:17: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/col.py:75:13: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/main.py:169:17: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/main.py:192:21: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/main.py:203:21: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/utils.py:267:9: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/utils.py:337:13: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/utils.py:366:13: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/utils.py:380:13: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/utils.py:503:17: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/journalist_app/utils.py:519:13: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/source_app/utils.py:37:16: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/source_app/utils.py:44:11: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/source_app/utils.py:51:22: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/source_app/utils.py:65:11: S704 Unsafe use of `markupsafe.Markup` detected
+ securedrop/template_filters.py:24:21: S704 Unsafe use of `markupsafe.Markup` detected

zulip/zulip (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- zerver/views/documentation.py:292:35: RUF035 Unsafe use of `markupsafe.Markup` detected
+ zerver/views/documentation.py:292:35: S704 Unsafe use of `markupsafe.Markup` detected

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
S704 30 30 0 0 0
RUF035 9 0 9 0 0

@InSyncWithFoo InSyncWithFoo force-pushed the builtins-options branch 2 times, most recently from 0eb38e6 to c163482 Compare February 11, 2025 04:44
@MichaReiser MichaReiser added the configuration Related to settings and configuration label Feb 11, 2025
@MichaReiser
Copy link
Member

Thanks. I think the builtins-ignorelist and builtins-allowed-modules in the summary are incorrect.

What we did in the past is to emit a deprecation warning for renamed settings so that we can remove the old names at some point in the future. It probably requires duplicating the fields on the Options structs and adding some custom code in Settings::from_options (I think it's called). Would you mind looking into this?

@MichaReiser MichaReiser added the breaking Breaking API change label Feb 11, 2025
@MichaReiser MichaReiser added this to the v0.10 milestone Feb 11, 2025
@dhruvmanila
Copy link
Member

As an additional reference, I think the infrastructure already exists and lint.extend-ignore is an example of a deprecated setting.

@InSyncWithFoo InSyncWithFoo force-pushed the builtins-options branch 3 times, most recently from 5e78095 to 56895d5 Compare February 11, 2025 18:42
Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@MichaReiser MichaReiser merged commit 80a3221 into astral-sh:micha/ruff-0.10 Mar 11, 2025
21 checks passed
@MichaReiser MichaReiser mentioned this pull request Mar 11, 2025
2 tasks
@InSyncWithFoo InSyncWithFoo deleted the builtins-options branch March 11, 2025 15:54
MichaReiser added a commit that referenced this pull request Mar 13, 2025
## Summary

Resolves #15368.

The following options have been renamed:

* `builtins-allowed-modules` → `allowed-modules`
* `builtins-ignorelist` → `ignorelist`
* `builtins-strict-checking` → `strict-checking`

To preserve compatibility, the old names are kept as Serde aliases.

## Test Plan

`cargo nextest run` and `cargo insta test`.

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
MichaReiser added a commit that referenced this pull request Mar 13, 2025
## Summary

Resolves #15368.

The following options have been renamed:

* `builtins-allowed-modules` &rarr; `allowed-modules`
* `builtins-ignorelist` &rarr; `ignorelist`
* `builtins-strict-checking` &rarr; `strict-checking`

To preserve compatibility, the old names are kept as Serde aliases.

## Test Plan

`cargo nextest run` and `cargo insta test`.

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename flake8-builtins options to remove the "builtins" prefix
3 participants