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

Migrate formatter and linter to ruff #72

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

agoscinski
Copy link
Collaborator

@agoscinski agoscinski commented Nov 18, 2024

Since the goal is to integrate this repo back to aiida-core To be more compatible with newest aiida-core version this PR migrates linter to ruff with the settings as they are used in aiida-core

@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 94.88818% with 16 lines in your changes missing coverage. Please review.

Project coverage is 93.40%. Comparing base (e6dcaa0) to head (3b7e343).

Files with missing lines Patch % Lines
aiida_restapi/filter_syntax.py 84.21% 3 Missing ⚠️
aiida_restapi/graphql/orm_factories.py 91.17% 3 Missing ⚠️
aiida_restapi/graphql/plugins.py 75.00% 2 Missing ⚠️
aiida_restapi/graphql/sphinx_ext.py 0.00% 2 Missing ⚠️
aiida_restapi/graphql/users.py 71.42% 2 Missing ⚠️
aiida_restapi/aiida_db_mappings.py 98.30% 1 Missing ⚠️
aiida_restapi/graphql/utils.py 0.00% 1 Missing ⚠️
aiida_restapi/models.py 98.66% 1 Missing ⚠️
aiida_restapi/routers/auth.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master      #72   +/-   ##
=======================================
  Coverage   93.39%   93.40%           
=======================================
  Files          28       28           
  Lines         999      970   -29     
=======================================
- Hits          933      906   -27     
+ Misses         66       64    -2     
Flag Coverage Δ
pytests 93.40% <94.88%> (+<0.01%) ⬆️

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.


🚨 Try these New Features:

@agoscinski
Copy link
Collaborator Author

I added N80* ignores to the ruff file since we move away from python naming convention at several places. This is because we follow in these cases GraphQL naming convention.

@agoscinski agoscinski force-pushed the update-ruff-settings branch 4 times, most recently from b34af28 to e48f4b8 Compare November 18, 2024 15:38
@agoscinski agoscinski marked this pull request as ready for review November 18, 2024 15:38
@agoscinski agoscinski force-pushed the update-ruff-settings branch 2 times, most recently from 8a421af to 3b7e343 Compare November 18, 2024 16:04
We migrate to ruff for the linter and formatter with the settings of
aiida-core as well as the pre-commit hooks used for formatting. This
makes the repository more compatible with aiida-core and also allows
solves more linter problems automatically which should speed up
development
In several places we do not follow the pep8 naming convention but rather
GraphQL one. We therefore add the N80* linter ignores to disable the
linter for these cases.
This commit is mainly the result of running `pre-commit run --all-files`
with the previous changes in the formatter and linter. There is some
additional manual changes to fix linebreaks.
Copy link
Member

@eimrek eimrek left a comment

Choose a reason for hiding this comment

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

Great!

@agoscinski agoscinski merged commit 3e0e5df into aiidateam:master Nov 20, 2024
4 of 5 checks passed
@agoscinski agoscinski deleted the update-ruff-settings branch November 20, 2024 09:57
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