mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Add pre commit config
This commit is contained in:
parent
d37ef318b1
commit
a165c16553
6 changed files with 38 additions and 12 deletions
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -7,4 +7,3 @@ Remove this section if not relevant
|
|||
|
||||
### New Behavior
|
||||
Remove this section if not relevant
|
||||
|
||||
|
|
1
.github/stale.yml
vendored
1
.github/stale.yml
vendored
|
@ -30,4 +30,3 @@ closeComment: false
|
|||
|
||||
# Limit to only `issues` or `pulls`
|
||||
only: issues
|
||||
|
||||
|
|
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -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
2
.github/workflows/templates/generate.py
vendored
Normal file → Executable 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
28
.pre-commit-config.yaml
Normal 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
|
Loading…
Add table
Reference in a new issue