Skip to content

Commit 65500c7

Browse files
authored
Merge pull request #12 from seven-beep/linter_update
Linter update
2 parents 2d771fd + b3acdc8 commit 65500c7

File tree

6 files changed

+110
-16
lines changed

6 files changed

+110
-16
lines changed

.ansible-lint

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# Configuration file for ansible-lint
3+
4+
# Ignore these paths during auto-detection
5+
exclude_paths:
6+
- '.github'
7+
8+
# Ref: https://github.com/ansible-community/ansible-lint/blob/main/.ansible-lint#L41-L49
9+
enable_list:
10+
- 'fqcn-builtins'
11+
12+
# List of rules currently ignored in DebOps repository
13+
skip_list:
14+
# This check warns that a 'run_once' keyword will not work correctly on task
15+
# level in playbooks with "free" strategy, but ansible-lint doesn't take the
16+
# strategy of a given play into account, so the check is moot. A solution is
17+
# to ignore the check on the task level.
18+
# Ref: https://github.com/ansible/ansible-lint/issues/2815
19+
#
20+
# This tag is not correctly detected on the task level using "noqa" comment,
21+
# so instead it's ignored globally for now.
22+
- 'run-once[task]'

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.4.0
4+
rev: v4.6.0
55
hooks:
66
- id: check-yaml
77
- id: end-of-file-fixer
@@ -24,11 +24,7 @@ repos:
2424
- id: codespell
2525
args: [-I, .codespellignore]
2626
- repo: https://github.com/ansible-community/ansible-lint.git
27-
rev: v6.14.2
27+
rev: v24
2828
hooks:
2929
- id: ansible-lint
3030
files: \.(yaml|yml)$
31-
- repo: https://github.com/ansible-community/ansible-lint.git
32-
rev: v6.3.0
33-
hooks:
34-
- id: ansible-lint

.yamllint.yaml

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,97 @@
11
---
2+
# -*- mode: yaml -*-
3+
# vim:ts=2:sw=2:ai:si:syntax=yaml
4+
#
5+
# Copyright (C) 2017 Maciej Delmanowski <drybjed@gmail.com>
6+
# Copyright (C) 2017 DebOps <https://debops.org/>
7+
# Copyright (C) 2024 seven-beep <ebn@entreparentheses.xyz>
8+
# SPDX-License-Identifier: GPL-3.0-or-later
9+
#
10+
# yamllint configuration directives
11+
#
12+
# Project Homepage: https://github.com/adrienverge/yamllint
13+
#
14+
# How to override rules in files:
15+
# https://yamllint.readthedocs.io/en/latest/disable_with_comments.html
16+
217
extends: default
318

19+
# Rules documentation: https://yamllint.readthedocs.io/en/latest/rules.html
420
rules:
521
truthy:
622
allowed-values: ["yes", "no", "True", "false", "False", "true"]
23+
724
line-length:
825
max: 200
926
level: warning
10-
indentation: disable
11-
braces: disable
27+
28+
braces:
29+
# Defaults
30+
# min-spaces-inside: 0
31+
# max-spaces-inside: 0
32+
33+
# Keep 0 min-spaces to not error on empty {} collection definitions
34+
min-spaces-inside: 0
35+
36+
# Allow one space inside braces to improve code readability
37+
max-spaces-inside: 1
38+
39+
brackets:
40+
# Defaults
41+
# min-spaces-inside: 0
42+
# max-spaces-inside: 0
43+
44+
# Keep 0 min-spaces to not error on empty [] collection definitions
45+
min-spaces-inside: 0
46+
47+
# Allow one space inside braces to improve code readability
48+
max-spaces-inside: 1
49+
50+
colons:
51+
# Defaults
52+
# min-spaces-before: 0
53+
# max-spaces-after: 1
54+
55+
# Allow multiple spaces after a colon to allow indentation of YAML
56+
# dictionary values
57+
max-spaces-after: -1
58+
59+
commas:
60+
# Defaults
61+
# max-spaces-after: 1
62+
63+
# Allow multiple spaces after a comma to allow indentation of YAML
64+
# dictionary values
65+
max-spaces-after: -1
66+
1267
comments:
13-
require-starting-space: true
14-
ignore-shebangs: true
68+
# Defaults
69+
# level: warning
70+
# require-starting-space: True
1571
min-spaces-from-content: 1
1672

73+
# Disable to allow for code comment blocks and #!/usr/bin/ansible-playbook
74+
require-starting-space: False
75+
76+
# Disable comment indentation checks due to copious amounts of long lines in
77+
# the code which would require a code style change to resolve
78+
comments-indentation: False
79+
80+
indentation:
81+
# Defaults
82+
# spaces: consistent
83+
# indent-sequences: True
84+
# check-multi-line-strings: False
85+
86+
# Require 2 space indentation
87+
spaces: 2
88+
89+
# Require consistent indentation within a file, either indented or not
90+
indent-sequences: consistent
91+
92+
octal-values:
93+
forbid-implicit-octal: True
94+
1795
ignore:
1896
- .git
1997
- .github

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ pre-commit:
44
echo "yay pre-commit"
55
pre-commit install
66
pre-commit run --all-files
7-
8-
lint:
9-
ansible-lint -p deploy.yml

molecule/default/requirements.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
collections:
44
- ansible.posix
5+
- community.docker

tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
dest: "{{ teleport_config_path }}"
8383
owner: "root"
8484
group: "root"
85-
mode: 0600
85+
mode: "0600"
8686
backup: "{{ backup_teleport_config }}"
8787
when: teleport_template_config
8888
notify:
@@ -94,7 +94,7 @@
9494
dest: "/etc/systemd/system"
9595
owner: "root"
9696
group: "root"
97-
mode: 0755
97+
mode: "0755"
9898
state: directory
9999

100100
- name: Create teleport service
@@ -104,7 +104,7 @@
104104
dest: "/etc/systemd/system/teleport.service"
105105
owner: "root"
106106
group: "root"
107-
mode: 0644
107+
mode: "0644"
108108
notify: Reload_Teleport
109109
when: teleport_control_systemd
110110

0 commit comments

Comments
 (0)