-
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
[Bug] Ruff doesn't detect DJ012 rule after first fix #9150
Comments
I might be missing some context here but the playground shows the warning with the second code snippet: https://play.ruff.rs/407c7303-ed56-4cc0-8300-fd523728e97a |
@dhruvmanila I found the problem. Warning not fires when model inherited from another model (even non-abstract), like this https://play.ruff.rs/b7dbc350-21a2-4f97-9490-165d6226720c But still looks like bug for me |
Thanks! Yes, the rule wouldn't trigger if the model isn't inherited directly from Django's |
@dhruvmanila thank you so much for your attention. Hope it will be possible to fix this issue :) |
We can do it within a single file, but not across files. So we can fix the single-file case, but the multi-file analysis case should just be merged into the larger tracking issue since it’s not at all specific to the Django rules. |
@charliermarsh appreciate it. |
I can fix within the same file and make a note in the multi-file issue! |
## Summary As elsewhere, this only applies to classes defined within the same file. Closes #9150.
Bug description
I got an error DJ012 with some models when running command.
Code example:
After fixing the first model and running the
ruff check .
I didn't get a warning about the second modelMy configuration
ruff check .
The text was updated successfully, but these errors were encountered: