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

Use Ruff as linter and formatter and introduce git pre-commit hook #759

Merged
merged 17 commits into from
Jun 4, 2024

Conversation

martinvonk
Copy link
Collaborator

@martinvonk martinvonk commented May 23, 2024

Short Description

Changes:

  • isort removed
  • black removed
  • flake8 removed
  • ruff as linter and formatter:
  1. Lint code with: ruff check --extend-select I --fix and format code with: ruff format or do both in one command with tox -e ruff_fix
  2. Check each commit to a pastas branch: ruff check --extend-select I --preview + ruff format --check.
  • optional pre-commit hook for ruff:
    pip install pre-commit
    pre-commit install
    Which checks if the code is formatted as per step 1.

Checklist before PR can be merged:

@martinvonk martinvonk added the code quality Related to code quality, testing, CI, project setup etc. label May 23, 2024
Copy link

codacy-production bot commented May 23, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.14% (target: -1.00%) 58.33%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ff1199b) 6285 4760 75.74%
Head commit (b0defd7) 6325 (+40) 4799 (+39) 75.87% (+0.14%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#759) 24 14 58.33%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

xrange = rfunc_plot.x_range
else:
xrange = False
# xrange = False if rfunc_plot is None else rfunc_plot.x_range
Copy link
Member

Choose a reason for hiding this comment

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

Should this be uncommented?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

xrange is an unused variable.

Copy link
Member

@raoulcollenteur raoulcollenteur left a comment

Choose a reason for hiding this comment

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

One small question but otherwise looks fine to me.

@raoulcollenteur raoulcollenteur merged commit 3b3133e into dev Jun 4, 2024
8 checks passed
@raoulcollenteur raoulcollenteur deleted the ruff_precommit branch June 4, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Related to code quality, testing, CI, project setup etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants