Skip to content

Commit

Permalink
ci: automatically fix linting issues (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco authored Aug 24, 2024
1 parent cf6b149 commit eae0391
Show file tree
Hide file tree
Showing 135 changed files with 218 additions and 515 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ indent_size = 2
indent_size = 4
indent_style = tab

[*.md]

# Indentation in Markdown files might not be constant, or a multiple of 2.
# Prettier takes care of formatting Markdown files.
indent_size = unset

# Don't try to format binary files
[*.tfvars.enc]
charset = unset
Expand Down
1 change: 0 additions & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,3 @@ updates:
interval: "daily"
open-pull-requests-limit: 100
version: 2
...
3 changes: 1 addition & 2 deletions .github/workflows/build-arduino-projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Build Arduino projects
permissions:
contents: read

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
paths:
- ".github/workflows/build-arduino-projects.yaml"
Expand Down Expand Up @@ -41,4 +41,3 @@ jobs:
arduino-project:
- project-id: arduino-33-ble-sense
project-context-path: config/arduino/arduino-33-ble-sense
...
3 changes: 1 addition & 2 deletions .github/workflows/build-container-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
permissions:
contents: read

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push: null
pull_request: null

Expand Down Expand Up @@ -78,4 +78,3 @@ jobs:
- name: cd-container
build-contexts: null
context-directory: docker/release-please-commitlint
...
3 changes: 1 addition & 2 deletions .github/workflows/build-firmware-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
permissions:
contents: read

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
paths:
- ".github/workflows/build-firmware-images.yaml"
Expand All @@ -34,4 +34,3 @@ jobs:
- name: "Build the Smart Desk firmware image"
run: |
scripts/build.sh
...
3 changes: 1 addition & 2 deletions .github/workflows/dependabot-automation.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Dependabot automation

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
Expand Down Expand Up @@ -53,4 +53,3 @@ jobs:
|| steps.metadata.outputs.dependency-names == 'renovatebot/github-action'
|| steps.metadata.outputs.dependency-names == 'super-linter/super-linter'
run: gh pr merge --auto --squash --delete-branch "${PR_URL}"
...
3 changes: 1 addition & 2 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Dependency Review
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
pull_request: null

permissions:
Expand All @@ -14,4 +14,3 @@ jobs:
uses: actions/checkout@v4
- name: Review dependencies
uses: actions/dependency-review-action@v4
...
3 changes: 1 addition & 2 deletions .github/workflows/lint-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Lint commit

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push: null
pull_request: null
merge_group: null
Expand Down Expand Up @@ -72,4 +72,3 @@ jobs:
- name: Validate commits
run: |
scripts/lint-commits.sh
...
42 changes: 38 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Lint

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push: null
pull_request: null
workflow_call: null
Expand All @@ -10,7 +10,6 @@ permissions:
contents: read

jobs:

lint:
concurrency:
# Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
Expand All @@ -30,7 +29,7 @@ jobs:
- name: Load super-linter configuration
run: cat config/lint/super-linter.env >> "$GITHUB_ENV"
- name: Super-Linter
uses: super-linter/super-linter@v6.9.0
uses: super-linter/super-linter@v7.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -66,4 +65,39 @@ jobs:
set -o nounset
scripts/run-pre-commit.sh
...
fix-lint-issues:
concurrency:
# Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# github.head_ref: head_ref or source branch of the pull request
# github.ref: ref of the branch that triggered the workflow
group: ${{ github.workflow }}-fix-lint-issues-${{ github.head_ref || github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
# To write linting fixes
contents: write
# To write Super-linter status checks
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load super-linter configuration
run: cat config/lint/super-linter.env >> "$GITHUB_ENV"
- name: Load super-linter fix mode configuration
run: cat config/lint/super-linter-fix-mode.env >> "$GITHUB_ENV"
- name: Super-Linter
uses: super-linter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push linting fixes
if: >
github.event_name == 'pull_request' &&
github.ref_name != github.event.repository.default_branch
uses: stefanzweifel/[email protected]
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "chore: fix linting issues"
commit_user_name: super-linter
commit_user_email: [email protected]
3 changes: 1 addition & 2 deletions .github/workflows/preview-release-notes.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Release

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
pull_request: null

# Don't grant any access by default
Expand All @@ -24,4 +24,3 @@ jobs:
- name: Generate a preview of the release notes
run: |
scripts/release-please-dry-run.sh
...
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Release

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand All @@ -27,4 +27,3 @@ jobs:
config-file: .github/release-please/release-please-config.json
manifest-file: .github/release-please/.release-please-manifest.json
token: ${{ secrets.GITHUB_TOKEN }}
...
5 changes: 2 additions & 3 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Renovate

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
paths:
- ".github/workflows/renovate.yaml"
Expand Down Expand Up @@ -41,8 +41,7 @@ jobs:
- name: Self-hosted Renovate
uses: renovatebot/[email protected]
env:
LOG_LEVEL: 'debug'
LOG_LEVEL: "debug"
with:
configurationFile: .github/renovate-global-config.js
token: ${{ secrets.GITHUB_TOKEN }}
...
5 changes: 2 additions & 3 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Scorecard supply-chain security
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule: null
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '44 5 * * 6'
- cron: "44 5 * * 6"
push:
branches:
- master
Expand Down Expand Up @@ -52,4 +52,3 @@ jobs:
uses: github/codeql-action/[email protected]
with:
sarif_file: results.sarif
...
3 changes: 1 addition & 2 deletions .github/workflows/test-ansible.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Test Ansible collections, roles, playbooks

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
paths:
- ".github/workflows/test-ansible.yaml"
Expand Down Expand Up @@ -72,4 +72,3 @@ jobs:
- home-lab-node
- proxmox-node
- main
...
3 changes: 1 addition & 2 deletions .github/workflows/test-shell-scripts.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Test shell scripts

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push: null
pull_request: null

Expand All @@ -28,4 +28,3 @@ jobs:
matrix:
test_script_path:
- test/scripts/build-python-venv-test.sh
...
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ vault.y*ml*

# Developer credentials
.github-personal-access-token

# Super-linter output
super-linter-output
super-linter.log

# GitHub Actions leftovers
github_conf
14 changes: 5 additions & 9 deletions config/ansible/inventory/group_vars/all/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ docker_users:
- "{{ ansible_user }}"

# Docker daemon options as a dict
docker_daemon_options: {
"live-restore": true,
"log-driver": "local",
"log-opts": {
"compress": "true",
"max-size": "10m",
"max-file": "3",
docker_daemon_options:
{
"live-restore": true,
"log-driver": "local",
"log-opts": { "compress": "true", "max-size": "10m", "max-file": "3" },
}
}
...
1 change: 0 additions & 1 deletion config/ansible/inventory/group_vars/all/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ qbittorrent_http_endpoint_fqdn: "raspberrypi2.{{ edge_environment_root_fqdn }}"
syncthing_user_interface_http_endpoint_fqdn: "raspberrypi2.{{ edge_environment_root_fqdn }}"
zigbee2mqtt_http_endpoint_fqdn: "raspberrypi2.{{ edge_environment_root_fqdn }}"
mosquitto_server_fqdn: "raspberrypi2.{{ edge_environment_root_fqdn }}"
...
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ is_proxmox_node: true
proxmox_vms:
- hostname: hl01
default_network_interface_mac_address: "bc:24:11:d4:f6:64"
...
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
ansible_user: pi
configure_tailscale: true
is_raspberry_pi: true
...
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ filesystems_to_create:
partitions_to_create:
- device: "{{ data_disk_device }}"
partition_number: 1
...
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ network_interfaces:
interface_name: enp2s0
# Assigned using DHCP address reservation
ipv4_address: "10.0.0.3"
...
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ configure_docker: true
configure_wifi: true
delete_systemd_journal_file: true
has_sense_hat: true
...
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ network_interfaces:
interface_name: eth0
# Assigned using DHCP address reservation
ipv4_address: "10.0.0.2"
...
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ configure_docker: true
configure_wifi: true
delete_systemd_journal_file: true
has_raspberry_pi_v2_camera: true
...
1 change: 0 additions & 1 deletion config/ansible/inventory/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ all:
home_lab_proxmox_vms:
hosts:
hl01.edge.lab.ferrari.how: null
...
1 change: 0 additions & 1 deletion config/ansible/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ provisioner:
D: true
playbooks:
converge: "${ANSIBLE_TEST_PLAYBOOK_PATH}"
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/boot-bare-metal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
gather_facts: false
roles:
- role: ferrarimarco_home_lab_boot_bare_metal
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
gather_facts: true
roles:
- role: ferrarimarco_home_lab_bootstrap
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/container-engine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
roles:
- role: geerlingguy.docker
become: true
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/coral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
gather_facts: true
roles:
- role: ferrarimarco_home_lab_coral
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/home-lab-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
gather_facts: true
roles:
- role: ferrarimarco_home_lab_node
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@

- name: Import the home lab node playbook
ansible.builtin.import_playbook: home-lab-node.yaml
...
1 change: 0 additions & 1 deletion config/ansible/playbooks/proxmox-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
gather_facts: true
roles:
- role: ferrarimarco_home_lab_proxmox
...
2 changes: 1 addition & 1 deletion config/ansible/playbooks/proxmox-vms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
hosts: pve1.edge.lab.ferrari.how
gather_facts: true
tasks: null
...
---
# TODO: convert this to an Ansible playbook if it becomes more common
# Notes to create the 100 VM:
# Create VM: qm create 100 --name hl01 --net0 virtio=BC:24:11:D4:F6:64,bridge=vmbr0,firewall=1 --scsihw virtio-scsi-single --machine q35 --ostype l26
Expand Down
1 change: 0 additions & 1 deletion config/ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ collections:
roles:
- name: geerlingguy.docker
version: "7.1.0"
...
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
---
...
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
---
...
Loading

0 comments on commit eae0391

Please sign in to comment.