Skip to content

Commit 0b65434

Browse files
committed
Lint role BLD-5736
1 parent 10f510a commit 0b65434

10 files changed

+137
-29
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.yml]
14+
indent_style = space
15+
indent_size = 2

.github/workflows/common_ccdc_status_checks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This status check is updated on all repositories by the moan.py script
23
# in the github-repository-management repository.
34
# Changes in this file will be overwritten periodically.
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Lint
3+
4+
on: [pull_request]
5+
6+
jobs:
7+
lint:
8+
name: Linting
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup Python
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.9
18+
architecture: x64
19+
20+
- name: Checkout
21+
uses: actions/checkout@main
22+
23+
- name: Install linters
24+
run: pip install ansible ansible-lint yamllint
25+
26+
- name: Run ansible-lint
27+
run: "ansible-lint ."
28+
29+
- name: Run yamllint
30+
run: "yamllint ."

.yamllint.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# -*- mode: yaml -*-
2+
# vim:ts=2:sw=2:ai:si:syntax=yaml
3+
#
4+
# yamllint configuration directives
5+
# Project Homepage: https://github.com/adrienverge/yamllint
6+
#
7+
# Overriding rules in files:
8+
# http://yamllint.readthedocs.io/en/latest/disable_with_comments.html
9+
---
10+
extends: default
11+
12+
# Rules documentation: http://yamllint.readthedocs.io/en/latest/rules.html
13+
rules:
14+
braces:
15+
# Defaults
16+
# min-spaces-inside: 0
17+
# max-spaces-inside: 0
18+
19+
# Keeping 0 min-spaces to not error on empty collection definitions
20+
min-spaces-inside: 0
21+
# Allowing one space inside braces to improve code readability
22+
max-spaces-inside: 1
23+
24+
brackets:
25+
# Defaults
26+
# min-spaces-inside: 0
27+
# max-spaces-inside: 0
28+
29+
# Keeping 0 min-spaces to not error on empty collection definitions
30+
min-spaces-inside: 0
31+
# Allowing one space inside braces to improve code readability
32+
max-spaces-inside: 1
33+
34+
comments:
35+
# Defaults
36+
# level: warning
37+
# require-starting-space: true
38+
39+
# Disabling to allow for code comment blocks and #!/usr/bin/ansible-playbook
40+
require-starting-space: false
41+
min-spaces-from-content: 1
42+
43+
indentation:
44+
# Defaults
45+
# spaces: consistent
46+
# indent-sequences: true
47+
# check-multi-line-strings: false
48+
49+
# Requiring 2 space indentation
50+
spaces: 2
51+
# Requiring consistent indentation within a file, either indented or not
52+
indent-sequences: consistent
53+
54+
# Disabling due to copious amounts of long lines in the code which would
55+
# require a code style change to resolve
56+
line-length:
57+
# Defaults
58+
max: 160
59+
60+
# Disabling due to become: true being used pervasively in roles
61+
truthy: disable

meta/main.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
dependencies: []
3-
4-
galaxy_info:
5-
role_name: cpp_build_machine_macos_configuration
6-
author: rockdreamer
7-
description: Configuration for CCDC macOS build machines.
8-
company: The Cambridge Crystallographic Data Centre
9-
license: "license (BSD, MIT)"
10-
min_ansible_version: 2.9
11-
platforms:
12-
- name: Darwin
13-
versions:
14-
- all
15-
galaxy_tags:
16-
- system
17-
2+
dependencies: []
3+
4+
galaxy_info:
5+
role_name: cpp_build_machine_macos_configuration
6+
namespace: ccdc
7+
author: rockdreamer
8+
description: Configuration for CCDC MacOS build machines.
9+
company: The Cambridge Crystallographic Data Centre
10+
license: "license (BSD, MIT)"
11+
min_ansible_version: 2.9
12+
platforms:
13+
- name: MacOSX
14+
versions:
15+
- all
16+
galaxy_tags:
17+
- system

requirements.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
2-
- src: https://github.com/feffi/ansible-macos-standby.git
3-
name: feffi.macos-standby
2+
- src: https://github.com/feffi/ansible-macos-standby.git
3+
name: feffi.macos-standby
4+
- src: https://github.com/feffi/ansible-macos-defaults.git
5+
name: feffi.macos-defaults

tasks/defaults-for-build-machine-speed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
- Restart Finder
6161

6262
- name: show info in login screen
63-
become: yes
63+
become: true
6464
osx_defaults:
6565
domain: /Library/Preferences/com.apple.loginwindow
6666
key: AdminHostInfo

tasks/disable-autoupdates.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
- name: Disable automatic updates
33
command: softwareupdate --schedule off
44
changed_when: false
5-
become: true
5+
become: true

tasks/disable-spotlight.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
- name: Disable constant indexing by spotlight
2+
- name: Disable constant indexing by spotlight # noqa: no-changed-when
33
command: mdutil -i off /
4-
ignore_errors: true
4+
ignore_errors: true # noqa: ignore-errors
55
become: true
66

7-
- name: kill all spotlight indexers
7+
- name: kill all spotlight indexers # noqa: no-changed-when
88
command: killall mds
9-
ignore_errors: true
9+
ignore_errors: true # noqa: ignore-errors
1010
become: true
1111

12-
- name: rebuild spotlight index
12+
- name: rebuild spotlight index # noqa: no-changed-when
1313
command: mdutil -E
14-
ignore_errors: true
14+
ignore_errors: true # noqa: ignore-errors
1515
become: true
1616

17-
- name: Disable constant indexing by spotlight
17+
- name: Disable constant indexing by spotlight # noqa: no-changed-when
1818
command: mdutil -i off /
19-
ignore_errors: true
19+
ignore_errors: true # noqa: ignore-errors
2020
become: true

tasks/never-sleep.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
standby_delay: false
1717
hibernate_mode: 0
1818
remove_sleepimage: true
19-

0 commit comments

Comments
 (0)