Start the move to pre-commit

This commit is contained in:
David Stephens 2022-08-24 09:27:24 +01:00
parent 38a179505f
commit 40bda92546
9 changed files with 24 additions and 9 deletions

View file

@ -35,6 +35,3 @@ jobs:
- name: Lint docs - name: Lint docs
uses: articulate/actions-markdownlint@v1 uses: articulate/actions-markdownlint@v1
with:
config: markdownlint-config.json
files: "docs/**/*.md"

1
.markdownlintignore Normal file
View file

@ -0,0 +1 @@
.github

14
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,14 @@
---
repos:
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.5.0
hooks:
- id: ansible-lint
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.27.1
hooks:
- id: yamllint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
hooks:
- id: markdownlint

4
.vscode/tasks.json vendored
View file

@ -22,9 +22,9 @@
} }
}, },
{ {
"label": "Run ansible-lint", "label": "Run pre-commit checks",
"type": "shell", "type": "shell",
"command": "docker run --rm -it -v $(pwd):/code pipelinecomponents/ansible-lint:latest nas.yml", "command": "pre-commit run --all-files",
"group": "test" "group": "test"
}, },
{ {

View file

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

View file

@ -6,7 +6,7 @@ Before running anything, check out the playbook and understand what it does. Run
💀 💀 💀 💀 💀 💀
## Read This First... ## Read This First
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. 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.

1
requirements-dev.txt Normal file
View file

@ -0,0 +1 @@
pre-commit