forked from stravalib/stravalib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
59 lines (54 loc) · 1.99 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
# pre-commit is a tool that you run locally
# to perform a predefined set of tasks manually and/or
# automatically before git commits are made.
# Here we are using pre-commit with the precommit.ci bot to implement
# code fixes automagically in pr's. You will still want to install pre-commit
# to run locally
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
# To run on a pr, add a comment with the text "pre-commit.ci run"
# Common tasks
#
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
ci:
autofix_prs: false
skip: [flake8]
autofix_commit_msg: |
'[pre-commit.ci 🤖] Apply code format tools to PR'
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
# Update hook versions every quarter (so we don't get hit with weekly update pr's)
autoupdate_schedule: weekly
autoupdate_branch: ""
default_stages: [commit]
repos:
# Misc commit checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
hooks:
# Autoformat: Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Lint: Check for files with names that would conflict on a
# case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
- id: trailing-whitespace
# Linting: Python code (see the file .flake8)
- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
hooks:
- id: flake8
# Black for auto code formatting
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
entry: bash -c 'black "$@"; git add -u' --
language_version: python3.10
args: ["--line-length=79"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
entry: bash -c 'isort "$@"; git add -u' --
files: \.py$
args: ["--profile", "black", "--filter-files"]