Skip to content

Commit

Permalink
Introduce yamlfmt tool
Browse files Browse the repository at this point in the history
  • Loading branch information
electrocucaracha committed Jan 30, 2024
1 parent 05db2dc commit 93b8f2f
Show file tree
Hide file tree
Showing 93 changed files with 167 additions and 353 deletions.
2 changes: 0 additions & 2 deletions .github/actions/molecule-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Molecule execution
inputs:
tox-env:
description: 'Python TOX environment'

runs:
using: "composite"
steps:
Expand Down
2 changes: 0 additions & 2 deletions .github/actions/vagrant-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Vagrant setup

runs:
using: "composite"
steps:
Expand Down
2 changes: 0 additions & 2 deletions .github/actions/vagrant-up/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Vagrant up
inputs:
debug:
Expand Down Expand Up @@ -79,7 +78,6 @@ inputs:
run-benchmarks:
description: 'Run K6 and iperf networking benchmark tools'
default: false

runs:
using: "composite"
steps:
Expand Down
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

version: 2
updates:
- package-ecosystem: "github-actions"
Expand Down
5 changes: 0 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

documentation:
- docs/*
- "*.md"

tests:
- tests/*

ci:
- .github/*

all-in-one:
- aio.sh

addons:
- playbooks/*
2 changes: 0 additions & 2 deletions .github/workflows/diagram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Documentation and diagram generation
# yamllint disable-line rule:truthy
on:
Expand All @@ -16,7 +15,6 @@ on:
- codebase-structure.svg
- .github/
workflow_dispatch:

jobs:
check-diagram:
name: Update the codebase structure diagram
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/distros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Scheduled Latest Vagrant Boxes verification
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:

jobs:
check-versions:
permissions:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Lint Code Base
# yamllint disable-line rule:truthy
on:
push:
pull_request:

jobs:
check-broken-links:
name: Check documentation external links
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/on-demand_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Integration tests
# yamllint disable-line rule:truthy
on:
Expand All @@ -24,16 +23,14 @@ on:
pull_request_review:
types:
- submitted

jobs:
check-ci:
name: Check Integration tests in an Ubuntu Focal Virtual Machines
if: >-
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
) || github.event_name != 'pull_request_review'
runs-on: macos-12
strategy:
fail-fast: false
Expand Down Expand Up @@ -77,8 +74,7 @@ jobs:
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
) || github.event_name != 'pull_request_review'
outputs:
scripts: ${{ steps.filter.outputs.scripts }}
steps:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/on-demand_corner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Check Corner cases
# yamllint disable-line rule:truthy
on:
Expand All @@ -24,16 +23,14 @@ on:
pull_request_review:
types:
- submitted

jobs:
check-corner-cases:
name: Check K8s Plugins installation methods in an Ubuntu Bionic All-in-One setup
if: >-
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
) || github.event_name != 'pull_request_review'
runs-on: macos-12
strategy:
fail-fast: false
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/on-demand_molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Check All Molecule tests
# yamllint disable-line rule:truthy
on:
Expand All @@ -19,7 +18,6 @@ on:
pull_request_review:
types:
- submitted

jobs:
bootstrap:
name: Pull python dependencies
Expand All @@ -46,8 +44,7 @@ jobs:
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
) || github.event_name != 'pull_request_review'
needs: bootstrap
outputs:
environments: ${{ steps.filter.outputs.changes }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/on-demand_multus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Check Multus CNI
# yamllint disable-line rule:truthy
on:
Expand All @@ -24,16 +23,14 @@ on:
pull_request_review:
types:
- submitted

jobs:
check-multus:
name: Check Multus CNI in an Ubuntu Focal All-in-One setup
if: >-
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
) || github.event_name != 'pull_request_review'
runs-on: ubuntu-20.04
env:
KRD_DEBUG: true
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/on-demand_virtlet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Check Virtlet service
# yamllint disable-line rule:truthy
on:
Expand All @@ -19,16 +18,14 @@ on:
pull_request_review:
types:
- submitted

jobs:
check-virtlet:
name: Check Mirantis Virtlet solution in an Ubuntu Bionic All-in-One setup
if: >-
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
) || github.event_name != 'pull_request_review'
runs-on: macos-12
steps:
- uses: actions/[email protected]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Automatic Rebase
# yamllint disable-line rule:truthy
on:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/scheduled_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Scheduled Kubernetes Dashboard + Metrics Server verification
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '0 0 * * 5'
workflow_dispatch:

jobs:
check-dashboard-and-metrics:
name: Check All-in-One setup in a Ubuntu Focal virtual environment
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/scheduled_distros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Scheduled All Linux Distros Supported verification
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
generate-json-matrix:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/spell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Run misspell
# yamllint disable-line rule:truthy
on:
Expand All @@ -18,7 +17,6 @@ on:
pull_request_review:
types:
- submitted

jobs:
check-reviewdog:
name: Check spelling (reviewdog)
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Triage
# yamllint disable-line rule:truthy
on: [pull_request]

jobs:
assign-label:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

name: Scheduled Versions and Dictionary verification
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
check-versions:
permissions:
Expand Down
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

AllCops:
NewCops: enable
Metrics/BlockLength:
Expand Down
1 change: 0 additions & 1 deletion .spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

matrix:
- name: markdown
dictionary:
Expand Down
4 changes: 0 additions & 4 deletions .yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

extends: default

yaml-files:
- '*.yml'

ignore: |
.tox/
*.yaml
rules:
line-length: disable
13 changes: 13 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2020
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
formatter:
type: basic
include_document_start: true
pad_line_comments: 2
max_line_length: 160
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ fmt:
sudo -E $(DOCKER_CMD) run --rm -u "$$(id -u):$$(id -g)" \
-v "$$(pwd):/mnt" -v /mnt/spec -v /mnt/playbooks/roles/pmem/files/ \
-w /mnt mvdan/shfmt -l -w -i 4 -s .
command -v yamlfmt > /dev/null || curl -s "https://i.jpillora.com/google/yamlfmt!!" | bash
yamlfmt -dstar **/*.{yaml,yml}
Loading

0 comments on commit 93b8f2f

Please sign in to comment.