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

random cleanups / fixes #1879

Merged
merged 9 commits into from
Jan 9, 2024
Merged

random cleanups / fixes #1879

merged 9 commits into from
Jan 9, 2024

Conversation

ThomasWaldmann
Copy link
Collaborator

@ThomasWaldmann ThomasWaldmann commented Jan 8, 2024

most stuff was found by pycharm code checker.

commit 48af51f should fix some potential malfunction, that function is called without params rather often, thus site=None -> bug.

do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
local variable job is not assigned if queue was empty
when calling .run(), but it is used in exception handler.
the code intended to check if *any* worker is running for
any site was *unreachable*.

this caused false negative results for site=None.
Copy link
Collaborator

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
The pycharm code checker seems to be quite useful.

@ThomasWaldmann
Copy link
Collaborator Author

@Hofer-Julian It's a bit of a mixed experience:

  • sometimes it finds something useful (like here)
  • sometimes it has false positives (valid code, but the checker didn't get it)
  • lots of useless stuff (like unknown words)
  • the sheer volume of warnings can be rather high (vorta: > 50000)

Luckily, the result is somehow structured, so one does not need to look at all of the warnings.

@Hofer-Julian
Copy link
Collaborator

@Hofer-Julian It's a bit of a mixed experience:

* sometimes it finds something useful (like here)

* sometimes it has false positives (valid code, but the checker didn't get it)

* lots of useless stuff (like unknown words)

* the sheer volume of warnings can be rather high (vorta: > 50000)

Luckily, the result is somehow structured, so one does not need to look at all of the warnings.

Interesting.

I guess, we prefer tools anyway that have a CLI and can be easily run on the CI like typos and ruff.

@m3nu m3nu merged commit 675010e into borgbase:master Jan 9, 2024
@ThomasWaldmann ThomasWaldmann deleted the cleanups branch January 9, 2024 15:27
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.

3 participants