Skip to content
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

_SELF name should not trigger WPS117 #3310

Open
sobolevn opened this issue Feb 13, 2025 · 2 comments
Open

_SELF name should not trigger WPS117 #3310

sobolevn opened this issue Feb 13, 2025 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Entrypoint to the project help wanted Extra attention is needed

Comments

@sobolevn
Copy link
Member

server/settings/components/csp.py

  11:1     WPS117 Found name reserved for first argument: _SELF
  _SELF = "'self'"
  ^

We also need to check names like _Self and Self, they should be fine.

@sobolevn sobolevn added bug Something isn't working good first issue Entrypoint to the project help wanted Extra attention is needed labels Feb 13, 2025
@ApostolFet
Copy link

It seems sufficient to replace the use of the logic.is_wrong_name function with the in operator https://github.com/wemake-services/wemake-python-styleguide/blob/master/wemake_python_styleguide/visitors/ast/naming/validation.py#L116

@Burka111
Copy link

I've encountered a similar issue when working with Django models. Implementing a custom validator function resolved the problem for me. Has anyone else tried this approach? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Entrypoint to the project help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants