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

[DPE-5324] Increase linting rules #649

Merged
merged 6 commits into from
Oct 18, 2024
Merged

[DPE-5324] Increase linting rules #649

merged 6 commits into from
Oct 18, 2024

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Oct 16, 2024

Add more linting rules and change and suppress the reported issues. Added rules are:

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 87.42515% with 21 lines in your changes missing coverage. Please review.

Project coverage is 71.46%. Comparing base (3c7c783) to head (6496c25).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/relations/async_replication.py 55.55% 8 Missing ⚠️
src/cluster.py 72.22% 5 Missing ⚠️
src/charm.py 88.88% 3 Missing and 1 partial ⚠️
src/relations/postgresql_provider.py 50.00% 2 Missing ⚠️
src/cluster_topology_observer.py 75.00% 1 Missing ⚠️
src/relations/db.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #649      +/-   ##
==========================================
+ Coverage   71.23%   71.46%   +0.22%     
==========================================
  Files          12       12              
  Lines        3091     3073      -18     
  Branches      471      461      -10     
==========================================
- Hits         2202     2196       -6     
+ Misses        777      767      -10     
+ Partials      112      110       -2     

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

@dragomirp dragomirp marked this pull request as ready for review October 17, 2024 09:44
@@ -100,13 +100,13 @@ target-version = ["py38"]
[tool.ruff]
# preview and explicit preview are enabled for CPY001
preview = true
target-version = "py38"
target-version = "py310"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No libs or focal, so it is safe.

Comment on lines +52 to +53
PATRONI_TIMEOUT = 10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bandit rules want timeouts for HTTP calls.

Comment on lines +89 to +90
# File shouldn't close
stdout=open(LOG_FILE_PATH, "a"), # noqa: SIM115
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should most probably set the output in the running instance instead or switch to a proper service.

@dragomirp dragomirp requested review from a team, taurus-forever, marceloneppel and lucasgameiroborges and removed request for a team October 17, 2024 09:58
Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

LGTM! I liked the HTTP calls timeout enforcement.

@dragomirp dragomirp merged commit 037d1bb into main Oct 18, 2024
97 checks passed
@dragomirp dragomirp deleted the dpe-5324-ruff branch October 18, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants