--- default_language_version: python: python3 exclude: ^(doc/_static/.*|doc/_themes/.*)$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-merge-conflict # Check for files that contain merge conflict strings. - id: trailing-whitespace # Trims trailing whitespace. args: - --markdown-linebreak-ext=md - id: mixed-line-ending # Replaces or checks mixed line ending. args: - --fix=lf - id: end-of-file-fixer # Makes sure files end in a newline and only a newline. - id: check-ast # Simply check whether files parse as valid python. - id: check-case-conflict # Check for files with names that would conflict on a # case-insensitive filesystem like MacOS HFS+ or Windows FAT. - id: check-json # Attempts to load all json files to verify syntax. - id: check-symlinks # Checks for symlinks which do not point to anything. - id: debug-statements # Check for debugger imports and py37+ breakpoint() calls in python source. - id: fix-byte-order-marker # removes UTF-8 byte order marker - id: forbid-submodules # forbids any submodules in the repository. - id: fix-encoding-pragma # Remove `# -*- coding: utf-8 -*-` from the top of python files. args: - --remove # ----- Code Formatting and Analysis ----------------------------------------------------------> - repo: https://github.com/charliermarsh/ruff-pre-commit rev: "v0.2.0" hooks: - id: ruff args: - --fix exclude: (.pre-commit-hooks/.*|docs/.*)\.py - repo: https://github.com/psf/black rev: 24.1.1 hooks: - id: black args: [-l 100] exclude: src/saf/version.py - repo: https://github.com/asottile/blacken-docs rev: 1.16.0 hooks: - id: blacken-docs args: [--skip-errors] files: ^(docs/.*\.rst|.*\.py)$ additional_dependencies: - black==24.1.1 # <---- Code Formatting and Analysis -----------------------------------------------------------