-
Notifications
You must be signed in to change notification settings - Fork 8
docs: Adding section on Ruff in code style tools page #592
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SMoraisAnsys
reviewed
May 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left minor comments
SMoraisAnsys
requested changes
May 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @ecoussoux-ansys, I left a minor comment
SMoraisAnsys
approved these changes
May 14, 2025
github-actions bot
pushed a commit
that referenced
this pull request
May 14, 2025
* docs: Adding section on Ruff in code style tools page * docs: Removing sections on Black, isort and Flake8 in code style tools page * docs: Updating based on review comments * docs: Harmonising documentation with changes made to code style tool page * docs: Updating required-standard based on review comment * Update doc/source/coding-style/required-standard.rst --------- Co-authored-by: Sébastien Morais <[email protected]>
This was referenced May 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the changes discussed in #589, i.e. replacing the sections in the code style tools documentation presenting Black, isort and Flake8 for code formatting and linting by a brief overview on how to perform these tasks with Ruff. Other parts of the documentation are also updated where necessary to take this change into account.
Ruff is introduced as a faster alternative to the previously used tools, combining in one common interface the features of interest for formatting and linting. A few key facts about Ruff are cited, a minimum Ruff setup for PyAnsys projects is provided and a recommended approach to add rules incrementally when migrating a project towards using Ruff is suggested.
As mentioned in #589, it should be noted that blacken-docs, used for formatting Python code blocks in documentation files, cannot currently be replaced by Ruff, which does not support formatting/linting of embedded code (particularly in .rst or .md files, see astral-sh/ruff#8237). Similarly, blacken-docs does not support the Ruff formatter as an alternative for Black (see adamchainz/blacken-docs#352).
Therefore, the use of blacken-docs is still recommended and the section of the documentation presenting this tool is left unchanged, despite the remaining dependence on Black.
Close #589