Skip to content

feat: migrate to Ruff for code linting and formatting #1727

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

Merged
merged 4 commits into from
Sep 5, 2024
Merged

Conversation

jorgepiloto
Copy link
Member

This pull-request drops support for black, isort, and flake in favor of Ruff, which contains all previous tools and more!

This linter and formatter is really fast for big projects. Its rules are able to identify common issues and format files in just a few milliseconds.

This pull-request is related with #1722.

src/ansys/dpf/gatebin/|
src/ansys/grpc/dpf/|
)
exclude: >
Copy link
Member Author

Choose a reason for hiding this comment

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

Without fixing this, pre-commit was ignoring all files.

@jorgepiloto jorgepiloto marked this pull request as ready for review September 3, 2024 12:51
@jorgepiloto
Copy link
Member Author

As discussed in private, we will enable step by step the different rules for better fixing any issues. Despite the rules being deactivated, Ruff formatter still provides all current capabilities. Just see the rules as "extras" or "plugins".


- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ["--ignore-words=ignore_words.txt"]
args: ["--ignore-words=./doc/styles/Vocab/ANSYS/accept.txt"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Unifying all ignore/accepted words in the "accept.txt" file

Copy link
Member Author

Choose a reason for hiding this comment

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

I just sorted and uniq this file

@jorgepiloto jorgepiloto requested a review from PProfizi September 4, 2024 10:22
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.05%. Comparing base (c4c0e85) to head (0e41978).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1727      +/-   ##
==========================================
+ Coverage   85.67%   87.05%   +1.37%     
==========================================
  Files          83       83              
  Lines        9937     9937              
==========================================
+ Hits         8514     8651     +137     
+ Misses       1423     1286     -137     

Copy link
Contributor

@PProfizi PProfizi left a comment

Choose a reason for hiding this comment

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

Checked the main changes, scanned the rest quickly, LGTM

@jorgepiloto jorgepiloto merged commit 294c764 into master Sep 5, 2024
42 of 43 checks passed
@jorgepiloto jorgepiloto deleted the feat/ruff branch September 5, 2024 11:42
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.

2 participants