Skip to content

Commit b6b9815

Browse files
author
Peter Mounce
authored
Workflow improvements (#194)
1 parent b3d41e7 commit b6b9815

File tree

7 files changed

+138
-0
lines changed

7 files changed

+138
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_size = 2

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://flake8.pycqa.org/en/latest/user/configuration.html#configuration-locations
2+
# +
3+
# https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length
4+
[flake8]
5+
# black wraps at 88
6+
max-line-length = 90
7+
extend-ignore = E203

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# make github collapse diffs for generated files within PRs
2+
# https://github.com/github/linguist#generated-code
3+
4+
# make github know about vendored code
5+
# https://github.com/github/linguist#vendored-code
6+
**/vendor/** linguist-vendored
7+
8+
# OWNERS files are YAML
9+
OWNERS linguist-language=Yaml
10+
**/OWNERS linguist-language=Yaml
11+
OWNERS_ALIASES linguist-language=Yaml

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: pip
5+
directory: /ci
6+
schedule:
7+
interval: daily
8+
- package-ecosystem: pip
9+
directory: /python
10+
schedule:
11+
interval: daily

.pre-commit-config.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
5+
# ignore:
6+
# vendor'd code (that has vendor in its path)
7+
exclude: vendor
8+
9+
repos:
10+
- repo: https://github.com/adrienverge/yamllint
11+
rev: v1.25.0
12+
hooks:
13+
- id: yamllint
14+
args:
15+
- --format=parsable
16+
- --strict
17+
18+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
19+
rev: 0.1.0 # or higher tag
20+
hooks:
21+
- id: yamlfmt
22+
args:
23+
- --mapping=2
24+
- --sequence=4
25+
- --offset=2
26+
- --width=1200 # match .yamllint.yaml; we don't care about line-length.
27+
exclude: repocop.yaml
28+
29+
- repo: https://github.com/pre-commit/pre-commit-hooks
30+
rev: v3.3.0
31+
hooks:
32+
- id: check-added-large-files
33+
- id: check-byte-order-marker
34+
- id: check-case-conflict
35+
- id: check-executables-have-shebangs
36+
- id: check-json
37+
- id: check-merge-conflict
38+
- id: check-symlinks
39+
- id: detect-private-key
40+
- id: end-of-file-fixer
41+
- id: forbid-new-submodules
42+
- id: mixed-line-ending
43+
- id: pretty-format-json
44+
args:
45+
- --autofix
46+
- id: trailing-whitespace
47+
48+
- repo: https://github.com/syntaqx/git-hooks
49+
rev: v0.0.16
50+
hooks:
51+
- id: forbid-binary
52+
# Exclude png and server.zip forbid, we can check these in.
53+
exclude: ^.+\.(png|server\.zip)$
54+
# See checks in shellcheck wiki: https://github.com/koalaman/shellcheck/wiki/
55+
- id: shellcheck
56+
- id: shfmt
57+
# do not use these args (yet):
58+
# -s, simplify code
59+
# -mn, minify to reduce its size
60+
args:
61+
- -w # autofix in place
62+
- -d # show diff
63+
- -i=2 # indent 2 spaces
64+
65+
- repo: https://github.com/PyCQA/pylint
66+
rev: pylint-2.6.0
67+
hooks:
68+
- id: pylint
69+
70+
- repo: https://gitlab.com/pycqa/flake8
71+
rev: 3.8.4
72+
hooks:
73+
- id: flake8
74+
75+
- repo: https://github.com/psf/black
76+
rev: 20.8b1
77+
hooks:
78+
- id: black
79+
args:
80+
- --skip-string-normalization

.yamllint.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
3+
extends: default
4+
5+
yaml-files:
6+
- .toolsharerc
7+
- .yamllint.yaml
8+
- '*.yaml'
9+
- '*.yml'
10+
- OWNERS_ALIASES
11+
- OWNERS
12+
13+
rules:
14+
document-start:
15+
level: error
16+
line-length:
17+
max: 1200
18+
level: warning

ci/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
pre-commit==2.7.1
12
pytest==4.5.0
23
pylint==2.3.1

0 commit comments

Comments
 (0)