Skip to content

Commit 40bda92

Browse files
committed
Start the move to pre-commit
1 parent 38a1795 commit 40bda92

9 files changed

+24
-9
lines changed

.github/workflows/ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,3 @@ jobs:
3535
3636
- name: Lint docs
3737
uses: articulate/actions-markdownlint@v1
38-
with:
39-
config: markdownlint-config.json
40-
files: "docs/**/*.md"
File renamed without changes.

.markdownlintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github

.pre-commit-config.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
repos:
3+
- repo: https://github.com/ansible-community/ansible-lint.git
4+
rev: v6.5.0
5+
hooks:
6+
- id: ansible-lint
7+
- repo: https://github.com/adrienverge/yamllint.git
8+
rev: v1.27.1
9+
hooks:
10+
- id: yamllint
11+
- repo: https://github.com/igorshubovych/markdownlint-cli
12+
rev: v0.32.2
13+
hooks:
14+
- id: markdownlint

.vscode/tasks.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
}
2323
},
2424
{
25-
"label": "Run ansible-lint",
25+
"label": "Run pre-commit checks",
2626
"type": "shell",
27-
"command": "docker run --rm -it -v $(pwd):/code pipelinecomponents/ansible-lint:latest nas.yml",
27+
"command": "pre-commit run --all-files",
2828
"group": "test"
2929
},
3030
{
@@ -40,4 +40,4 @@
4040
"group": "build"
4141
}
4242
]
43-
}
43+
}

CONTRIBUTING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Contributing to Ansible-NAS is easy! Add your functionality, then raise a pull request on GitHub. A few things to bear in mind:
44

5-
* **Restrict pull requests to one piece of functionality or bugfix at a time.**
5+
* **Restrict pull requests to one piece of functionality or bugfix at a time.**
66
* Test your new functionality or bugfix using the included `tests/test-vagrant.sh` script to spin up a test VM.
77
* Run `ansible-lint` against the playbook before committing. (There is a VSCode task set up to run the right command for you)
88
* Ensure that your PR only changes files required for your functionality or bugfix. Random changes in other files will result in your PR being rejected
@@ -26,3 +26,5 @@ If you're adding a new application:
2626

2727
* Development of Ansible-NAS is carried out in [Visual Studio Code](https://code.visualstudio.com/) - you'll get some nice
2828
recommended extensions and task setups if you do the same.
29+
* You'll need a working Python 3 environment, and [pre-commit](https://pre-commit.com) installed - `pip install pre-commit`.
30+

docs/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Before running anything, check out the playbook and understand what it does. Run
66

77
💀 💀 💀
88

9-
## Read This First...
9+
## Read This First
1010

1111
Calling this page "installation" is a bit of a misnomer. Ansible-NAS isn't *installed* per-se, it is a bunch of automation that installs other software onto your server. Ansible-NAS relies heavily on Ansible's [variable prescedence](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable) to do its job. Ansible-NAS defines its installable software with roles with (mostly) sane defaults, these can then be enabled and the settings overridden in your inventory `nas.yml` file.
1212

inventories/sample/inventory

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# ansible-nas ansible_connection=local ansible_host=localhost
1616

1717
[nas]
18-
ansible-nas
18+
ansible-nas

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit

0 commit comments

Comments
 (0)