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

build(pre-commit): pre-commit autoupdate by ci #1211

Open
wants to merge 1 commit into
base: dependency-updates
Choose a base branch
from

Conversation

@MyPyDavid
Copy link
Member

There are a couple of new ruff lint errors:

ruff.....................................................................Failed
- hook id: ruff
- exit code: 1

rdmo/core/management/commands/find_spam_users.py:135:15: UP031 Use format specifiers instead of percent format
    |
134 |         no_total_users = User.objects.all().count()
135 |         print('Total no of users:    %d' % (no_total_users))
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
136 |         potential_spam_users, no_users_having_projects =\
137 |             self.find_potential_spam_users(
    |
    = help: Replace with format specifiers

rdmo/core/management/commands/find_spam_users.py:142:13: UP031 Use format specifiers instead of percent format
    |
141 |         print(
142 |             'Potential spam users: %d  %.2f%% / of which have at least one project %d'
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
143 |             % (
144 |                 len(potential_spam_users),
    |
    = help: Replace with format specifiers

rdmo/core/management/commands/find_users.py:102:15: UP031 Use format specifiers instead of percent format
    |
100 |     def handle(self, *args, **options):
101 |         no_total_users = User.objects.all().count()
102 |         print('Total no of users:    %d' % (no_total_users))
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
103 |         found_users = self.find_users(options)
    |
    = help: Replace with format specifiers

rdmo/core/management/commands/find_users.py:106:13: UP031 Use format specifiers instead of percent format
    |
105 |         print(
106 |             'Matching the filter:  %d  %.2f%%'
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
107 |             % (
108 |                 len(found_users),
    |
    = help: Replace with format specifiers

rdmo/core/utils.py:139:17: UP031 Use format specifiers instead of percent format
    |
137 |         try:
138 |             language = settings.LANGUAGES[i][0], settings.LANGUAGES[i][1],\
139 |                 'lang%i' % (i + 1)
    |                 ^^^^^^^^ UP031
140 |             languages.append(language)
141 |         except IndexError:
    |
    = help: Replace with format specifiers

Found 5 errors.

@MyPyDavid MyPyDavid self-assigned this Dec 4, 2024
@MyPyDavid MyPyDavid added this to the RDMO 2.3.0 milestone Dec 4, 2024
@MyPyDavid MyPyDavid requested a review from triole December 4, 2024 15:28
@jochenklar
Copy link
Member

The one in rdmo/core/utils.py is pretty critical, we should manually check if that still works in Python 3.9. The other ones are becaus of C-style format strings with padding, right?

@MyPyDavid
Copy link
Member

the f-strings have been there since 3.6 (https://docs.python.org/3/reference/lexical_analysis.html#f-strings), that should not break the utils.py.
Padding can also be done in f-strings eg. f'{number:10d}'

@jochenklar
Copy link
Member

I know, but fstrings with a dict f'foo {bar['baz']}' work only with a later version, but I don't remember which.

@MyPyDavid
Copy link
Member

but where is this f-string dict lookup done in this context? It comes as string from the utils function right?

@jochenklar
Copy link
Member

yes, sorry, I was missleading, I am just worried that we use another feature of fstrings which might not be there in Python 3.9.

@MyPyDavid MyPyDavid requested a review from jochenklar December 5, 2024 16:49
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.6](astral-sh/ruff-pre-commit@v0.7.2...v0.8.6)
- [github.com/pre-commit/mirrors-eslint: v9.14.0 → v9.17.0](pre-commit/mirrors-eslint@v9.14.0...v9.17.0)
- [github.com/crate-ci/typos: v1.27.0 → dictgen-v0.3.1](crate-ci/typos@v1.27.0...dictgen-v0.3.1)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from ffde451 to 73e77a7 Compare January 6, 2025 21:28
@MyPyDavid
Copy link
Member

the bot force pushed the branch, however the fixes for the ruff lint errors can be added by an autofix with ruff I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants