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 ruff rule RUF010 #1406

Closed
DimitriPapadopoulos opened this issue May 13, 2024 · 0 comments · Fixed by #1407
Closed

Add ruff rule RUF010 #1406

DimitriPapadopoulos opened this issue May 13, 2024 · 0 comments · Fixed by #1407

Comments

@DimitriPapadopoulos
Copy link
Contributor

How would this feature be useful?

RUF010 checks for uses of str(), repr(), and ascii() as explicit type conversions within f-strings.

$ ruff check --extend-select RUF010
scripts/update_package_cache.py:66:31: RUF010 [*] Use explicit conversion flag
scripts/update_package_cache.py:76:25: RUF010 [*] Use explicit conversion flag
scripts/update_package_cache.py:83:45: RUF010 [*] Use explicit conversion flag
scripts/update_package_cache.py:92:29: RUF010 [*] Use explicit conversion flag
scripts/update_package_cache.py:100:18: RUF010 [*] Use explicit conversion flag
scripts/update_package_cache.py:102:18: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:111:54: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:111:71: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:132:48: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:144:38: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:144:62: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:149:47: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:150:55: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:158:50: RUF010 [*] Use explicit conversion flag
src/pipx/commands/common.py:189:82: RUF010 [*] Use explicit conversion flag
src/pipx/commands/run.py:307:45: RUF010 [*] Use explicit conversion flag
src/pipx/commands/run.py:315:50: RUF010 [*] Use explicit conversion flag
src/pipx/commands/upgrade.py:81:33: RUF010 [*] Use explicit conversion flag
src/pipx/commands/upgrade.py:91:43: RUF010 [*] Use explicit conversion flag
src/pipx/commands/upgrade.py:136:61: RUF010 [*] Use explicit conversion flag
src/pipx/main.py:78:38: RUF010 [*] Use explicit conversion flag
src/pipx/main.py:79:37: RUF010 [*] Use explicit conversion flag
src/pipx/main.py:80:45: RUF010 [*] Use explicit conversion flag
src/pipx/main.py:1058:18: RUF010 [*] Use explicit conversion flag
tests/conftest.py:139:26: RUF010 [*] Use explicit conversion flag
tests/test_animate.py:48:48: RUF010 [*] Use explicit conversion flag
tests/test_animate.py:49:48: RUF010 [*] Use explicit conversion flag
tests/test_run.py:186:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:186:52: RUF010 [*] Use explicit conversion flag
tests/test_run.py:211:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:237:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:273:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:294:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:346:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:346:52: RUF010 [*] Use explicit conversion flag
tests/test_run.py:363:23: RUF010 [*] Use explicit conversion flag
tests/test_run.py:363:52: RUF010 [*] Use explicit conversion flag
tests/test_run.py:383:23: RUF010 [*] Use explicit conversion flag
Found 38 errors.
[*] 38 fixable with the `--fix` option.
$ 

Describe the solution you'd like

Fix issues reported by ruff check --extend-select RUF010 and add RUF010 to pyproject.toml.

Describe alternatives you've considered

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

Successfully merging a pull request may close this issue.

1 participant