forked from networkx/networkx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
58 lines (53 loc) · 1.87 KB
/
.pre-commit-config.yaml
File metadata and controls
58 lines (53 loc) · 1.87 KB
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
# Install pre-commit hooks via
# pre-commit install
repos:
- repo: https://github.com/rbubley/mirrors-prettier
rev: 787fb9f542b140ba0b2aced38e6a3e68021647a3 # frozen: v3.5.3
hooks:
- id: prettier
files: \.(html|md|toml|yml|yaml)
args: [--prose-wrap=preserve]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
hooks:
# Sanity checks
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-merge-conflict
# Checks based on file type
- id: check-ast
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
# Detect mistakes
- id: debug-statements
- id: detect-private-key
- id: forbid-submodules
# Automatic fixes
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
exclude_types: [svg, xml]
exclude: test_p2g.py
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: f0fe93c067104b76ffb58852abe79673a8429bd1 # frozen: v0.11.8
hooks:
- id: ruff
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
- id: ruff-format
- repo: local
hooks:
- id: generate_requirements.py
name: generate_requirements.py
language: system
entry: python tools/generate_requirements.py
files: "pyproject.toml|requirements/.*\\.txt|tools/generate_requirements.py"
- repo: local
hooks:
- id: check-import-conventions
name: Check import conventions; see CONTRIBUTING.rst#guidelines
language: pygrep
entry: "^ *import (networkx(,|$| (?!as nx))|numpy(?! as np)|scipy(?! as sp)|pandas(?! as pd)|matplotlib(,|$)|matplotlib.pyplot(?! as plt)|matplotlib (?!as mpl))"