-
Notifications
You must be signed in to change notification settings - Fork 12
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
Ruff rules: Stricter code quality rules #438
Commits on Aug 20, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1e2925b - Browse repository at this point
Copy the full SHA 1e2925bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80555a5 - Browse repository at this point
Copy the full SHA 80555a5View commit details -
refactor(pytest_plugin): Consolidate exceptions
src/libvcs/pytest_plugin.py:176:19: TRY002 Create your own exception src/libvcs/pytest_plugin.py:176:19: TRY003 Avoid specifying long messages outside the exception class
Configuration menu - View commit details
-
Copy full SHA for eda6c42 - Browse repository at this point
Copy the full SHA eda6c42View commit details -
chore(pytest-plugin): Manual fix for arg defaults
src/libvcs/pytest_plugin.py:210:34: B006 [*] Do not use mutable data structures for argument defaults src/libvcs/pytest_plugin.py:234:38: B006 [*] Do not use mutable data structures for argument defaults
Configuration menu - View commit details
-
Copy full SHA for e212def - Browse repository at this point
Copy the full SHA e212defView commit details -
Configuration menu - View commit details
-
Copy full SHA for fe8f2a4 - Browse repository at this point
Copy the full SHA fe8f2a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dbeb70 - Browse repository at this point
Copy the full SHA 0dbeb70View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10ab0cc - Browse repository at this point
Copy the full SHA 10ab0ccView commit details -
refactor(query_list): Ruff fixes
src/libvcs/_internal/query_list.py:87:9: TRY300 Consider moving this statement to an `else` block src/libvcs/_internal/query_list.py:119:9: SIM102 Use a single `if` statement instead of nested `if` statements src/libvcs/_internal/query_list.py:451:19: TRY002 Create your own exception src/libvcs/_internal/query_list.py:451:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/_internal/query_list.py:489:25: TRY301 Abstract `raise` to an inner function src/libvcs/_internal/query_list.py:489:31: TRY003 Avoid specifying long messages outside the exception class
Configuration menu - View commit details
-
Copy full SHA for 83c6cff - Browse repository at this point
Copy the full SHA 83c6cffView commit details -
chore(ruff): Automated fixes (Fix 103 warnings)
Fixed 105 errors: - conftest.py: 1 × UP006 (non-pep585-annotation) - docs/conf.py: 1 × RUF100 (unused-noqa) 1 × SIM108 (if-else-block-instead-of-if-exp) 1 × I001 (unsorted-imports) - src/libvcs/_internal/query_list.py: 6 × ERA001 (commented-out-code) 1 × SIM118 (in-dict-keys) - src/libvcs/_internal/run.py: 3 × ERA001 (commented-out-code) - src/libvcs/_internal/types.py: 1 × RUF100 (unused-noqa) - src/libvcs/cmd/git.py: 8 × RUF005 (collection-literal-concatenation) 1 × SIM108 (if-else-block-instead-of-if-exp) 1 × SIM102 (collapsible-if) - src/libvcs/cmd/hg.py: 1 × SIM108 (if-else-block-instead-of-if-exp) - src/libvcs/cmd/svn.py: 2 × UP006 (non-pep585-annotation) 1 × SIM108 (if-else-block-instead-of-if-exp) 1 × F401 (unused-import) - src/libvcs/sync/base.py: 1 × UP031 (printf-string-formatting) 1 × UP032 (f-string) - src/libvcs/sync/git.py: 1 × UP031 (printf-string-formatting) 1 × SIM102 (collapsible-if) 1 × ERA001 (commented-out-code) 1 × SIM108 (if-else-block-instead-of-if-exp) - src/libvcs/sync/hg.py: 1 × RUF100 (unused-noqa) - src/libvcs/sync/svn.py: 1 × RUF100 (unused-noqa) 1 × ERA001 (commented-out-code) 1 × SIM108 (if-else-block-instead-of-if-exp) 1 × B007 (unused-loop-control-variable) - src/libvcs/url/git.py: 1 × RUF100 (unused-noqa) 1 × C416 (unnecessary-comprehension) 1 × B010 (set-attr-with-constant) - src/libvcs/url/hg.py: 1 × RUF100 (unused-noqa) 1 × B010 (set-attr-with-constant) - src/libvcs/url/registry.py: 6 × UP006 (non-pep585-annotation) - src/libvcs/url/svn.py: 2 × RUF100 (unused-noqa) 1 × ERA001 (commented-out-code) 1 × B010 (set-attr-with-constant) - tests/_internal/test_query_list.py: 28 × C408 (unnecessary-collection-call) 2 × SIM300 (yoda-conditions) - tests/sync/test_base.py: 2 × SIM300 (yoda-conditions) 1 × RUF010 (explicit-f-string-type-conversion) - tests/sync/test_git.py: 3 × SIM300 (yoda-conditions) 1 × C416 (unnecessary-comprehension) 1 × I001 (unsorted-imports) - tests/test_pytest_plugin.py: 1 × ERA001 (commented-out-code) 1 × RUF015 (unnecessary-iterable-allocation-for-first-element) - tests/url/test_git.py: 1 × ERA001 (commented-out-code) - tests/url/test_hg.py: 1 × ERA001 (commented-out-code) - tests/url/test_registry.py: 3 × UP006 (non-pep585-annotation) 1 × B007 (unused-loop-control-variable) - tests/url/test_svn.py: 1 × ERA001 (commented-out-code)
Configuration menu - View commit details
-
Copy full SHA for 06f4b43 - Browse repository at this point
Copy the full SHA 06f4b43View commit details -
refactor: Manual fixes for ruff warnings (43 warnings fixed)
docs/conf.py:208:9: PERF203 `try`-`except` within a loop incurs performance overhead src/libvcs/_internal/shortcuts.py:108:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/_internal/shortcuts.py:108:19: F821 Undefined name `LibVCSException` src/libvcs/_internal/shortcuts.py:110:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/_internal/shortcuts.py:110:19: F821 Undefined name `LibVCSException` src/libvcs/_internal/shortcuts.py:120:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/_internal/subprocess.py:437:15: TRY002 Create your own exception src/libvcs/_internal/subprocess.py:437:15: TRY003 Avoid specifying long messages outside the exception class src/libvcs/cmd/svn.py:822:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/sync/git.py:143:19: TRY002 Create your own exception src/libvcs/sync/git.py:143:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/sync/git.py:275:19: TRY002 Create your own exception src/libvcs/sync/git.py:275:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/sync/git.py:385:13: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:410:23: TRY003 Avoid specifying long messages outside the exception class src/libvcs/sync/git.py:439:13: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:447:17: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:459:21: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:465:17: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:473:21: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:480:21: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:498:25: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:498:25: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:509:17: TRY400 Use `logging.exception` instead of `logging.error` src/libvcs/sync/git.py:589:19: TRY002 Create your own exception src/libvcs/sync/git.py:589:19: TRY003 Avoid specifying long messages outside the exception class src/libvcs/sync/git.py:676:23: TRY002 Create your own exception src/libvcs/sync/git.py:676:23: TRY003 Avoid specifying long messages outside the exception class src/libvcs/sync/svn.py:107:12: PTH110 `os.path.exists()` should be replaced by `Path.exists()` src/libvcs/sync/svn.py:107:45: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` src/libvcs/sync/svn.py:118:26: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator src/libvcs/sync/svn.py:119:20: PTH110 `os.path.exists()` should be replaced by `Path.exists()` src/libvcs/sync/svn.py:159:24: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator src/libvcs/sync/svn.py:160:12: PTH110 `os.path.exists()` should be replaced by `Path.exists()` src/libvcs/sync/svn.py:161:18: PTH123 `open()` should be replaced by `Path.open()` src/libvcs/sync/svn.py:175:23: TRY003 Avoid specifying long messages outside the exception class src/libvcs/url/git.py:291:20: B007 Loop control variable `v` not used within loop body src/libvcs/url/hg.py:220:20: B007 Loop control variable `v` not used within loop body src/libvcs/url/svn.py:204:20: B007 Loop control variable `v` not used within loop body tests/sync/test_git.py:110:12: PTH110 `os.path.exists()` should be replaced by `Path.exists()` tests/sync/test_hg.py:55:10: B017 `pytest.raises(Exception)` should be considered evil tests/sync/test_svn.py:29:12: PTH110 `os.path.exists()` should be replaced by `Path.exists()` tests/test_exc.py:12:15: TRY003 Avoid specifying long messages outside the exception class tests/test_exc.py:38:15: TRY003 Avoid specifying long messages outside the exception class
Configuration menu - View commit details
-
Copy full SHA for 1018173 - Browse repository at this point
Copy the full SHA 1018173View commit details -
Configuration menu - View commit details
-
Copy full SHA for e16a5d4 - Browse repository at this point
Copy the full SHA e16a5d4View commit details