generated from the-liberated-edge/wikijs
i-3 Introduce a new task to automate linting from command line #14
11
README.md
11
README.md
@ -170,15 +170,22 @@ cd test_linux_containers
|
|||||||
Lint all YAML documents.
|
Lint all YAML documents.
|
||||||
|
|
||||||
```
|
```
|
||||||
yamllint .
|
task lint-yml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that this task will trigger formatting of all YAML documents
|
||||||
|
in the repository as a prerequisite to linting.
|
||||||
|
|
||||||
Use `ansible-lint` to verify good practices relevant to Ansible.
|
Use `ansible-lint` to verify good practices relevant to Ansible.
|
||||||
|
|
||||||
```
|
```
|
||||||
LC_ALL=C.UTF-8 ansible-lint .
|
task lint-ansible
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that this task depends on `lint-yml`, which means that linting YML will
|
||||||
|
happen before linting the Ansible code base. Linting the Ansible code base will
|
||||||
|
only be triggered when linting all YML documents in the repository has been successful.
|
||||||
|
|
||||||
## YAML code formatting
|
## YAML code formatting
|
||||||
|
|
||||||
Navigate to the root folder of the local copy of this git repository.
|
Navigate to the root folder of the local copy of this git repository.
|
||||||
|
|||||||
@ -3,3 +3,9 @@ version: '3'
|
|||||||
tasks:
|
tasks:
|
||||||
format-yml:
|
format-yml:
|
||||||
cmds: [yamlfix .]
|
cmds: [yamlfix .]
|
||||||
|
lint-yml:
|
||||||
|
deps: [format-yml]
|
||||||
|
cmds: [yamllint .]
|
||||||
|
lint-ansible:
|
||||||
|
deps: [lint-yml]
|
||||||
|
cmds: [LC_ALL=C.UTF-8 ansible-lint .]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user