aboutsummaryrefslogtreecommitdiffstats
path: root/.pre-commit-config.yaml
blob: af819d707ae27841fc60f792300127e2d920b083 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.6.0
    hooks:
      - id: check-merge-conflict
      - id: check-toml
      - id: check-yaml
      - id: end-of-file-fixer
      - id: mixed-line-ending
        args: [--fix=lf]
      - id: trailing-whitespace
        args: [--markdown-linebreak-ext=md]

  - repo: local
    hooks:
      - id: poetry
        name: poetry-check
        description: Checks the validity of the pyproject.toml file.
        entry: poetry check
        language: system
        files: thallium-backend/pyproject.toml
        pass_filenames: false
        require_serial: true

      - id: ruff-lint
        name: ruff linting
        description: Run ruff linting
        entry: poetry run ruff check --force-exclude
        language: system
        'types_or': [python, pyi]
        require_serial: true
        args: [--fix, --exit-non-zero-on-fix]

      - id: ruff-format
        name: ruff formatting
        description: Run ruff formatting
        entry: poetry run ruff format --force-exclude
        language: system
        'types_or': [python, pyi]
        require_serial: true