Skip to content

Commit

Permalink
ci: pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
auricom committed Dec 2, 2024
1 parent 0fcbec5 commit b3c4c5e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
use_default_rules: true
exclude_paths:
- '**/*.sops.yml'
- .github/
skip_list:
- galaxy[no-changelog]
- yaml[indentation]
- yaml[line-length]
# Allow Jinja templating inside task and play names
- name[template]
warn_list:
- command-instead-of-module
- command-instead-of-shell
- unnamed-task
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: forbid-tabs
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-crlf
- id: remove-tabs
- repo: https://github.com/sirosen/fix-smartquotes
rev: 0.2.0
hooks:
- id: fix-smartquotes
- repo: https://github.com/onedr0p/sops-pre-commit
rev: v2.1.1
hooks:
- id: forbid-secrets
- repo: https://github.com/ansible-community/ansible-lint
rev: v24.10.0
hooks:
- id: ansible-lint
entry: python3 -m ansiblelint -v --force-color
language: python
files: ^ansible_collections/.*\.(?:yaml|yml)$
# do not pass files to ansible-lint, see:
# https://github.com/ansible/ansible-lint/issues/611
pass_filenames: false
args:
- --config-file=./.ansible-lint

0 comments on commit b3c4c5e

Please sign in to comment.