Skip to content

add pre-commits/linters for better code #234

Description

@LittlePlanetoid
  1. uv add --dev pre-commit
  2. uv run pre-commit install
  3. touch .pre-commit-config.yaml

here is a pre-commit conf example which use Ruff and Shellcheck linters (python and bash):

repos:
- repo: local
hooks:
- id: ruff-format-diff
name: ruff format diff
language: system
entry: uv run ruff format --diff
types: [python]
- id: ruff-check
name: ruff check
language: system
entry: uv run ruff check
- id: shellcheck
name: run shellcheck
language: system
entry: shellcheck
files: .(sh.j2|sh)$

At each git commit attempt, linters will check commited code and validate or not the commit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions