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

Add base-class inheritance detection to flake8-django rules #9151

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

charliermarsh
Copy link
Member

Summary

As elsewhere, this only applies to classes defined within the same file.

Closes #9150.

@charliermarsh charliermarsh added the bug Something isn't working label Dec 15, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) December 15, 2023 17:58
@charliermarsh charliermarsh merged commit 6ecf844 into main Dec 15, 2023
16 checks passed
@charliermarsh charliermarsh deleted the charlie/django branch December 15, 2023 18:01
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+19 -0 violations, +0 -0 fixes in 41 projects)

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

ruff check --no-cache --exit-zero --no-preview --select ALL

+ zerver/models.py:1895:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:2171:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `__str__` method should come before custom method
+ zerver/models.py:2382:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before custom method
+ zerver/models.py:2677:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3207:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3216:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3279:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before custom method
+ zerver/models.py:3382:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3393:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3503:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `__str__` method should come before custom method
+ zerver/models.py:3508:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3808:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3829:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:4456:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:4943:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before `__str__` method
+ zilencer/models.py:191:7: DJ008 Model does not define `__str__` method
+ zilencer/models.py:210:7: DJ008 Model does not define `__str__` method
+ zilencer/models.py:235:7: DJ008 Model does not define `__str__` method
+ zilencer/models.py:254:7: DJ008 Model does not define `__str__` method

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
DJ008 14 14 0 0 0
DJ012 5 5 0 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+19 -0 violations, +0 -0 fixes in 41 projects)

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

ruff check --no-cache --exit-zero --preview --select ALL

+ zerver/models.py:1895:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:2171:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `__str__` method should come before custom method
+ zerver/models.py:2382:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before custom method
+ zerver/models.py:2677:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3207:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3216:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3279:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before custom method
+ zerver/models.py:3382:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3393:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3503:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `__str__` method should come before custom method
+ zerver/models.py:3508:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3808:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:3829:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:4456:7: DJ008 Model does not define `__str__` method
+ zerver/models.py:4943:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before `__str__` method
+ zilencer/models.py:191:7: DJ008 Model does not define `__str__` method
+ zilencer/models.py:210:7: DJ008 Model does not define `__str__` method
+ zilencer/models.py:235:7: DJ008 Model does not define `__str__` method
+ zilencer/models.py:254:7: DJ008 Model does not define `__str__` method

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
DJ008 14 14 0 0 0
DJ012 5 5 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Ruff doesn't detect DJ012 rule after first fix
1 participant