This repository was archived by the owner on Dec 5, 2022. It is now read-only.
forked from BurnySc2/python-sc2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
103 lines (91 loc) · 2.25 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
103 lines (91 loc) · 2.25 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
repos:
# Check yaml files like this one and github actions if they are valid
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
# Autoformat yaml files
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.1.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
# Check github action workflow files
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.3.2
hooks:
- id: check-github-workflows
# Check toml files like pyproject.toml if it is valid
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-toml
# Remove unused imports
- repo: https://github.com/hadialqattan/pycln
rev: v1.0.3
hooks:
- id: pycln
args: [--config=pyproject.toml]
# Convert relative to absolute imports
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.0
hooks:
- id: absolufy-imports
# Sort imports
- repo: https://github.com/pycqa/isort
rev: 5.5.4
hooks:
- id: isort
files: \.(py)$
args: [--settings-path=pyproject.toml]
# Autoformat code
- repo: local
hooks:
- id: yapf
name: yapf
stages: [commit]
language: system
entry: poetry run yapf -i
types: [python]
exclude: setup.py
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
# Check if python files are vlaid
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
# Check for bad code
- id: python-no-eval
- id: python-no-log-warn
# Enforce type annotation instead of comment annotation
- id: python-use-type-annotations
- repo: local
hooks:
# TODO too many problems require change
# - id: pylint
# name: pylint
# stages: [commit]
# language: system
# entry: poetry run pylint
# types: [python]
# TODO Types before enabling this
# # Run mypy type checks
# - id: mypy
# name: mypy
# stages: [commit]
# language: system
# entry: poetry run mypy .
# types: [python]
# pass_filenames: false
# Run tests
- id: pytest
name: pytest
stages: [commit]
language: system
entry: poetry run pytest test
pass_filenames: false