Skip to content

Commit 6be1a58

Browse files
authored
Add a ton of pre-commit checks (#84)
* Add prettier * Add cspell * Add passing hooks * Add codespell * Add yamllint * Add pylint
1 parent 2756110 commit 6be1a58

File tree

13 files changed

+286
-155
lines changed

13 files changed

+286
-155
lines changed

.config/dictionary.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Ansible jargon
2+
cliconf
3+
devel
4+
fqcn
5+
hostvars
6+
httpapi
7+
netcommon
8+
netconf
9+
restconf
10+
# Resource modules and filter plugins
11+
acls
12+
cidr
13+
hwaddr
14+
ipaddr
15+
ipmath
16+
ipsubnet
17+
ipwrap
18+
lacp
19+
linkagg
20+
macaddr
21+
nthhost
22+
ospfv
23+
slaac
24+
# Python packages
25+
argcomplete
26+
redbaron
27+
ruamel
28+
textfsm
29+
# Jijna / RST / HTML directives
30+
colspan
31+
darkgreen
32+
dictsort
33+
endfor
34+
htmlify
35+
HORIZONTALLINE
36+
larr
37+
nbsp
38+
sameas
39+
seealso
40+
tojson
41+
# Misc
42+
bthornto
43+
levelname
44+
suboptions

.pre-commit-config.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,65 @@ repos:
88
- "--fix"
99
- "--exit-non-zero-on-fix"
1010

11+
- repo: https://github.com/pre-commit/mirrors-prettier
12+
rev: "v3.0.0-alpha.6"
13+
hooks:
14+
- id: prettier
15+
additional_dependencies:
16+
- prettier
17+
- prettier-plugin-toml
18+
1119
- repo: https://github.com/psf/black
1220
rev: 23.3.0
1321
hooks:
1422
- id: black
1523

24+
- repo: https://github.com/streetsidesoftware/cspell-cli
25+
rev: v6.31.0
26+
hooks:
27+
- id: cspell
28+
name: Spell check with cspell
29+
30+
- repo: https://github.com/Lucas-C/pre-commit-hooks
31+
rev: v1.4.2
32+
hooks:
33+
- id: remove-tabs
34+
1635
- repo: https://github.com/pre-commit/pre-commit-hooks
1736
rev: v4.4.0
1837
hooks:
1938
- id: check-merge-conflict
2039
- id: check-symlinks
2140
- id: debug-statements
2241
- id: end-of-file-fixer
42+
- id: fix-byte-order-marker
2343
- id: no-commit-to-branch
2444
- id: trailing-whitespace
2545

46+
- repo: https://github.com/codespell-project/codespell
47+
rev: v2.2.4
48+
hooks:
49+
- id: codespell
50+
51+
- repo: https://github.com/adrienverge/yamllint
52+
rev: v1.30.0
53+
hooks:
54+
- id: yamllint
55+
args:
56+
- --strict
57+
types: [file, yaml]
58+
2659
- repo: https://github.com/terrencepreilly/darglint
2760
rev: v1.8.1
2861
hooks:
2962
- id: darglint
63+
64+
- repo: https://github.com/pycqa/pylint
65+
rev: v2.17.1
66+
hooks:
67+
- id: pylint
68+
additional_dependencies:
69+
- ansible-core
70+
- pyyaml
71+
- redbaron
72+
- ruamel.yaml

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Collection Prep Engine
22

3-
43
## INSTALLATION
54

65
```console
76
pip install .
87
```
98

109
## CONTENT UPDATER
10+
1111
```console
1212
collection_prep_update -c arista.eos -p ./
1313
```
@@ -17,15 +17,15 @@ INFO -------------------Processing ./arista.eos/plugins/modules/eos_lacp.py
1717
INFO Updated metadata in ./arista.eos/plugins/modules/eos_lacp.py
1818
INFO Updated documentation in ./arista.eos/plugins/modules/eos_lacp.py
1919
INFO Found a resource module
20-
INFO Setting short desciption to 'LACP resource module'
20+
INFO Setting short description to 'LACP resource module'
2121
INFO Updated examples in ./arista.eos/plugins/modules/eos_lacp.py
2222
INFO Wrote ./arista.eos/plugins/modules/eos_lacp.py
2323
INFO Running black against ./arista.eos/plugins/modules/eos_lacp.py
2424
INFO -------------------Processing ./arista.eos/plugins/modules/eos_static_routes.py
2525
INFO Updated metadata in ./arista.eos/plugins/modules/eos_static_routes.py
2626
INFO Updated documentation in ./arista.eos/plugins/modules/eos_static_routes.py
2727
INFO Found a resource module
28-
INFO Setting short desciption to 'Static routes resource module'
28+
INFO Setting short description to 'Static routes resource module'
2929
INFO Updated examples in ./arista.eos/plugins/modules/eos_static_routes.py
3030
INFO Wrote ./arista.eos/plugins/modules/eos_static_routes.py
3131
INFO Running black against ./arista.eos/plugins/modules/eos_static_routes.py
@@ -43,12 +43,14 @@ This will generate an RST file for each plugin in the collection docs folder and
4343
This will also pull the requires_ansible information from the runtime.yml file and add an ansible compatibility section to the README.
4444

4545
For the ansible compatibility, ensure the collection README.md has the following in it:
46+
4647
```
4748
<!--start requires_ansible-->
4849
<!--end requires_ansible-->
4950
```
5051

5152
For the plugin table, ensure the collection README.md has the following in it:
53+
5254
```
5355
5456
<!--start collection content-->
@@ -65,8 +67,8 @@ INFO Setting github repository url to https://github.com/ansible-collection
6567
INFO Linking collection to user collection directory
6668
INFO This is required for the Ansible fragment loader to find doc fragments
6769
INFO Attempting to remove existing /home/bthornto/.ansible/collections/ansible_collections/ansible/netcommon
68-
INFO Deleteing: /home/bthornto/.ansible/collections/ansible_collections/ansible/netcommon
69-
INFO Creating namepsace directory /home/bthornto/.ansible/collections/ansible_collections/ansible
70+
INFO Deleting: /home/bthornto/.ansible/collections/ansible_collections/ansible/netcommon
71+
INFO Creating namespace directory /home/bthornto/.ansible/collections/ansible_collections/ansible
7072
INFO Linking collection /home/bthornto/github/collection_update/ansible.netcommon -> /home/bthornto/.ansible/collections/ansible_collections/ansible/netcommon
7173
INFO Purging content from directory /home/bthornto/github/collection_update/ansible.netcommon/docs
7274
INFO Making docs directory /home/bthornto/github/collection_update/ansible.netcommon/docs
@@ -119,9 +121,11 @@ INFO README.md updated
119121
## meta/runtime.yml GENERATOR
120122

121123
This is intended to operate against the repository clone.
124+
122125
```console
123126
collection_prep_runtime -c arista.eos -p ./
124127
```
128+
125129
```console
126130
INFO -------------------Processing runtime.yml for module eos_acl_interfaces
127131
INFO -------------------Processing runtime.yml for module eos_acls

0 commit comments

Comments
 (0)