-
Notifications
You must be signed in to change notification settings - Fork 232
Ruff rules: Stricter code quality rules #879
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1d98369
to
8b9f897
Compare
b96922d
to
a72c4e7
Compare
9dc3eef
to
78afa34
Compare
e9da12b
to
c4b45f9
Compare
Codecov Report
@@ Coverage Diff @@
## master #879 +/- ##
==========================================
- Coverage 71.29% 71.15% -0.15%
==========================================
Files 25 25
Lines 1850 1893 +43
Branches 410 405 -5
==========================================
+ Hits 1319 1347 +28
- Misses 411 424 +13
- Partials 120 122 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
src/tmuxp/workspace/builder.py:258:9: B018 Found useless expression. Either assign it to a variable or remove it. src/tmuxp/workspace/builder.py:456:45: B023 Function definition does not bind loop variable `pane_config` src/tmuxp/workspace/builder.py:457:32: B023 Function definition does not bind loop variable `pane_config` src/tmuxp/workspace/builder.py:464:35: B023 Function definition does not bind loop variable `pane_config` src/tmuxp/workspace/builder.py:465:32: B023 Function definition does not bind loop variable `pane_config`
src/tmuxp/util.py:53:34: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` src/tmuxp/util.py:56:9: TRY300 Consider moving this statement to an `else` block src/tmuxp/util.py:59:13: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling src/tmuxp/util.py:59:13: TRY200 Use `raise from` to specify exception cause src/tmuxp/util.py:59:52: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` src/tmuxp/util.py:69:5: SIM102 Use a single `if` statement instead of nested `if` statements src/tmuxp/util.py:70:9: SIM102 Use a single `if` statement instead of nested `if` statements src/tmuxp/util.py:70:12: PTH110 `os.path.exists()` should be replaced by `Path.exists()` src/tmuxp/util.py:70:27: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()`
src/tmuxp/plugin.py:143:17: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling src/tmuxp/plugin.py:143:17: TRY200 Use `raise from` to specify exception cause
src/tmuxp/config_reader.py:102:19: SIM115 Use context handler for opening files src/tmuxp/config_reader.py:102:19: PTH123 `open()` should be replaced by `Path.open()`
src/tmuxp/cli/utils.py:218:19: TRY003 Avoid specifying long messages outside the exception class src/tmuxp/cli/utils.py:224:19: TRY003 Avoid specifying long messages outside the exception class
docs/conf.py:204:9: PERF203 `try`-`except` within a loop incurs performance overhead
conftest.py:72:37: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()`
rc/tmuxp/cli/load.py:122:13: PERF203 `try`-`except` within a loop incurs performance overhead src/tmuxp/cli/load.py:124:89: E501 Line too long (93 > 88 characters)
src/tmuxp/cli/import_config.py:156:15: SIM115 Use context handler for opening files
src/tmuxp/cli/freeze.py:109:13: TRY301 Abstract `raise` to an inner function src/tmuxp/cli/freeze.py:109:19: TRY003 Avoid specifying long messages outside the exception class src/tmuxp/cli/freeze.py:198:15: SIM115 Use context handler for opening files
src/tmuxp/cli/convert.py:64:15: TRY002 Create your own exception src/tmuxp/cli/convert.py:64:15: TRY003 Avoid specifying long messages outside the exception class src/tmuxp/cli/convert.py:75:5: SIM102 Use a single `if` statement instead of nested `if` statements src/tmuxp/cli/convert.py:76:9: SIM102 Use a single `if` statement instead of nested `if` statements src/tmuxp/cli/convert.py:81:15: SIM115 Use context handler for opening files
docs/_ext/aafig.py:61:23: RUF012 Mutable class attributes should be annotated with `typing.ClassVar` docs/_ext/aafig.py:147:15: TRY003 Avoid specifying long messages outside the exception class docs/_ext/aafig.py:176:29: SIM115 Use context handler for opening files docs/_ext/aafig.py:179:25: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling docs/_ext/aafig.py:179:25: TRY200 Use `raise from` to specify exception cause docs/_ext/aafig.py:193:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling docs/_ext/aafig.py:193:9: TRY200 Use `raise from` to specify exception cause docs/_ext/aafig.py:198:13: SIM115 Use context handler for opening files
tony
added a commit
that referenced
this pull request
Sep 4, 2023
tony
added a commit
that referenced
this pull request
Sep 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Docs:
See also: tmux-python/libtmux#488