ci(pre-commit): add pre-commit configuration

This commit is contained in:
Wallun 2021-11-28 13:22:33 +01:00
commit 8f9c4f3938
Signed by: wallun
GPG Key ID: 71D17013D836735B
3 changed files with 121 additions and 0 deletions

25
.gitlint Normal file
View File

@ -0,0 +1,25 @@
[general]
verbosity=3
ignore-merge-commits=false
ignore-revert-commits=false
ignore-fixup-commits=false
ignore-squash-commits=false
ignore-stdin=true
staged=false
debug=false
contrib=contrib-title-conventional-commits
ignore=T5,title-must-not-contain-word,B6,body-is-missing
[title-max-length]
line-length=50
[title-min-length]
min-length=10
[body-max-line-length]
line-length=72
[contrib-title-conventional-commits]
types = build,chore,ci,docs,fix,feat,perf,refactor,revert,style,test

28
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,28 @@
---
default_stages: [ commit, manual ]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: no-commit-to-branch
args: [ --branch, main ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-byte-order-marker
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v5.2.1
hooks:
- name: Run ansible-lint
id: ansible-lint
- repo: https://github.com/jorisroovers/gitlint
rev: v0.16.0
hooks:
- name: Run gitlint
id: gitlint

68
.yamllint Normal file
View File

@ -0,0 +1,68 @@
---
rules:
braces:
forbid: false
min-spaces-inside: 1
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
brackets:
forbid: false
min-spaces-inside: 1
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
require-starting-space: true
ignore-shebangs: true
min-spaces-from-content: 2
comments-indentation: {}
document-end:
present: false
level: error
ignore: |
vault.yaml
document-start:
present: true
level: error
ignore: |
vault.yaml
empty-lines:
max: 2
max-start: 0
max-end: 0
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
hyphens:
max-spaces-after: 1
indentation:
spaces: 2
indent-sequences: true
check-multi-line-strings: false
key-duplicates: {}
line-length:
max: 80
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-lines:
type: unix
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
quoted-strings:
quote-type: any
required: only-when-needed
extra-required: []
extra-allowed: []
trailing-spaces: {}
truthy:
allowed-values: [ 'true', 'false' ]
check-keys: true