Skip to content

Detect mark_safe usages in decorators#9887

Merged
charliermarsh merged 1 commit intomainfrom
charlie/mark_safe
Feb 8, 2024
Merged

Detect mark_safe usages in decorators#9887
charliermarsh merged 1 commit intomainfrom
charlie/mark_safe

Conversation

@charliermarsh
Copy link
Member

Summary

Django's mark_safe can also be used as a decorator, so we should detect usages of @mark_safe for the purpose of the relevant Bandit rule.

Closes #9780.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Feb 8, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit f76a3e8 into main Feb 8, 2024
@charliermarsh charliermarsh deleted the charlie/mark_safe branch February 8, 2024 04:10
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
## Summary

Django's `mark_safe` can also be used as a decorator, so we should
detect usages of `@mark_safe` for the purpose of the relevant Bandit
rule.

Closes astral-sh#9780.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S308 (mark_safe) doesn't detects decorator usage and imports from another place

1 participant