Pre commit fixes (#167)

* chore(dependencies): updated kube-vip to 0.5.6

* fix(pre-commit): pin to hash

* fix(pre-commit): added more hooks and fixed lint

* fix(pre-commit): added pre-commit hook so we don't have to run it manually

* fix(pre-commit): Added docs to readme

* fix(pre-commit): added texthooks

* fix(pre-commit): pin to hash

* fix(pre-commit): added mor hooks and fixed lint

* fix(lint): Fixing quotes

* fix(ci): only run test if linting passes

* fix(ci): convert to reusable workflows

* fix(pr template): Reorder steps
This commit is contained in:
Techno Tim 2022-11-13 22:42:49 -06:00 committed by GitHub
parent 88d679ecb6
commit 17a74b66c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 58 additions and 29 deletions

View File

@ -11,5 +11,5 @@
- [ ] Ran `site.yml` playbook - [ ] Ran `site.yml` playbook
- [ ] Ran `reset.yml` playbook - [ ] Ran `reset.yml` playbook
- [ ] Did not add any unnecessary changes - [ ] Did not add any unnecessary changes
- [ ] 🚀
- [ ] Ran pre-commit install at least once before committing - [ ] Ran pre-commit install at least once before committing
- [ ] 🚀

15
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,15 @@
---
name: "CI"
on:
pull_request:
push:
branches:
- master
paths-ignore:
- '**/README.md'
jobs:
lint:
uses: ./.github/workflows/lint.yml
test:
uses: ./.github/workflows/test.yml
needs: [lint]

View File

@ -1,12 +1,7 @@
--- ---
name: Linting name: Linting
on: on:
pull_request: workflow_call:
push:
branches:
- master
paths-ignore:
- '**/README.md'
jobs: jobs:
pre-commit-ci: pre-commit-ci:
name: Pre-Commit name: Pre-Commit

View File

@ -1,17 +1,11 @@
--- ---
name: Test name: Test
on: on:
pull_request: workflow_call:
push:
branches:
- master
paths-ignore:
- '**/README.md'
jobs: jobs:
molecule: molecule:
name: Molecule name: Molecule
runs-on: macos-12 runs-on: macos-12
strategy: strategy:
matrix: matrix:
scenario: scenario:

View File

@ -1,21 +1,35 @@
--- ---
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: 3298ddab3c13dd77d6ce1fc0baf97691430d84b0 # v4.3.0
hooks: hooks:
- id: requirements-txt-fixer - id: requirements-txt-fixer
- id: sort-simple-yaml - id: sort-simple-yaml
- id: detect-private-key - id: detect-private-key
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/adrienverge/yamllint.git - repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0 rev: 9cce2940414e9560ae4c8518ddaee2ac1863a4d2 # v1.28.0
hooks: hooks:
- id: yamllint - id: yamllint
args: [-c=.yamllint] args: [-c=.yamllint]
- repo: https://github.com/ansible-community/ansible-lint.git - repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.8.2 rev: a058554b9bcf88f12ad09ab9fb93b267a214368f # v6.8.6
hooks: hooks:
- id: ansible-lint - id: ansible-lint
- repo: https://github.com/shellcheck-py/shellcheck-py - repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4 rev: 4c7c3dd7161ef39e984cb295e93a968236dc8e8a # v0.8.0.4
hooks: hooks:
- id: shellcheck - id: shellcheck
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: 04618e68aa2380828a36a23ff5f65a06ae8f59b9 # v1.3.1
hooks:
- id: remove-crlf
- id: remove-tabs
- repo: https://github.com/sirosen/texthooks
rev: 30d9af95631de0d7cff4e282bde9160d38bb0359 # 0.4.0
hooks:
- id: fix-smartquotes

View File

@ -112,6 +112,10 @@ It is run automatically in CI, but you can also run the tests locally.
This might be helpful for quick feedback in a few cases. This might be helpful for quick feedback in a few cases.
You can find more information about it [here](molecule/README.md). You can find more information about it [here](molecule/README.md).
### Pre-commit Hooks
This repo uses `pre-commit` and `pre-commit-hooks` to lint and fix common style and syntax errors. Be sure to install python packages and then run `pre-commit install`. For more information, see [pre-commit](https://pre-commit.com/)
## Thanks 🤝 ## Thanks 🤝
This repo is really standing on the shoulders of giants. Thank you to all those who have contributed and thanks to these repos for code and ideas: This repo is really standing on the shoulders of giants. Thank you to all those who have contributed and thanks to these repos for code and ideas:

View File

@ -7,5 +7,6 @@ molecule-vagrant>=1.0.0
molecule>=4.0.3 molecule>=4.0.3
netaddr>=0.8.0 netaddr>=0.8.0
pre-commit>=2.20.0 pre-commit>=2.20.0
pre-commit-hooks>=1.3.1
pyyaml>=6.0 pyyaml>=6.0
yamllint>=1.28.0 yamllint>=1.28.0

View File

@ -128,6 +128,8 @@ pluggy==1.0.0
# via molecule # via molecule
pre-commit==2.20.0 pre-commit==2.20.0
# via -r requirements.in # via -r requirements.in
pre-commit-hooks==4.3.0
# via -r requirements.in
pyasn1==0.4.8 pyasn1==0.4.8
# via # via
# pyasn1-modules # pyasn1-modules
@ -179,7 +181,9 @@ rich==12.6.0
rsa==4.9 rsa==4.9
# via google-auth # via google-auth
ruamel-yaml==0.17.21 ruamel-yaml==0.17.21
# via ansible-lint # via
# ansible-lint
# pre-commit-hooks
ruamel-yaml-clib==0.2.7 ruamel-yaml-clib==0.2.7
# via ruamel-yaml # via ruamel-yaml
selinux==0.2.1 selinux==0.2.1
@ -196,7 +200,9 @@ text-unidecode==1.3
toml==0.10.2 toml==0.10.2
# via pre-commit # via pre-commit
tomli==2.0.1 tomli==2.0.1
# via black # via
# black
# pre-commit-hooks
typing-extensions==4.4.0 typing-extensions==4.4.0
# via # via
# black # black

View File

@ -77,7 +77,7 @@ spec:
aggregationLength: aggregationLength:
default: 32 default: 32
description: The aggregation-length advertisement option lets description: The aggregation-length advertisement option lets
you “roll up” the /32s into a larger prefix. you "roll up" the /32s into a larger prefix.
format: int32 format: int32
minimum: 1 minimum: 1
type: integer type: integer
@ -167,7 +167,7 @@ spec:
aggregationLength: aggregationLength:
default: 32 default: 32
description: The aggregation-length advertisement option lets description: The aggregation-length advertisement option lets
you “roll up” the /32s into a larger prefix. you "roll up" the /32s into a larger prefix.
format: int32 format: int32
minimum: 1 minimum: 1
type: integer type: integer
@ -359,7 +359,7 @@ spec:
aggregationLength: aggregationLength:
default: 32 default: 32
description: The aggregation-length advertisement option lets you description: The aggregation-length advertisement option lets you
“roll up” the /32s into a larger prefix. Defaults to 32. Works for "roll up" the /32s into a larger prefix. Defaults to 32. Works for
IPv4 addresses. IPv4 addresses.
format: int32 format: int32
minimum: 1 minimum: 1
@ -367,7 +367,7 @@ spec:
aggregationLengthV6: aggregationLengthV6:
default: 128 default: 128
description: The aggregation-length advertisement option lets you description: The aggregation-length advertisement option lets you
“roll up” the /128s into a larger prefix. Defaults to 128. Works "roll up" the /128s into a larger prefix. Defaults to 128. Works
for IPv6 addresses. for IPv6 addresses.
format: int32 format: int32
type: integer type: integer