-
Notifications
You must be signed in to change notification settings - Fork 2
/
pre-commit-config.covidwa.yaml
127 lines (119 loc) · 4.05 KB
/
pre-commit-config.covidwa.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Python oriented pre-commit
#
# Note that the check-yaml argument does not work
#
# so only single document in a yaml file is allowed
# tried dockerfilelint but too strict and disabling does not work
---
# python regex syntax for includsion
# https://www.w3schools.com/python/python_regex.asp
# files: ".py$"
# This is only for python and other files
exclude: "typescript|golang"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-builtin-literals
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-symlinks
- id: check-toml
- id: detect-aws-credentials
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/jumanjihouse/pre-commit-hooks
# temp fix for pre-commit breakage in shellcheck
# https://github.com/jumanjihouse/pre-commit-hooks/issues/82
rev: 2.1.5
hooks:
# as of Feb 2020, error with ruby 3.0
# https://github.com/jumanjihouse/pre-commit-hooks/issues/86
#- id: markdownlint
- id: shellcheck
# require shfmt be installed
- id: shfmt
# from dan this fails with a go error
#- repo: local
#hooks:
#- id: shfmt
#name: shfmt
#minimum_pre_commit_version: 2.4.0
#language: golang
#additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@v3.2.2]
#entry: shfmt
#args: [ -w ]
#types: [ shell ]
# covidwa does not have of these standards so comment out
# https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/
# https://github.com/pre-commit/mirrors-mypy
#- repo: https://github.com/pre-commit/mirrors-mypy
# #rev: 'v0.782' will not run as of Feb 2020
# rev: v0.812
# hooks:
# - id: mypy
#- repo: https://github.com/pycqa/flake8
# rev: 3.8.4
# hooks:
# - id: flake8
# covidwa not using pydocstyle
#- repo: https://github.com/pycqa/pydocstyle
# rev: 5.1.1
# hooks:
# - id: pydocstyle
## puts the isort.cfg at the root we do not want that
## https://pypi.org/project/seed-isort-config/
## - repo: https://github.com/asottile/seed-isort-config
## rev: v2.2.0
## hooks:
## # remember this will place things at the root of the repo
## # but running in lint locally places it in the current directory
## - id: seed-isort-config
## does not respect the local arguments
## - repo: https://github.com/timothycrosley/isort
## rev: 5.2.0
## hooks:
## - id: isort
## args: [--profile=black, -w 79]
## https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/
#- repo: https://github.com/psf/black
# rev: 20.8b1
# hooks:
# - id: black
# language_version: python3.9
# args: [-l 79]
# check shell scripts you check in
- repo: git://github.com/detailyang/pre-commit-shell
rev: v1.0.6
hooks:
- id: shell-lint
args: [--format=json]
# https://stackoverflow.com/questions/64011304/running-pytest-as-a-pre-commit-hook-no-such-file-or-directory-issue
# note this means pre-commit should run in your venv or conda
- repo: local
hooks:
# check the current working directory run by calling the id
#- id: testing
# # the friendly name
# name: Test Local
# # this has to be a single executable so use bash -c to run scripts
# entry: bash -c "cd python && pwd"
#language: system
#verbose: true
#pass_filenames: false
#always_run: true
- id: pytest
name: Python Linting
entry: bash -c "cd python && pytest --timeout=600 --ignore=lambda_stage --doctest-modules --cov=."
#args: [--timeout=600, --ignore=lambda_stage, --doctest-modules, --cov=.]
language: system
pass_filenames: false
always_run: true
verbose: true