chore: add ruff linter with pre-commit hooks#10
Merged
Conversation
Replace black, isort, and flake8 with ruff for faster linting. Configure ruff with sensible defaults and per-file ignores for re-exports and test fixtures. Fix all existing lint violations.
There was a problem hiding this comment.
Pull request overview
This PR replaces the existing linting toolchain (black, isort, and flake8) with ruff, a faster all-in-one Python linter and formatter. The migration includes configuration updates, pre-commit hook setup, and automated formatting fixes across the entire Python codebase.
Key changes:
- Migrated from black, isort, and flake8 to ruff for improved performance
- Added comprehensive ruff configuration with sensible defaults and per-file ignores
- Set up pre-commit hooks for automated linting and formatting
- Applied automated formatting fixes throughout the codebase (quote style, import ordering, line breaks)
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Replaced black/isort/flake8 dependencies with ruff; added comprehensive ruff configuration with per-file ignores |
| .pre-commit-config.yaml | Added pre-commit hooks for ruff linting and formatting |
| tests/*.py | Applied automated formatting: double quotes, import ordering, trailing commas, line length compliance |
| examples/*.py | Applied automated formatting: double quotes, import ordering, function call formatting |
| scripts/setup_distribution.py | Applied automated formatting: import ordering, function call formatting |
| dev_build.py | Applied automated formatting: import ordering, multi-line string formatting |
| cfd_python/init.py | Applied automated formatting: import ordering, quote style consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 5, 5, steps=3, | ||
| output_file=str(output_file) | ||
| ) | ||
| result = cfd_python.run_simulation(5, 5, steps=3, output_file=str(output_file)) |
There was a problem hiding this comment.
Variable result is not used.
Suggested change
| result = cfd_python.run_simulation(5, 5, steps=3, output_file=str(output_file)) | |
| cfd_python.run_simulation(5, 5, steps=3, output_file=str(output_file)) |
The test was missing the actual import statement inside the pytest.raises block, causing it to never raise ImportError.
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
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.
Replace black, isort, and flake8 with ruff for faster linting. Configure ruff with sensible defaults and per-file ignores for re-exports and test fixtures. Fix all existing lint violations.