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 `reset.yml` playbook
- [ ] Did not add any unnecessary changes
- [ ] 🚀
- [ ] 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
on:
pull_request:
push:
branches:
- master
paths-ignore:
- '**/README.md'
workflow_call:
jobs:
pre-commit-ci:
name: Pre-Commit

View File

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

View File

@ -1,21 +1,35 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: 3298ddab3c13dd77d6ce1fc0baf97691430d84b0 # v4.3.0
hooks:
- id: requirements-txt-fixer
- id: sort-simple-yaml
- 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
rev: v1.28.0
rev: 9cce2940414e9560ae4c8518ddaee2ac1863a4d2 # v1.28.0
hooks:
- id: yamllint
args: [-c=.yamllint]
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.8.2
rev: a058554b9bcf88f12ad09ab9fb93b267a214368f # v6.8.6
hooks:
- id: ansible-lint
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: 4c7c3dd7161ef39e984cb295e93a968236dc8e8a # v0.8.0.4
hooks:
- 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.
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 🤝
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
netaddr>=0.8.0
pre-commit>=2.20.0
pre-commit-hooks>=1.3.1
pyyaml>=6.0
yamllint>=1.28.0

View File

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

View File

@ -77,7 +77,7 @@ spec:
aggregationLength:
default: 32
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
minimum: 1
type: integer
@ -167,7 +167,7 @@ spec:
aggregationLength:
default: 32
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
minimum: 1
type: integer
@ -359,7 +359,7 @@ spec:
aggregationLength:
default: 32
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.
format: int32
minimum: 1
@ -367,7 +367,7 @@ spec:
aggregationLengthV6:
default: 128
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.
format: int32
type: integer