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

[pep8-naming] Allow Django model loads in non-lowercase-variable-in-function (N806) #8917

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

charliermarsh
Copy link
Member

Summary

Allows assignments of the form, e.g., Attachment = apps.get_model("zerver", "Attachment"), for better compatibility with Django.

Closes #7675.

Test Plan

cargo test

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Nov 30, 2023
@charliermarsh
Copy link
Member Author

Small change I started on the plane, might as well wrap it up.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

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

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

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

- analytics/migrations/0009_remove_messages_to_stream_stat.py:10:5: N806 Variable `StreamCount` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:11:5: N806 Variable `RealmCount` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:12:5: N806 Variable `InstallationCount` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:13:5: N806 Variable `FillState` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:9:5: N806 Variable `UserCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:10:5: N806 Variable `StreamCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:11:5: N806 Variable `RealmCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:12:5: N806 Variable `InstallationCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:13:5: N806 Variable `FillState` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:9:5: N806 Variable `UserCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:10:5: N806 Variable `InstallationCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:11:5: N806 Variable `FillState` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:7:5: N806 Variable `UserCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:8:5: N806 Variable `StreamCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:9:5: N806 Variable `RealmCount` in function should be lowercase
- confirmation/migrations/0009_confirmation_expiry_date_backfill.py:15:5: N806 Variable `Confirmation` in function should be lowercase
- zerver/lib/test_helpers.py:595:9: N806 Variable `ArchivedAttachment` in function should be lowercase
- zerver/lib/test_helpers.py:596:9: N806 Variable `ArchivedMessage` in function should be lowercase
- zerver/lib/test_helpers.py:597:9: N806 Variable `ArchivedUserMessage` in function should be lowercase
- zerver/lib/test_helpers.py:598:9: N806 Variable `Attachment` in function should be lowercase
- zerver/lib/test_helpers.py:599:9: N806 Variable `BotConfigData` in function should be lowercase
- zerver/lib/test_helpers.py:600:9: N806 Variable `BotStorageData` in function should be lowercase
- zerver/lib/test_helpers.py:601:9: N806 Variable `Client` in function should be lowercase
- zerver/lib/test_helpers.py:602:9: N806 Variable `CustomProfileField` in function should be lowercase
- zerver/lib/test_helpers.py:603:9: N806 Variable `CustomProfileFieldValue` in function should be lowercase
- zerver/lib/test_helpers.py:604:9: N806 Variable `DefaultStream` in function should be lowercase
- zerver/lib/test_helpers.py:605:9: N806 Variable `DefaultStreamGroup` in function should be lowercase
- zerver/lib/test_helpers.py:606:9: N806 Variable `EmailChangeStatus` in function should be lowercase
- zerver/lib/test_helpers.py:607:9: N806 Variable `Huddle` in function should be lowercase
- zerver/lib/test_helpers.py:608:9: N806 Variable `Message` in function should be lowercase
- zerver/lib/test_helpers.py:609:9: N806 Variable `MultiuseInvite` in function should be lowercase
- zerver/lib/test_helpers.py:610:9: N806 Variable `UserTopic` in function should be lowercase
- zerver/lib/test_helpers.py:611:9: N806 Variable `PreregistrationUser` in function should be lowercase
- zerver/lib/test_helpers.py:612:9: N806 Variable `PushDeviceToken` in function should be lowercase
- zerver/lib/test_helpers.py:613:9: N806 Variable `Reaction` in function should be lowercase
- zerver/lib/test_helpers.py:614:9: N806 Variable `Realm` in function should be lowercase
- zerver/lib/test_helpers.py:615:9: N806 Variable `RealmAuditLog` in function should be lowercase
- zerver/lib/test_helpers.py:616:9: N806 Variable `RealmDomain` in function should be lowercase
- zerver/lib/test_helpers.py:617:9: N806 Variable `RealmEmoji` in function should be lowercase
- zerver/lib/test_helpers.py:618:9: N806 Variable `RealmFilter` in function should be lowercase
- zerver/lib/test_helpers.py:619:9: N806 Variable `Recipient` in function should be lowercase
- zerver/lib/test_helpers.py:623:9: N806 Variable `ScheduledEmail` in function should be lowercase
- zerver/lib/test_helpers.py:624:9: N806 Variable `ScheduledMessage` in function should be lowercase
- zerver/lib/test_helpers.py:625:9: N806 Variable `Service` in function should be lowercase
- zerver/lib/test_helpers.py:626:9: N806 Variable `Stream` in function should be lowercase
- zerver/lib/test_helpers.py:627:9: N806 Variable `Subscription` in function should be lowercase
- zerver/lib/test_helpers.py:628:9: N806 Variable `UserActivity` in function should be lowercase
- zerver/lib/test_helpers.py:629:9: N806 Variable `UserActivityInterval` in function should be lowercase
- zerver/lib/test_helpers.py:630:9: N806 Variable `UserGroup` in function should be lowercase
- zerver/lib/test_helpers.py:631:9: N806 Variable `UserGroupMembership` in function should be lowercase
... 251 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
N806 301 0 301 0 0

Linter (preview)

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

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

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

- analytics/migrations/0009_remove_messages_to_stream_stat.py:10:5: N806 Variable `StreamCount` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:11:5: N806 Variable `RealmCount` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:12:5: N806 Variable `InstallationCount` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:13:5: N806 Variable `FillState` in function should be lowercase
- analytics/migrations/0009_remove_messages_to_stream_stat.py:9:5: N806 Variable `UserCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:10:5: N806 Variable `StreamCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:11:5: N806 Variable `RealmCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:12:5: N806 Variable `InstallationCount` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:13:5: N806 Variable `FillState` in function should be lowercase
- analytics/migrations/0010_clear_messages_sent_values.py:9:5: N806 Variable `UserCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:10:5: N806 Variable `InstallationCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:11:5: N806 Variable `FillState` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:7:5: N806 Variable `UserCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:8:5: N806 Variable `StreamCount` in function should be lowercase
- analytics/migrations/0011_clear_analytics_tables.py:9:5: N806 Variable `RealmCount` in function should be lowercase
- confirmation/migrations/0009_confirmation_expiry_date_backfill.py:15:5: N806 Variable `Confirmation` in function should be lowercase
- zerver/lib/test_helpers.py:595:9: N806 Variable `ArchivedAttachment` in function should be lowercase
- zerver/lib/test_helpers.py:596:9: N806 Variable `ArchivedMessage` in function should be lowercase
- zerver/lib/test_helpers.py:597:9: N806 Variable `ArchivedUserMessage` in function should be lowercase
- zerver/lib/test_helpers.py:598:9: N806 Variable `Attachment` in function should be lowercase
- zerver/lib/test_helpers.py:599:9: N806 Variable `BotConfigData` in function should be lowercase
- zerver/lib/test_helpers.py:600:9: N806 Variable `BotStorageData` in function should be lowercase
- zerver/lib/test_helpers.py:601:9: N806 Variable `Client` in function should be lowercase
- zerver/lib/test_helpers.py:602:9: N806 Variable `CustomProfileField` in function should be lowercase
- zerver/lib/test_helpers.py:603:9: N806 Variable `CustomProfileFieldValue` in function should be lowercase
- zerver/lib/test_helpers.py:604:9: N806 Variable `DefaultStream` in function should be lowercase
- zerver/lib/test_helpers.py:605:9: N806 Variable `DefaultStreamGroup` in function should be lowercase
- zerver/lib/test_helpers.py:606:9: N806 Variable `EmailChangeStatus` in function should be lowercase
- zerver/lib/test_helpers.py:607:9: N806 Variable `Huddle` in function should be lowercase
- zerver/lib/test_helpers.py:608:9: N806 Variable `Message` in function should be lowercase
- zerver/lib/test_helpers.py:609:9: N806 Variable `MultiuseInvite` in function should be lowercase
- zerver/lib/test_helpers.py:610:9: N806 Variable `UserTopic` in function should be lowercase
- zerver/lib/test_helpers.py:611:9: N806 Variable `PreregistrationUser` in function should be lowercase
- zerver/lib/test_helpers.py:612:9: N806 Variable `PushDeviceToken` in function should be lowercase
- zerver/lib/test_helpers.py:613:9: N806 Variable `Reaction` in function should be lowercase
- zerver/lib/test_helpers.py:614:9: N806 Variable `Realm` in function should be lowercase
- zerver/lib/test_helpers.py:615:9: N806 Variable `RealmAuditLog` in function should be lowercase
- zerver/lib/test_helpers.py:616:9: N806 Variable `RealmDomain` in function should be lowercase
- zerver/lib/test_helpers.py:617:9: N806 Variable `RealmEmoji` in function should be lowercase
- zerver/lib/test_helpers.py:618:9: N806 Variable `RealmFilter` in function should be lowercase
- zerver/lib/test_helpers.py:619:9: N806 Variable `Recipient` in function should be lowercase
- zerver/lib/test_helpers.py:623:9: N806 Variable `ScheduledEmail` in function should be lowercase
- zerver/lib/test_helpers.py:624:9: N806 Variable `ScheduledMessage` in function should be lowercase
- zerver/lib/test_helpers.py:625:9: N806 Variable `Service` in function should be lowercase
- zerver/lib/test_helpers.py:626:9: N806 Variable `Stream` in function should be lowercase
- zerver/lib/test_helpers.py:627:9: N806 Variable `Subscription` in function should be lowercase
- zerver/lib/test_helpers.py:628:9: N806 Variable `UserActivity` in function should be lowercase
- zerver/lib/test_helpers.py:629:9: N806 Variable `UserActivityInterval` in function should be lowercase
- zerver/lib/test_helpers.py:630:9: N806 Variable `UserGroup` in function should be lowercase
- zerver/lib/test_helpers.py:631:9: N806 Variable `UserGroupMembership` in function should be lowercase
... 251 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
N806 301 0 301 0 0

@charliermarsh charliermarsh merged commit c324cb6 into main Nov 30, 2023
17 checks passed
@charliermarsh charliermarsh deleted the charlie/django branch November 30, 2023 01:43
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.

Rule N806 and Django
1 participant