Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 2
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://flake8.pycqa.org/en/latest/user/configuration.html#configuration-locations
# +
# https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length
[flake8]
# black wraps at 88
max-line-length = 90
extend-ignore = E203
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# make github collapse diffs for generated files within PRs
# https://github.com/github/linguist#generated-code

# make github know about vendored code
# https://github.com/github/linguist#vendored-code
**/vendor/** linguist-vendored

# OWNERS files are YAML
OWNERS linguist-language=Yaml
**/OWNERS linguist-language=Yaml
OWNERS_ALIASES linguist-language=Yaml
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 2
updates:
- package-ecosystem: pip
directory: /ci
schedule:
interval: daily
- package-ecosystem: pip
directory: /python
schedule:
interval: daily
80 changes: 80 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

# ignore:
# vendor'd code (that has vendor in its path)
exclude: vendor

repos:
- repo: https://github.com/adrienverge/yamllint
rev: v1.25.0
hooks:
- id: yamllint
args:
- --format=parsable
- --strict

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.0 # or higher tag
hooks:
- id: yamlfmt
args:
- --mapping=2
- --sequence=4
- --offset=2
- --width=1200 # match .yamllint.yaml; we don't care about line-length.
exclude: repocop.yaml

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: pretty-format-json
args:
- --autofix
- id: trailing-whitespace

- repo: https://github.com/syntaqx/git-hooks
rev: v0.0.16
hooks:
- id: forbid-binary
# Exclude png and server.zip forbid, we can check these in.
exclude: ^.+\.(png|server\.zip)$
# See checks in shellcheck wiki: https://github.com/koalaman/shellcheck/wiki/
- id: shellcheck
- id: shfmt
# do not use these args (yet):
# -s, simplify code
# -mn, minify to reduce its size
args:
- -w # autofix in place
- -d # show diff
- -i=2 # indent 2 spaces

- repo: https://github.com/PyCQA/pylint
rev: pylint-2.6.0
hooks:
- id: pylint

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args:
- --skip-string-normalization
18 changes: 18 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
extends: default

yaml-files:
- .toolsharerc
- .yamllint.yaml
- '*.yaml'
- '*.yml'
- OWNERS_ALIASES
- OWNERS

rules:
document-start:
level: error
line-length:
max: 1200
level: warning
1 change: 1 addition & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pre-commit==2.7.1
pytest==4.5.0
pylint==2.3.1