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

Activate more ruff rules #337

Merged
merged 7 commits into from
Feb 14, 2024
Merged

Activate more ruff rules #337

merged 7 commits into from
Feb 14, 2024

Conversation

ffl096
Copy link
Member

@ffl096 ffl096 commented Feb 13, 2024

This pull request activates some additional linting rules and fixes occurring errors as a result of them.

Some noticeable new rules:

  • zip(): Use the optional strict parameter to error when the provided iterables are not of same length. This should catch some erroneous user inputs.
  • Remove unnecessary elif and else branches if the previous branch is guaranteed to return. This reduces indentation and makes the code cleaner.
  • Use list comprehensions instead of for-loops to transform lists. This is more performant.

@ffl096 ffl096 added the enhancement New feature or request label Feb 13, 2024
@ffl096 ffl096 requested a review from mhajij February 13, 2024 08:14
@ffl096 ffl096 self-assigned this Feb 13, 2024
@ffl096 ffl096 added refactor and removed enhancement New feature or request labels Feb 13, 2024
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (5f18280) 97.23% compared to head (ddfea99) 97.06%.

Files Patch % Lines
toponetx/classes/reportviews.py 81.42% 13 Missing ⚠️
toponetx/classes/combinatorial_complex.py 71.42% 6 Missing ⚠️
toponetx/utils/normalization.py 70.00% 6 Missing ⚠️
toponetx/classes/cell_complex.py 98.33% 1 Missing ⚠️
toponetx/classes/colored_hypergraph.py 93.75% 1 Missing ⚠️
toponetx/readwrite/serialization.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
- Coverage   97.23%   97.06%   -0.18%     
==========================================
  Files          35       35              
  Lines        3549     3508      -41     
==========================================
- Hits         3451     3405      -46     
- Misses         98      103       +5     

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

@ffl096
Copy link
Member Author

ffl096 commented Feb 13, 2024

Codecov complaints are about changes to lines that have been and still are uncovered by tests. No new code has been added in this pull request.

@ffl096 ffl096 merged commit 6f6cb51 into main Feb 14, 2024
7 of 9 checks passed
@ffl096 ffl096 deleted the frantzen-ruff-2 branch February 14, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants