forked from TissueImageAnalytics/tiatoolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
75 lines (75 loc) · 3.47 KB
/
.pre-commit-config.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
ci:
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: 'weekly'
repos:
- repo: local
hooks:
- id: pytest-changed-files
name: pytest-changed-files
entry: pytest
files: tests/.*\btest_\w*.py
require_serial: true
language: system
stages: [push]
- id: notebook-markdown-format
name: notebook markdown format
entry: python pre-commit/notebook_markdown_format.py
require_serial: true
types_or: [jupyter]
language: python
additional_dependencies:
- mdformat
- mdformat-black
- mdformat-myst
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
# Optionally add plugins
additional_dependencies:
- mdformat-gfm # GitHub flavoured markdown
- mdformat-black # Black formatting for python verbatim blocks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast # Simply checks whether the files parse as valid Python.
- id: fix-byte-order-marker # Removes utf-8 byte order marker.
- id: check-json # Checks JSON files for parseable syntax.
- id: check-merge-conflict # Checks for files that contain merge conflict strings.
- id: check-symlinks # Checks for symlinks which do not point to anything.
- id: check-toml # Checks TOML files for parseable syntax.
- id: check-xml # Checks XML files for parseable syntax.
- id: check-yaml # Checks YAML files for parseable syntax.
- id: destroyed-symlinks # Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
- id: detect-private-key # Detects the presence of private keys.
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline.
- id: mixed-line-ending # Replaces or checks mixed line endings.
- id: requirements-txt-fixer # Sorts entries in requirements.txt.
- id: trailing-whitespace # Trims trailing whitespace.
- id: file-contents-sorter # Sorts the lines in specified files (defaults to alphabetical).
files: whitelist.txt
- id: debug-statements # Checks for debugger imports and py37+ `breakpoint()` calls in python source.
- id: pretty-format-json # Sets a standard for formatting JSON files.
exclude_types: [jupyter]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks # Detect common mistake of using single backticks when writing rst.
- id: rst-directive-colons # Detect mistake of rst directive not ending with double colon.
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst.
- repo: https://github.com/psf/black
rev: 24.2.0 # Replace with any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.+
additional_dependencies: ['click==8.0.4'] # Currently >8.0.4 breaks black
- id: black-jupyter
language: python
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi, jupyter]