Skip to content

Set up Ruff and remove previous tools for formatting and linting #593

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

Closed
ecoussoux-ansys opened this issue Apr 30, 2025 · 0 comments · Fixed by #594
Closed

Set up Ruff and remove previous tools for formatting and linting #593

ecoussoux-ansys opened this issue Apr 30, 2025 · 0 comments · Fixed by #594
Assignees
Labels
enhancement New features or code improvements

Comments

@ecoussoux-ansys
Copy link
Contributor

ecoussoux-ansys commented Apr 30, 2025

📝 Description of the feature

PR #592 introduces changes to the documentation alone (presented in issue #589), leading to the replacement of the sections on Black, isort and Flake8 previously used for linting and formatting code, in favour of a paragraph on Ruff, which therefore becomes the unique tool recommended for these actions.
Some other parts of the documentation (minimum configs for .pre-commit-config.yaml file, other references to the tools replaced by Ruff) have also been updated accordingly.

The next step is to implement the recommendations set out in the documentation, and migrate the project to Ruff.

💡 Steps for implementing the feature

To do this, the various configurations relating to Black, isort and Flake8 must be removed and a setup for Ruff must be introduced.
The aim is to use Ruff to implement the same linting and formatting rules that were previously provided by the 3 former tools.

As mentioned in #589, please note, however, 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).
As a result, this tool is retained and will continue to be used as part of the .pre-commit-config.yaml file (see about the Ruff pre-commit hook astral-sh/ruff-pre-commit#55) for this project despite its dependence on Black.

🔗 Useful links and references

The following PRs have been used as a reference for migrating a project to Ruff:

@ecoussoux-ansys ecoussoux-ansys added the enhancement New features or code improvements label Apr 30, 2025
@ecoussoux-ansys ecoussoux-ansys self-assigned this Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant