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

[refurb] Use UserString instead of non-existent UserStr #14209

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

nijel
Copy link
Contributor

@nijel nijel commented Nov 8, 2024

Summary

The class name is UserString, not a UserStr, see https://docs.python.org/3.9/library/collections.html#collections.UserString

Test Plan

The class name is UserString, not a UserStr.
Copy link
Contributor

github-actions bot commented Nov 8, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+5 -5 violations, +0 -0 fixes in 4 projects; 50 projects unchanged)

apache/airflow (+2 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- kubernetes_tests/test_base.py:45:26: FURB189 Subclassing `str` can be error prone, use `collections.UserStr` instead
+ kubernetes_tests/test_base.py:45:26: FURB189 Subclassing `str` can be error prone, use `collections.UserString` instead
- tests/utils/log/test_secrets_masker.py:317:54: FURB189 Subclassing `str` can be error prone, use `collections.UserStr` instead
+ tests/utils/log/test_secrets_masker.py:317:54: FURB189 Subclassing `str` can be error prone, use `collections.UserString` instead

langchain-ai/langchain (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- libs/core/tests/unit_tests/stubs.py:7:14: FURB189 Subclassing `str` can be error prone, use `collections.UserStr` instead
+ libs/core/tests/unit_tests/stubs.py:7:14: FURB189 Subclassing `str` can be error prone, use `collections.UserString` instead

scikit-build/scikit-build-core (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- src/scikit_build_core/settings/skbuild_model.py:31:27: FURB189 Subclassing `str` can be error prone, use `collections.UserStr` instead
+ src/scikit_build_core/settings/skbuild_model.py:31:27: FURB189 Subclassing `str` can be error prone, use `collections.UserString` instead

indico/indico (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- indico/legacy/pdfinterface/latex.py:169:16: FURB189 Subclassing `str` can be error prone, use `collections.UserStr` instead
+ indico/legacy/pdfinterface/latex.py:169:16: FURB189 Subclassing `str` can be error prone, use `collections.UserString` instead

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FURB189 10 5 5 0 0

@sbrugman
Copy link
Contributor

sbrugman commented Nov 8, 2024

Thanks!

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, whoops!

@charliermarsh charliermarsh added the bug Something isn't working label Nov 9, 2024
@charliermarsh charliermarsh changed the title Fix FURB189 replacing str to UserString [refurb] Use UserString instead of non-existent UserStr Nov 9, 2024
@charliermarsh charliermarsh merged commit b19f388 into astral-sh:main Nov 9, 2024
20 checks passed
@nijel nijel deleted the userstring branch November 9, 2024 05:48
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.

3 participants