Skip to content

Add pre-commit hooks for ruff and lint code #10

@slackline

Description

@slackline

The recently added switch to pyproject.toml (see #7 ) included configuration options for the ruff.

The easiest way to add this to the development workflow is via pre-commit and pre-commit.ci which runs the checks as part of the Continuous Integration.

Tasks to complete...

  • Tidy up the dev section of project.optional-dependencies in pyproject.toml. Currently there is not test-suite and there are some extraneous packages in there, at a bare minimum dev should retain ruff and
  • Add .pre-commit-config.yaml with appropriate configuration options for ruff
  • Apply linting to the code base and resolve all issues. #11
  • Ensure there is the appropriate configuration section for pre-commit.ci in the .pre-commit-config.yaml
  • Allow permission for pre-commit.ci to run on this repository.

Might also be worth linting the code with pylint as ruff doesn't always pick up all the "code smells"

  • Add pylint to dev section of project.optional-dependencies.
  • Add a .pylintrc to configure how pylint runs on the repository.
  • Add a local hook to .pre-commit-config.yaml and ensure this is excluded from pre-commit.ci (typically required because the environment that runs on pre-commit.ci won't have all of the required dependencies to run the linting).

Metadata

Metadata

Assignees

Labels

lintingLinting the code base

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions