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

Added config file for the Ruff Python linter and fixed additional errors #2473

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4f2d69d
Fixed syntax in readable_bash.py.
tdulcet Jan 27, 2024
e930097
Added Ruff config for Python code.
tdulcet Jan 8, 2025
b1e094a
Fixed UP031 (printf-string-formatting): Use format specifiers instead…
tdulcet Jan 8, 2025
9e33920
Fixed FURB118 (reimplemented-operator)
tdulcet Jan 8, 2025
d34a205
Fixed PLW0120 (useless-else-on-loop): `else` clause on loop without a…
tdulcet Jan 8, 2025
f4cef66
Fixed RET505 (superfluous-else-return)
tdulcet Jan 8, 2025
d09ca45
Fixed PLR6104 (non-augmented-assignment): Use `+=` to perform an augm…
tdulcet Jan 8, 2025
027918d
Fixed FURB188 (slice-to-remove-prefix-or-suffix): Prefer `removeprefi…
tdulcet Jan 8, 2025
5aded07
Fixed RUF051 (if-key-in-dict-del): Use `pop` instead of `key in dict`…
tdulcet Jan 8, 2025
c75be2f
Fixed SIM103 (needless-bool): Return the condition `not "admin" not i…
tdulcet Jan 8, 2025
acef64b
Fixed F401 (unused-import): `contextlib` imported but unused
tdulcet Jan 8, 2025
d27797b
Fixed RET507 (superfluous-else-continue): Unnecessary `elif` after `c…
tdulcet Jan 8, 2025
58b9a59
Fixed RUF039 (unraw-re-pattern)
tdulcet Jan 8, 2025
9c7e329
Fixed RUF031 (incorrectly-parenthesized-tuple-in-subscript): Avoid pa…
tdulcet Jan 8, 2025
f53679d
Fixed PGH004 (blanket-noqa): Use a colon when specifying `noqa` rule …
tdulcet Jan 8, 2025
3646227
Fixed SIM101 (duplicate-isinstance-call): Multiple `isinstance` calls…
tdulcet Jan 8, 2025
8a9d137
Fixed FURB142 (for-loop-set-mutations): Use of `set.add()` in a for loop
tdulcet Jan 8, 2025
93099ce
Fixed UP032 (f-string): Use f-string instead of `format` call
tdulcet Jan 8, 2025
1189992
Fixed FURB110 (if-exp-instead-of-or-operator): Replace ternary `if` e…
tdulcet Jan 8, 2025
b412e7b
Fixed UP015 (redundant-open-modes): Unnecessary open mode parameters
tdulcet Jan 8, 2025
ee240c6
Fixed PLW1514 (unspecified-encoding): `open` in text mode without exp…
tdulcet Jan 8, 2025
34d1e47
Fixed PLR6201 (literal-membership): Use a set literal when testing fo…
tdulcet Jan 8, 2025
2dc4dd1
Fixed W605 (invalid-escape-sequence)
tdulcet Jan 8, 2025
d7d91ee
Fixed Q003 (avoidable-escaped-quote): Change outer quotes to avoid es…
tdulcet Jan 8, 2025
a4af927
Fixed RUF055 (unnecessary-regular-expression): Plain string pattern p…
tdulcet Jan 8, 2025
1efb5d5
Fixed RET504 (unnecessary-assign): Unnecessary assignment to `v` befo…
tdulcet Jan 8, 2025
c357fe8
Fixed RET506 (superfluous-else-raise): Unnecessary `elif` after `rais…
tdulcet Jan 8, 2025
350b5b0
Fixed EM102 (f-string-in-exception): Exception must not use an f-stri…
tdulcet Jan 8, 2025
385ac08
Fixed RUF010 (explicit-f-string-type-conversion): Use explicit conver…
tdulcet Jan 8, 2025
1782b69
Fixed PLC1901 (compare-to-empty-string)
tdulcet Jan 12, 2025
1d1a1a0
Fixed UP031 (printf-string-formatting): Use format specifiers instead…
tdulcet Jan 12, 2025
08329c1
Fixed TRY003 (raise-vanilla-args): Avoid specifying long messages out…
tdulcet Jan 12, 2025
554a161
Fixed RET505 (superfluous-else-return): Unnecessary `elif` after `ret…
tdulcet Jan 12, 2025
9d9e900
Fixed G004 (logging-f-string): Logging statement uses f-string
tdulcet Jan 12, 2025
77a7a29
Fixed TRY300 (try-consider-else): Consider moving this statement to a…
tdulcet Jan 12, 2025
a0346b7
Fixed B007 (unused-loop-control-variable)
tdulcet Jan 12, 2025
c59ff13
Fixed RUF005 (collection-literal-concatenation): Consider iterable un…
tdulcet Jan 12, 2025
f13ae56
Fixed SIM115 (open-file-with-context-handler): Use a context manager …
tdulcet Jan 12, 2025
daf6d70
Fixed ARG005 (unused-lambda-argument): Unused lambda argument: `alias`
tdulcet Jan 12, 2025
2021c6d
Fixed RUF039 (unraw-re-pattern)
tdulcet Jan 12, 2025
0ee995f
Fixed F841 (unused-variable): Local variable `conffile` is assigned t…
tdulcet Jan 12, 2025
bd0cb22
Fixed UP032 (f-string): Use f-string instead of `format` call
tdulcet Jan 12, 2025
9896bfb
Fixed SIM117 (multiple-with-statements): Use a single `with` statemen…
tdulcet Jan 12, 2025
70bf676
Fixed PERF102 (incorrect-dict-iterator): When using only the keys of …
tdulcet Jan 12, 2025
7c3c956
Explicitly removed temporary file and deleted outdated comment.
tdulcet Feb 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed RET506 (superfluous-else-raise): Unnecessary elif after `rais…
…e` statement
tdulcet committed Jan 12, 2025
commit c357fe83d2276e1fe9c3e03e549114c36e983c42
2 changes: 1 addition & 1 deletion management/backup.py
Original file line number Diff line number Diff line change
@@ -499,7 +499,7 @@ def list_target_files(config):
msg = f"Connection to rsync host failed: {reason}"
raise ValueError(msg)

elif target.scheme == "s3":
if target.scheme == "s3":
import boto3.s3
from botocore.exceptions import ClientError