forked from MadeInPierre/finalynx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
59 lines (53 loc) · 1.84 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
# See https://pre-commit.com for more information
default_install_hook_types: [pre-commit, commit-msg]
repos:
# Ensure the user commits a message that follows the Conventional Commits guidelines
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.42.0
hooks:
- id: commitizen
- id: commitizen-branch
stages:
- push
# General random but nice pre-hooks to have
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-toml
- id: check-yaml
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
# - id: check-docstring-first
- id: check-shebang-scripts-are-executable
- id: check-added-large-files # TODO add many others!
# Modernize syntax to the most Pythonic way
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py36-plus]
# Reorder imports to tidy them up
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--application-directories=finalynx]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
exclude: ^(finalynx/finary_api/|examples/)
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.10
args: [--line-length=120]
# Run a linter to check for static warnings and errors before commiting
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
args: ["--ignore=E501,W503"] # ignore lines too long