Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 300d9e5b authored by Christophe Chaudier's avatar Christophe Chaudier :rocket:
Browse files

ci: add Ansible galaxy linter to have a better Quality Score

parent 6a4cbe1c
No related branches found
No related tags found
1 merge request!21Resolve "ci: add more lint"
This commit is part of merge request !21. Comments created here will be created in the context of that merge request.
.gitignore 0 → 100644
# Vault password file
.vault_pass
# Ansible
.ansible/
*.retry
.roles_requirements/
.lint_rules/
# Terraform
.terraform/
terraform.tfstate.d/
*.tfstate
*.tfstate.backup
terraform.tfvars
env.vault
env.d/
terraform/create_state_bucket/terraform.tf
# Logs
*.log
*.history
......@@ -32,3 +32,31 @@ include:
ansible-syntax-check:
rules:
- when: never
# For Ansible Galaxy Scoring
# https://galaxy.ansible.com/docs/contributing/content_scoring.html
yaml-lint:
image:
name: cytopia/yamllint:1.26
entrypoint: ["/bin/ash", "-c"]
stage: lint
before_script:
- yamllint --version
script:
- ls **/*.yml
- yamllint -c .yamllint.yml -f colored .
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
changes:
- "**/*.yml"
galaxy-lint:
extends: ansible-lint
before_script:
- ansible-lint --version
script:
- ansible-lint **/*.yml
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
changes:
- "**/*.yml"
.yamllint.yml 0 → 100644
---
# https://github.com/ansible/galaxy/blob/devel/galaxy/importer/linters/yamllint.yaml
# Based on ansible-lint config
extends: default
rules:
braces: {max-spaces-inside: 1, level: error}
brackets: {max-spaces-inside: 1, level: error}
colons: {max-spaces-after: -1, level: error}
commas: {max-spaces-after: -1, level: error}
comments: disable
comments-indentation: disable
document-start: disable
empty-lines: {max: 3, level: error}
hyphens: {level: error}
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines: {type: unix}
trailing-spaces: disable
truthy: disable
Pipfile 0 → 100644
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
ansible = "==4"
ansible-lint = "==5.4.0"
yamllint = "==1.26"
[requires]
python_version = "3.8"
[dev-packages]
Pipfile.lock 0 → 100644
+ 356
0
View file @ 300d9e5b
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment