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

Switch to ruff linter and formatter #422

Merged
merged 7 commits into from
Apr 30, 2024
Merged

Conversation

danielhollas
Copy link
Contributor

@danielhollas danielhollas commented Apr 3, 2024

I've taken ruff config from AWB (with minor modifications as needed).

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 60.09%. Comparing base (bfca750) to head (25617e4).

Files Patch % Lines
aiidalab/app.py 14.28% 6 Missing ⚠️
aiidalab/metadata.py 0.00% 3 Missing ⚠️
aiidalab/git_util.py 0.00% 2 Missing ⚠️
aiidalab/config.py 50.00% 1 Missing ⚠️
aiidalab/registry/releases.py 0.00% 1 Missing ⚠️
aiidalab/utils.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #422   +/-   ##
=======================================
  Coverage   60.09%   60.09%           
=======================================
  Files          23       23           
  Lines        1466     1466           
=======================================
  Hits          881      881           
  Misses        585      585           
Flag Coverage Δ
py-3.10 60.09% <33.33%> (ø)
py-3.11 60.09% <33.33%> (ø)
py-3.8 60.09% <33.33%> (ø)
py-3.9 60.09% <33.33%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@@ -5,7 +5,7 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
interval: monthly
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems a bit saner and matches what we have in AWB.

except RuntimeError as inner_error:
logger.error(f"Rollback failed due to error: {inner_error}!")
except RuntimeError:
logger.exception("Rollback failed! Consider re-installing the app.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently, the exception is always automatically included when using logger.exception inside except statement.

@@ -121,7 +122,6 @@ def build(
api_path=base_path / api_path,
apps_index=apps_index,
apps_data=apps_data,
scan_app_repository=parse_app_repo,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This argument was completely unused in build_api_v1, perhaps copy-paste error or some historical remnant?

@danielhollas danielhollas enabled auto-merge (squash) April 8, 2024 12:34
Copy link
Member

@yakutovicha yakutovicha left a comment

Choose a reason for hiding this comment

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

LGTM!

@danielhollas danielhollas merged commit 344a8cb into aiidalab:main Apr 30, 2024
8 checks passed
@danielhollas danielhollas deleted the ruff branch April 30, 2024 12:16
danielhollas added a commit to danielhollas/aiidalab that referenced this pull request May 27, 2024
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.

None yet

2 participants