feat: Add isort, pre-commit, and GitHub Actions for linting#119
Open
feat: Add isort, pre-commit, and GitHub Actions for linting#119
Conversation
This commit introduces code formatting and import sorting enforcement: - **`pyproject.toml`**: Added `isort>=6.0.1` and `pre-commit` to the development dependencies. - **`.pre-commit-config.yaml`**: Created a new configuration file to run `black` and `isort` locally on each commit. Includes standard hooks for trailing whitespace, end-of-file fixing, and YAML checks. - **`setup_dev.sh`**: Added a new script to simplify developer onboarding by installing project dependencies (including dev tools) and setting up pre-commit hooks. The script is executable. - **GitHub Actions Workflow (`.github/workflows/isort-check.yml`)**: Implemented a new workflow to validate `isort` compliance on pushes to `main` and pull requests targeting `main`. The workflow installs PyTorch (CPU), project dependencies, and then runs `isort --check --diff .`. - **`README.md`**: Updated to include a "Development Setup" section explaining how to use the `setup_dev.sh` script. These changes aim to improve code consistency and catch formatting issues early in the development process.
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.
This commit introduces code formatting and import sorting enforcement:
pyproject.toml: Addedisort>=6.0.1andpre-committo the development dependencies..pre-commit-config.yaml: Created a new configuration file to runblackandisortlocally on each commit. Includes standard hooks for trailing whitespace, end-of-file fixing, and YAML checks.setup_dev.sh: Added a new script to simplify developer onboarding by installing project dependencies (including dev tools) and setting up pre-commit hooks. The script is executable..github/workflows/isort-check.yml): Implemented a new workflow to validateisortcompliance on pushes tomainand pull requests targetingmain. The workflow installs PyTorch (CPU), project dependencies, and then runsisort --check --diff ..README.md: Updated to include a "Development Setup" section explaining how to use thesetup_dev.shscript.These changes aim to improve code consistency and catch formatting issues early in the development process.