Add pre commit config

This commit is contained in:
Pedro Algarvio 2020-01-28 16:12:40 +00:00
parent d37ef318b1
commit a165c16553
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
6 changed files with 38 additions and 12 deletions

View file

@ -7,4 +7,3 @@ Remove this section if not relevant
### New Behavior
Remove this section if not relevant

1
.github/stale.yml vendored
View file

@ -30,4 +30,3 @@ closeComment: false
# Limit to only `issues` or `pulls`
only: issues

View file

@ -2807,5 +2807,3 @@ jobs:
if: always()
run: |
bundle exec kitchen destroy py3-git-2019-2-ubuntu-1804

2
.github/workflows/templates/generate.py vendored Normal file → Executable file
View file

@ -131,9 +131,11 @@ def generate_test_jobs():
with open('../main.yml', 'w') as wfh:
with open('main.yml') as rfh:
wfh.write(
'{}\n'.format(
rfh.read().format(
lint_job=lint_job,
test_jobs=test_jobs,
).strip()
)
)

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

@ -0,0 +1,28 @@
---
minimum_pre_commit_version: 1.15.2
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: trailing-whitespace # Trims trailing whitespace.
args: [--markdown-linebreak-ext=md]
- id: mixed-line-ending # Replaces or checks mixed line ending.
args: [--fix=lf]
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- repo: local
hooks:
- id: generate-actions-workflow
name: Generate Github Actions Workflow
entry: .github/workflows/templates/generate.py
pass_filenames: false
files: '.github/workflows/templates/.*'
language: script
- id: shellcheck
name: Run ShellCheck against bootstrap-salt.sh
entry: koalaman/shellcheck-alpine:v0.6.0 shellcheck -s sh -f tty
files: 'bootstrap-salt\.sh'
language: docker_image