Skip to content

Linting: Aggressive ruff pass (ruff v0.3.4) #922

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

Merged
merged 3 commits into from
Mar 24, 2024
Merged

Conversation

tony
Copy link
Member

@tony tony commented Mar 24, 2024

Changes

  • Automated, aggressive ruff pass
    • --select ALL
    • --preview
    • --unsafe-fixes

Command

ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes --ignore T201 --ignore PT014; ruff format .

Automated fixes

Fixed 184 errors:

  • conftest.py:
    3 × PT003 (pytest-extraneous-scope-function)
    2 × PT001 (pytest-fixture-incorrect-parentheses-style)
  • docs/_ext/aafig.py:
    4 × G010 (logging-warn)
    2 × PLW1514 (unspecified-encoding)
    2 × RSE102 (unnecessary-paren-on-raise-exception)
    1 × PLR1714 (repeated-equality-comparison)
    1 × I001 (unsorted-imports)
    1 × F841 (unused-variable)
    1 × PLR6201 (literal-membership)
  • docs/conf.py:
    1 × RET505 (superfluous-else-return)
  • src/tmuxp/_internal/config_reader.py:
    4 × RET505 (superfluous-else-return)
    1 × PLR6201 (literal-membership)
  • src/tmuxp/cli/init.py:
    3 × TID252 (relative-imports)
    2 × RET505 (superfluous-else-return)
    1 × I001 (unsorted-imports)
  • src/tmuxp/cli/convert.py:
    1 × TID252 (relative-imports)
    1 × PLW1514 (unspecified-encoding)
    1 × I001 (unsorted-imports)
    1 × PLR6201 (literal-membership)
  • src/tmuxp/cli/debug_info.py:
    1 × TID252 (relative-imports)
    1 × I001 (unsorted-imports)
  • src/tmuxp/cli/freeze.py:
    3 × TID252 (relative-imports)
    1 × PLW1514 (unspecified-encoding)
    1 × RSE102 (unnecessary-paren-on-raise-exception)
    1 × I001 (unsorted-imports)
  • src/tmuxp/cli/import_config.py:
    1 × TID252 (relative-imports)
    1 × PLW1514 (unspecified-encoding)
    1 × I001 (unsorted-imports)
  • src/tmuxp/cli/load.py:
    8 × TID252 (relative-imports)
    1 × RET505 (superfluous-else-return)
    1 × FURB113 (repeated-append)
    1 × I001 (unsorted-imports)
  • src/tmuxp/cli/shell.py:
    4 × TID252 (relative-imports)
    1 × PLR5501 (collapsible-else-if)
  • src/tmuxp/cli/utils.py:
    3 × RUF021 (parenthesize-chained-operators)
    1 × TID252 (relative-imports)
    1 × RET505 (superfluous-else-return)
  • src/tmuxp/log.py:
    1 × E303 (too-many-blank-lines)
    1 × RET504 (unnecessary-assign)
  • src/tmuxp/plugin.py:
    1 × SIM103 (needless-bool)
    1 × E713 (not-in-test)
  • src/tmuxp/shell.py:
    3 × RET505 (superfluous-else-return)
  • src/tmuxp/types.py:
    1 × TCH003 (typing-only-standard-library-import)
    1 × I001 (unsorted-imports)
  • src/tmuxp/util.py:
    3 × RET506 (superfluous-else-raise)
    3 × RSE102 (unnecessary-paren-on-raise-exception)
  • src/tmuxp/workspace/builder.py:
    4 × RET505 (superfluous-else-return)
    3 × TID252 (relative-imports)
    3 × RSE102 (unnecessary-paren-on-raise-exception)
    1 × RET506 (superfluous-else-raise)
  • src/tmuxp/workspace/finders.py:
    2 × E303 (too-many-blank-lines)
    2 × RET504 (unnecessary-assign)
  • src/tmuxp/workspace/freezer.py:
    1 × PLR5501 (collapsible-else-if)
  • src/tmuxp/workspace/importers.py:
    1 × TD006 (invalid-todo-capitalization)
    1 × RET507 (superfluous-else-continue)
  • src/tmuxp/workspace/loader.py:
    1 × PLR5501 (collapsible-else-if)
  • src/tmuxp/workspace/validation.py:
    3 × RSE102 (unnecessary-paren-on-raise-exception)
    1 × PIE790 (unnecessary-placeholder)
    1 × TID252 (relative-imports)
    1 × E303 (too-many-blank-lines)
  • tests/cli/test_cli.py:
    2 × I001 (unsorted-imports)
    1 × TCH002 (typing-only-third-party-import)
    1 × TID252 (relative-imports)
  • tests/cli/test_convert.py:
    1 × PLR6201 (literal-membership)
  • tests/cli/test_freeze.py:
    2 × PT006 (pytest-parametrize-names-wrong-type)
    1 × TCH002 (typing-only-third-party-import)
  • tests/cli/test_import.py:
    2 × PT006 (pytest-parametrize-names-wrong-type)
    1 × TID252 (relative-imports)
    1 × I001 (unsorted-imports)
  • tests/cli/test_load.py:
    2 × TID252 (relative-imports)
    2 × PT006 (pytest-parametrize-names-wrong-type)
    1 × I001 (unsorted-imports)
  • tests/cli/test_shell.py:
    2 × PT006 (pytest-parametrize-names-wrong-type)
    1 × TCH002 (typing-only-third-party-import)
  • tests/fixtures/import_teamocil/layouts.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/import_teamocil/test1.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/import_teamocil/test2.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/import_teamocil/test3.py:
    1 × TID252 (relative-imports)
    1 × ISC001 (single-line-implicit-string-concatenation)
  • tests/fixtures/import_teamocil/test4.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/import_tmuxinator/test1.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/import_tmuxinator/test2.py:
    1 × TID252 (relative-imports)
    1 × ISC001 (single-line-implicit-string-concatenation)
  • tests/fixtures/import_tmuxinator/test3.py:
    1 × TID252 (relative-imports)
    1 × ISC001 (single-line-implicit-string-concatenation)
  • tests/fixtures/utils.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/workspace/expand2.py:
    1 × TID252 (relative-imports)
  • tests/fixtures/workspace/shell_command_before_session.py:
    1 × TID252 (relative-imports)
  • tests/test_plugin.py:
    1 × PIE790 (unnecessary-placeholder)
  • tests/test_util.py:
    1 × F841 (unused-variable)
  • tests/workspace/conftest.py:
    2 × TID252 (relative-imports)
    1 × PT001 (pytest-fixture-incorrect-parentheses-style)
  • tests/workspace/test_builder.py:
    13 × PT007 (pytest-parametrize-values-wrong-type)
    3 × TID252 (relative-imports)
    2 × PT006 (pytest-parametrize-names-wrong-type)
    1 × RET505 (superfluous-else-return)
    1 × I001 (unsorted-imports)
    1 × PIE808 (unnecessary-range-start)
    1 × PLR1714 (repeated-equality-comparison)
    1 × PLR6201 (literal-membership)
  • tests/workspace/test_config.py:
    2 × TID252 (relative-imports)
    1 × I001 (unsorted-imports)
  • tests/workspace/test_finder.py:
    3 × PT001 (pytest-fixture-incorrect-parentheses-style)
    1 × PT006 (pytest-parametrize-names-wrong-type)
  • tests/workspace/test_freezer.py:
    2 × TID252 (relative-imports)
    1 × I001 (unsorted-imports)
  • tests/workspace/test_import_teamocil.py:
    2 × PT006 (pytest-parametrize-names-wrong-type)
    1 × I001 (unsorted-imports)
    1 × TID252 (relative-imports)
  • tests/workspace/test_import_tmuxinator.py:
    1 × I001 (unsorted-imports)
    1 × TID252 (relative-imports)
    1 × PT006 (pytest-parametrize-names-wrong-type)

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

Attention: Patch coverage is 59.37500% with 39 lines in your changes are missing coverage. Please review.

Project coverage is 70.28%. Comparing base (5a4bbb6) to head (53f41e2).

Files Patch % Lines
docs/_ext/aafig.py 9.09% 10 Missing ⚠️
src/tmuxp/util.py 16.66% 5 Missing ⚠️
src/tmuxp/workspace/builder.py 68.75% 3 Missing and 2 partials ⚠️
src/tmuxp/_internal/config_reader.py 20.00% 2 Missing and 2 partials ⚠️
src/tmuxp/cli/shell.py 50.00% 3 Missing and 1 partial ⚠️
src/tmuxp/shell.py 0.00% 0 Missing and 3 partials ⚠️
src/tmuxp/types.py 33.33% 1 Missing and 1 partial ⚠️
src/tmuxp/workspace/freezer.py 0.00% 2 Missing ⚠️
docs/conf.py 0.00% 1 Missing ⚠️
src/tmuxp/cli/convert.py 75.00% 0 Missing and 1 partial ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #922      +/-   ##
==========================================
- Coverage   70.39%   70.28%   -0.12%     
==========================================
  Files          26       26              
  Lines        1956     1955       -1     
  Branches      409      409              
==========================================
- Hits         1377     1374       -3     
- Misses        453      454       +1     
- Partials      126      127       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tony tony force-pushed the ruff-all-v0.3.4-pass branch from c92661b to fb5a58e Compare March 24, 2024 14:59
@tony tony changed the title refactor!(ruff): Run all automated fixes as of ruff 0.3.4 Linting: Aggressive ruff pass (ruff v0.3.4) Mar 24, 2024
tony added 3 commits March 24, 2024 12:49
src/tmuxp/util.py:54:9: TRY300 Consider moving this statement to an `else` block
ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes --ignore T201 --ignore PT014; ruff format .

Fixed 184 errors:
- conftest.py:
     3 × PT003 (pytest-extraneous-scope-function)
     2 × PT001 (pytest-fixture-incorrect-parentheses-style)
- docs/_ext/aafig.py:
     4 × G010 (logging-warn)
     2 × PLW1514 (unspecified-encoding)
     2 × RSE102 (unnecessary-paren-on-raise-exception)
     1 × PLR1714 (repeated-equality-comparison)
     1 × I001 (unsorted-imports)
     1 × F841 (unused-variable)
     1 × PLR6201 (literal-membership)
- docs/conf.py:
     1 × RET505 (superfluous-else-return)
- src/tmuxp/_internal/config_reader.py:
     4 × RET505 (superfluous-else-return)
     1 × PLR6201 (literal-membership)
- src/tmuxp/cli/__init__.py:
     3 × TID252 (relative-imports)
     2 × RET505 (superfluous-else-return)
     1 × I001 (unsorted-imports)
- src/tmuxp/cli/convert.py:
     1 × TID252 (relative-imports)
     1 × PLW1514 (unspecified-encoding)
     1 × I001 (unsorted-imports)
     1 × PLR6201 (literal-membership)
- src/tmuxp/cli/debug_info.py:
     1 × TID252 (relative-imports)
     1 × I001 (unsorted-imports)
- src/tmuxp/cli/freeze.py:
     3 × TID252 (relative-imports)
     1 × PLW1514 (unspecified-encoding)
     1 × RSE102 (unnecessary-paren-on-raise-exception)
     1 × I001 (unsorted-imports)
- src/tmuxp/cli/import_config.py:
     1 × TID252 (relative-imports)
     1 × PLW1514 (unspecified-encoding)
     1 × I001 (unsorted-imports)
- src/tmuxp/cli/load.py:
     8 × TID252 (relative-imports)
     1 × RET505 (superfluous-else-return)
     1 × FURB113 (repeated-append)
     1 × I001 (unsorted-imports)
- src/tmuxp/cli/shell.py:
     4 × TID252 (relative-imports)
     1 × PLR5501 (collapsible-else-if)
- src/tmuxp/cli/utils.py:
     3 × RUF021 (parenthesize-chained-operators)
     1 × TID252 (relative-imports)
     1 × RET505 (superfluous-else-return)
- src/tmuxp/log.py:
     1 × E303 (too-many-blank-lines)
     1 × RET504 (unnecessary-assign)
- src/tmuxp/plugin.py:
     1 × SIM103 (needless-bool)
     1 × E713 (not-in-test)
- src/tmuxp/shell.py:
     3 × RET505 (superfluous-else-return)
- src/tmuxp/types.py:
     1 × TCH003 (typing-only-standard-library-import)
     1 × I001 (unsorted-imports)
- src/tmuxp/util.py:
     3 × RET506 (superfluous-else-raise)
     3 × RSE102 (unnecessary-paren-on-raise-exception)
- src/tmuxp/workspace/builder.py:
     4 × RET505 (superfluous-else-return)
     3 × TID252 (relative-imports)
     3 × RSE102 (unnecessary-paren-on-raise-exception)
     1 × RET506 (superfluous-else-raise)
- src/tmuxp/workspace/finders.py:
     2 × E303 (too-many-blank-lines)
     2 × RET504 (unnecessary-assign)
- src/tmuxp/workspace/freezer.py:
     1 × PLR5501 (collapsible-else-if)
- src/tmuxp/workspace/importers.py:
     1 × TD006 (invalid-todo-capitalization)
     1 × RET507 (superfluous-else-continue)
- src/tmuxp/workspace/loader.py:
     1 × PLR5501 (collapsible-else-if)
- src/tmuxp/workspace/validation.py:
     3 × RSE102 (unnecessary-paren-on-raise-exception)
     1 × PIE790 (unnecessary-placeholder)
     1 × TID252 (relative-imports)
     1 × E303 (too-many-blank-lines)
- tests/cli/test_cli.py:
     2 × I001 (unsorted-imports)
     1 × TCH002 (typing-only-third-party-import)
     1 × TID252 (relative-imports)
- tests/cli/test_convert.py:
     1 × PLR6201 (literal-membership)
- tests/cli/test_freeze.py:
     2 × PT006 (pytest-parametrize-names-wrong-type)
     1 × TCH002 (typing-only-third-party-import)
- tests/cli/test_import.py:
     2 × PT006 (pytest-parametrize-names-wrong-type)
     1 × TID252 (relative-imports)
     1 × I001 (unsorted-imports)
- tests/cli/test_load.py:
     2 × TID252 (relative-imports)
     2 × PT006 (pytest-parametrize-names-wrong-type)
     1 × I001 (unsorted-imports)
- tests/cli/test_shell.py:
     2 × PT006 (pytest-parametrize-names-wrong-type)
     1 × TCH002 (typing-only-third-party-import)
- tests/fixtures/import_teamocil/layouts.py:
     1 × TID252 (relative-imports)
- tests/fixtures/import_teamocil/test1.py:
     1 × TID252 (relative-imports)
- tests/fixtures/import_teamocil/test2.py:
     1 × TID252 (relative-imports)
- tests/fixtures/import_teamocil/test3.py:
     1 × TID252 (relative-imports)
     1 × ISC001 (single-line-implicit-string-concatenation)
- tests/fixtures/import_teamocil/test4.py:
     1 × TID252 (relative-imports)
- tests/fixtures/import_tmuxinator/test1.py:
     1 × TID252 (relative-imports)
- tests/fixtures/import_tmuxinator/test2.py:
     1 × TID252 (relative-imports)
     1 × ISC001 (single-line-implicit-string-concatenation)
- tests/fixtures/import_tmuxinator/test3.py:
     1 × TID252 (relative-imports)
     1 × ISC001 (single-line-implicit-string-concatenation)
- tests/fixtures/utils.py:
     1 × TID252 (relative-imports)
- tests/fixtures/workspace/expand2.py:
     1 × TID252 (relative-imports)
- tests/fixtures/workspace/shell_command_before_session.py:
     1 × TID252 (relative-imports)
- tests/test_plugin.py:
     1 × PIE790 (unnecessary-placeholder)
- tests/test_util.py:
     1 × F841 (unused-variable)
- tests/workspace/conftest.py:
     2 × TID252 (relative-imports)
     1 × PT001 (pytest-fixture-incorrect-parentheses-style)
- tests/workspace/test_builder.py:
    13 × PT007 (pytest-parametrize-values-wrong-type)
     3 × TID252 (relative-imports)
     2 × PT006 (pytest-parametrize-names-wrong-type)
     1 × RET505 (superfluous-else-return)
     1 × I001 (unsorted-imports)
     1 × PIE808 (unnecessary-range-start)
     1 × PLR1714 (repeated-equality-comparison)
     1 × PLR6201 (literal-membership)
- tests/workspace/test_config.py:
     2 × TID252 (relative-imports)
     1 × I001 (unsorted-imports)
- tests/workspace/test_finder.py:
     3 × PT001 (pytest-fixture-incorrect-parentheses-style)
     1 × PT006 (pytest-parametrize-names-wrong-type)
- tests/workspace/test_freezer.py:
     2 × TID252 (relative-imports)
     1 × I001 (unsorted-imports)
- tests/workspace/test_import_teamocil.py:
     2 × PT006 (pytest-parametrize-names-wrong-type)
     1 × I001 (unsorted-imports)
     1 × TID252 (relative-imports)
- tests/workspace/test_import_tmuxinator.py:
     1 × I001 (unsorted-imports)
     1 × TID252 (relative-imports)
     1 × PT006 (pytest-parametrize-names-wrong-type)
@tony tony force-pushed the ruff-all-v0.3.4-pass branch from 622c00e to 53f41e2 Compare March 24, 2024 17:50
@tony tony merged commit 637e119 into master Mar 24, 2024
18 checks passed
@tony tony deleted the ruff-all-v0.3.4-pass branch March 24, 2024 19:10
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 this pull request may close these issues.

1 participant