Skip to content

feat: Add isort, pre-commit, and GitHub Actions for linting#119

Open
rwkeane wants to merge 1 commit intomainfrom
feature/add-isort-pre-commit-hook
Open

feat: Add isort, pre-commit, and GitHub Actions for linting#119
rwkeane wants to merge 1 commit intomainfrom
feature/add-isort-pre-commit-hook

Conversation

@rwkeane
Copy link
Owner

@rwkeane rwkeane commented Jun 12, 2025

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 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.
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.

1 participant