Skip to content

Commit 40d403c

Browse files
authored
Enable prettier (#127)
1 parent 96d2db1 commit 40d403c

File tree

35 files changed

+188
-175
lines changed

35 files changed

+188
-175
lines changed

.github/workflows/push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
push:
55
branches:
66
- main
7-
- 'releases/**'
8-
- 'stable/**'
7+
- "releases/**"
8+
- "stable/**"
99

1010
jobs:
1111
ack:

.github/workflows/release.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,29 @@ jobs:
1616
TOX_PARALLEL_NO_SPINNER: 1
1717

1818
steps:
19-
- name: Switch to using Python 3.9 by default
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: 3.9
23-
24-
- name: Install tox
25-
run: >-
26-
python3 -m
27-
pip install
28-
--user
29-
tox
30-
31-
- name: Check out src from Git
32-
uses: actions/checkout@v3
33-
with:
34-
fetch-depth: 0 # needed by setuptools-scm
35-
36-
- name: Build dists
37-
run: python -m tox -e pkg
38-
39-
- name: Publish to pypi.org
40-
if: >- # "create" workflows run separately from "push" & "pull_request"
41-
github.event_name == 'release'
42-
uses: pypa/gh-action-pypi-publish@release/v1
43-
with:
44-
password: ${{ secrets.pypi_password }}
19+
- name: Switch to using Python 3.9 by default
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.9
23+
24+
- name: Install tox
25+
run: >-
26+
python3 -m
27+
pip install
28+
--user
29+
tox
30+
31+
- name: Check out src from Git
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0 # needed by setuptools-scm
35+
36+
- name: Build dists
37+
run: python -m tox -e pkg
38+
39+
- name: Publish to pypi.org
40+
if: >- # "create" workflows run separately from "push" & "pull_request"
41+
github.event_name == 'release'
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
password: ${{ secrets.pypi_password }}

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ default_language_version:
1111
python: python3
1212
minimum_pre_commit_version: "1.14.0"
1313
repos:
14+
- repo: https://github.com/pre-commit/mirrors-prettier
15+
# keep it before yamllint
16+
rev: "v3.0.0-alpha.6"
17+
hooks:
18+
- id: prettier
19+
# Temporary excludes so we can gradually normalize the formatting
20+
exclude: >
21+
(?x)^(
22+
.*\.md|
23+
.*\{\{.*
24+
)$
1425
- repo: https://github.com/PyCQA/doc8.git
1526
rev: v1.1.1
1627
hooks:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"molecule_directory": "molecule",
3-
"role_name": "OVERRIDDEN",
4-
"scenario_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"role_name": "OVERRIDDEN",
4+
"scenario_name": "OVERRIDDEN"
55
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"molecule_directory": "molecule",
3-
"role_name": "OVERRIDDEN",
4-
"scenario_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"role_name": "OVERRIDDEN",
4+
"scenario_name": "OVERRIDDEN"
55
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"molecule_directory": "molecule",
3-
"role_name": "OVERRIDDEN",
4-
"scenario_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"role_name": "OVERRIDDEN",
4+
"scenario_name": "OVERRIDDEN"
55
}

src/molecule_plugins/docker/playbooks/create.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
- not item.pre_build_image | default(false)
8585
register: docker_images
8686

87-
- name: Build an Ansible compatible image (new) # noqa: no-handler
87+
- name: Build an Ansible compatible image (new) # noqa: no-handler
8888
when:
8989
- platforms.changed or docker_images.results | map(attribute='images') | select('equalto', []) | list | count >= 0
9090
- not item.item.pre_build_image | default(false)

src/molecule_plugins/docker/playbooks/validate-dockerfile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
tags:
1616
- always
1717
tasks:
18-
1918
- name: Assure we have docker module installed
2019
ansible.builtin.pip:
2120
name: docker
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"molecule_directory": "molecule",
3-
"role_name": "OVERRIDDEN",
4-
"scenario_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"role_name": "OVERRIDDEN",
4+
"scenario_name": "OVERRIDDEN"
55
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"molecule_directory": "molecule",
3-
"dependency_name": "OVERRIDDEN",
4-
"driver_name": "OVERRIDDEN",
5-
"provisioner_name": "OVERRIDDEN",
6-
"scenario_name": "OVERRIDDEN",
7-
"role_name": "OVERRIDDEN",
8-
"verifier_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"dependency_name": "OVERRIDDEN",
4+
"driver_name": "OVERRIDDEN",
5+
"provisioner_name": "OVERRIDDEN",
6+
"scenario_name": "OVERRIDDEN",
7+
"role_name": "OVERRIDDEN",
8+
"verifier_name": "OVERRIDDEN"
99
}
Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
22
- name: Populate instance config dict Linux
33
ansible.builtin.set_fact:
4-
instance_conf_dict: {
5-
'instance': "{{ instance_info.name }}",
6-
'address': "{{ instance_info.networkInterfaces.0.accessConfigs.0.natIP if molecule_yml.driver.external_access else instance_info.networkInterfaces.0.networkIP }}",
7-
'user': "{{ lookup('env','USER') }}",
8-
'port': "22",
9-
'identity_file': "{{ ssh_identity_file }}",
10-
'instance_os_type': "{{ molecule_yml.driver.instance_os_type }}"
11-
}
4+
instance_conf_dict:
5+
{
6+
"instance": "{{ instance_info.name }}",
7+
"address": "{{ instance_info.networkInterfaces.0.accessConfigs.0.natIP if molecule_yml.driver.external_access else instance_info.networkInterfaces.0.networkIP }}",
8+
"user": "{{ lookup('env','USER') }}",
9+
"port": "22",
10+
"identity_file": "{{ ssh_identity_file }}",
11+
"instance_os_type": "{{ molecule_yml.driver.instance_os_type }}",
12+
}
1213
loop: "{{ server.results }}"
1314
loop_control:
1415
loop_var: instance_info
@@ -17,23 +18,23 @@
1718

1819
- name: Populate instance config dict Windows
1920
ansible.builtin.set_fact:
20-
instance_conf_dict: {
21-
'instance': "{{ instance_info.name }}",
22-
'address': "{{ instance_info.networkInterfaces.0.accessConfigs.0.natIP if molecule_yml.driver.external_access else instance_info.networkInterfaces.0.networkIP }}",
23-
'user': "molecule_usr",
24-
'password': "{{ instance_info.password }}",
25-
'port': "{{ instance_info.winrm_port | default(5986) }}",
26-
'winrm_transport': "{{ molecule_yml.driver.winrm_transport | default('ntlm') }}",
27-
'winrm_server_cert_validation': "{{ molecule_yml.driver.winrm_server_cert_validation | default('ignore') }}",
28-
'instance_os_type': "{{ molecule_yml.driver.instance_os_type }}"
29-
}
21+
instance_conf_dict:
22+
{
23+
"instance": "{{ instance_info.name }}",
24+
"address": "{{ instance_info.networkInterfaces.0.accessConfigs.0.natIP if molecule_yml.driver.external_access else instance_info.networkInterfaces.0.networkIP }}",
25+
"user": "molecule_usr",
26+
"password": "{{ instance_info.password }}",
27+
"port": "{{ instance_info.winrm_port | default(5986) }}",
28+
"winrm_transport": "{{ molecule_yml.driver.winrm_transport | default('ntlm') }}",
29+
"winrm_server_cert_validation": "{{ molecule_yml.driver.winrm_server_cert_validation | default('ignore') }}",
30+
"instance_os_type": "{{ molecule_yml.driver.instance_os_type }}",
31+
}
3032
loop: "{{ win_instances }}"
3133
loop_control:
3234
loop_var: instance_info
3335
no_log: true
3436
register: instance_conf_dict
3537

36-
3738
- name: Wipe out instance config
3839
ansible.builtin.set_fact:
3940
instance_conf: {}
@@ -46,4 +47,4 @@
4647
ansible.builtin.copy:
4748
content: "{{ instance_conf }}"
4849
dest: "{{ molecule_instance_config }}"
49-
mode: '0600'
50+
mode: "0600"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"molecule_directory": "molecule",
3-
"role_name": "OVERRIDDEN",
4-
"scenario_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"role_name": "OVERRIDDEN",
4+
"scenario_name": "OVERRIDDEN"
55
}

src/molecule_plugins/podman/cookiecutter/{{cookiecutter.molecule_directory}}/{{cookiecutter.scenario_name}}/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ansible.builtin.copy:
88
src: /etc/hosts
99
dest: /tmp/hosts-from-controller
10-
mode: '0644'
10+
mode: "0644"
1111
- name: "Include {{ cookiecutter.role_name }}"
1212
ansible.builtin.include_role:
1313
name: "{{ cookiecutter.role_name }}"

src/molecule_plugins/podman/playbooks/create.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
vars:
99
podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}"
1010
tasks:
11-
- name: Get podman executable path # noqa: command-instead-of-shell
11+
- name: Get podman executable path # noqa: command-instead-of-shell
1212
ansible.builtin.shell: "command -v {{ podman_exec }}"
1313
register: _podman_path
1414
changed_when: false
@@ -79,7 +79,7 @@
7979
- not item.pre_build_image | default(false)
8080
register: podman_images
8181

82-
- name: Build an Ansible compatible image # noqa: no-handler
82+
- name: Build an Ansible compatible image # noqa: no-handler
8383
ansible.builtin.command: >
8484
{{ podman_cmd }} build
8585
-f {{ item.dest }}
@@ -139,8 +139,7 @@
139139
containers.podman.podman_network:
140140
name: "{{ podman_network.results[0].ansible_loop.allitems[0].network }}"
141141
executable: "{{ podman_exec }}"
142-
subnet:
143-
"{{ podman_network.results[0].ansible_loop.allitems[0].subnet | default(omit) }}"
142+
subnet: "{{ podman_network.results[0].ansible_loop.allitems[0].subnet | default(omit) }}"
144143
when:
145144
- podman_network.results[0].msg is defined
146145
# podman message changed at some point in time

src/molecule_plugins/podman/playbooks/validate-dockerfile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
- image: ubuntu:latest
1515
- image: debian:latest
1616
tasks:
17-
1817
- name: Create isolated build directories for each image
1918
ansible.builtin.tempfile:
2019
prefix: "molecule-dockerfile-{{ item.image }}"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"molecule_directory": "molecule",
3-
"role_name": "OVERRIDDEN",
4-
"scenario_name": "OVERRIDDEN"
2+
"molecule_directory": "molecule",
3+
"role_name": "OVERRIDDEN",
4+
"scenario_name": "OVERRIDDEN"
55
}

src/molecule_plugins/vagrant/playbooks/create.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
gather_facts: false
66
no_log: "{{ molecule_no_log }}"
77
tasks:
8-
- name: Create molecule instance(s) # noqa fqcn[action]
8+
- name: Create molecule instance(s) # noqa fqcn[action]
99
vagrant:
1010
instances: "{{ molecule_yml.platforms }}"
1111
default_box: "{{ molecule_yml.driver.default_box | default('generic/alpine316') }}"
@@ -23,17 +23,18 @@
2323
# Mandatory configuration for Molecule to function.
2424

2525
- name: Create molecule instances configuration
26-
when: server is changed # noqa no-handler
26+
when: server is changed # noqa no-handler
2727
block:
28-
2928
- name: Populate instance config dict
3029
ansible.builtin.set_fact:
31-
instance_conf_dict: {
32-
'instance': "{{ item.Host }}",
33-
'address': "{{ item.HostName }}",
34-
'user': "{{ item.User }}",
35-
'port': "{{ item.Port }}",
36-
'identity_file': "{{ item.IdentityFile }}", }
30+
instance_conf_dict:
31+
{
32+
"instance": "{{ item.Host }}",
33+
"address": "{{ item.HostName }}",
34+
"user": "{{ item.User }}",
35+
"port": "{{ item.Port }}",
36+
"identity_file": "{{ item.IdentityFile }}",
37+
}
3738
with_items: "{{ server.results }}"
3839
register: instance_config_dict
3940

src/molecule_plugins/vagrant/playbooks/destroy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
gather_facts: false
66
no_log: "{{ molecule_no_log }}"
77
tasks:
8-
- name: Destroy molecule instance(s) # noqa fqcn[action]
8+
- name: Destroy molecule instance(s) # noqa fqcn[action]
99
vagrant:
1010
instances: "{{ molecule_yml.platforms }}"
1111
default_box: "{{ molecule_yml.driver.default_box | default('generic/alpine316') }}"
@@ -25,7 +25,7 @@
2525
ansible.builtin.set_fact:
2626
instance_conf: {}
2727

28-
- name: Dump instance config # noqa no-handler
28+
- name: Dump instance config # noqa no-handler
2929
ansible.builtin.copy:
3030
content: |
3131
# Molecule managed

0 commit comments

Comments
 (0)