Skip to content

[flake8-bandit] Move unsafe-markup-use from RUF035 to S704 - #15957

Merged
MichaReiser merged 10 commits into
astral-sh:micha/ruff-0.10from
Daverball:recategorize-RUF035-to-S704
Mar 11, 2025
Merged

MichaReiser merged 10 commits into
astral-sh:micha/ruff-0.10from
Daverball:recategorize-RUF035-to-S704

Conversation

@Daverball

Copy link
Copy Markdown
Contributor

Summary

RUF035 has been backported into bandit as S704 in this PR

This moves the rule and its corresponding setting to the flake8-bandit category

Test Plan

cargo nextest run

@MichaReiser MichaReiser added this to the v0.10 milestone Feb 5, 2025
@MichaReiser MichaReiser added the breaking Backwards-incompatible changes label Feb 5, 2025
@Daverball

This comment was marked as resolved.

@MichaReiser

Copy link
Copy Markdown
Member

Thanks, this has to wait for the next minor release because it's breaking (selecting RUF will no longer select RUF035 and selecting S now selects S704)

@github-actions

github-actions Bot commented Feb 5, 2025 •

Copy link
Copy Markdown
Contributor

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

@MichaReiser

Copy link
Copy Markdown
Member

@MichaReiser Can you think of a clever way to default the settings in their new section to the value in their deprecated section?

Clever, no :) But what I'd do is to lift the Flake8Options::into_settings into Configuration::into_settings because that's where you have access to both the Ruff and Flake8 options. Or you change the Flake8Options::into_settings to take a second argument that's an Option<&RuffOptions>

@MichaReiser
MichaReiser changed the base branch from main to micha/ruff-0.10 March 10, 2025 14:23
@MichaReiser

Copy link
Copy Markdown
Member

Thanks @Daverball for rebasing

@MichaReiser MichaReiser mentioned this pull request Mar 11, 2025
2 tasks done
@MichaReiser
MichaReiser merged commit 2ae5344 into astral-sh:micha/ruff-0.10 Mar 11, 2025
@Daverball
Daverball deleted the recategorize-RUF035-to-S704 branch March 11, 2025 12:24
MichaReiser added a commit that referenced this pull request Mar 13, 2025
…15957)

## Summary

`RUF035` has been backported into bandit as `S704` in this
[PR](PyCQA/bandit#1225)

This moves the rule and its corresponding setting to the `flake8-bandit`
category

## Test Plan

`cargo nextest run`

---------

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

## Summary

`RUF035` has been backported into bandit as `S704` in this
[PR](PyCQA/bandit#1225)

This moves the rule and its corresponding setting to the `flake8-bandit`
category

## Test Plan

`cargo nextest run`

---------

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 Backwards-incompatible changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants