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

ci: Use ruff in pre-commit to further limit code complexity #5783

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Sep 12, 2023

Related Issues

Proposed Changes:

Add the ruff linter to pre-commit.

Ruff supports over 600 lint rules and can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing (in Rust) tens or hundreds of times faster than any individual tool.

ruff --format=github . in a GitHub Action provides intuitive GitHub Annotations to contributors...

image

Also, added noqa lint directives on our most complex functions to keep our limits low.

How did you test it?

% pre-commit run ruff --all-files
% pre-commit run --all-files

Notes for the reviewer

Checklist

@cclauss cclauss requested a review from a team as a code owner September 12, 2023 16:46
@cclauss cclauss requested review from bogdankostic and removed request for a team September 12, 2023 16:46
@cclauss cclauss requested a review from a team as a code owner September 12, 2023 17:19
@cclauss cclauss requested review from dfokina and removed request for a team September 12, 2023 17:19
@coveralls
Copy link
Collaborator

coveralls commented Sep 12, 2023

Pull Request Test Coverage Report for Build 6172318878

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 48.977%

Files with Coverage Reduction New Missed Lines %
mmh3.py 35 42.54%
Totals Coverage Status
Change from base Build 6172238901: 0.0%
Covered Lines: 11823
Relevant Lines: 24140

💛 - Coveralls

Copy link
Contributor

Choose a reason for hiding this comment

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

Again I would remove this, it doesn't affect the end user.

@silvanocerza silvanocerza added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label Sep 13, 2023
@github-actions github-actions bot added the type:documentation Improvements on the docs label Sep 13, 2023
@silvanocerza
Copy link
Contributor

I merged in main, I managed to solve the license check failure with #5795.

If it's all green after that I'll approve and merge.

@silvanocerza silvanocerza merged commit 30ca042 into deepset-ai:main Sep 13, 2023
58 checks passed
@cclauss cclauss deleted the ruff branch September 13, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release-notes PRs with this flag won't be included in the release notes. topic:build/distribution topic:dependencies topic:DX Developer Experience topic:modeling topic:pipeline topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants