Skip to content

pre-commit template #93

@SamEdwardes

Description

@SamEdwardes

.pre-commit-config.yaml

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
    # General hooks
    - repo: https://github.com/pre-commit/pre-commit-hooks
      rev: v3.2.0
      hooks:
          - id: trailing-whitespace
          - id: end-of-file-fixer
          - id: check-yaml
          - id: check-added-large-files

    # Python
    - repo: https://github.com/astral-sh/ruff-pre-commit
      rev: v0.11.1
      hooks:
          - id: ruff
            args:
                - --fix
                - --select=I,F401
          - id: ruff-format

  - repo: https://github.com/astral-sh/uv-pre-commit
    # uv version.
    rev: 0.6.8
    hooks:
      - id: uv-export
      - id: uv-lock

    # Jupyter
    - repo: local
      hooks:
          - id: clean-notebooks
            name: Remove output from Jupyter Notebooks
            entry: uvx jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
            language: system
            files: \.ipynb$

    # R
    - repo: local
      hooks:
          # https://github.com/posit-dev/air
          - id: air
            name: Format R code with air
            entry: air format .
            language: system
            files: \.R$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions