Skip to content

Commit

Permalink
run prettier on yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdahlke committed Oct 3, 2023
1 parent 4a4e167 commit e5009df
Show file tree
Hide file tree
Showing 28 changed files with 843 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cherrypick.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Cherry pick commit(s) to a branch"

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
cherrypick_commits:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on: # yamllint disable-line rule:truthy
# The branches below must be a subset of the branches above
branches: [master, release-*]
schedule:
- cron: '15 19 * * 1'
- cron: "15 19 * * 1"

jobs:
analyze:
Expand All @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['java', 'javascript']
language: ["java", "javascript"]
# CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python']
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
Expand All @@ -47,10 +47,10 @@ jobs:
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/create-patch-branch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 'Create a Patch Branch'
---
name: "Create a Patch Branch"

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
cherrypick_commits:
Expand All @@ -9,8 +10,8 @@ on:
default: ""

env:
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'corretto'
JAVA_VERSION: "11"
JAVA_DISTRIBUTION: "corretto"

jobs:
verify:
Expand Down Expand Up @@ -38,7 +39,7 @@ jobs:
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'maven'
cache: "maven"

- name: Configure Git user
run: |
Expand Down Expand Up @@ -76,4 +77,4 @@ jobs:
uses: ./.github/workflows/cherrypick.yml
with:
branch: ${{ needs.patch.outputs.branch }}
commits: ${{ github.event.inputs.cherrypick_commits }}
commits: ${{ github.event.inputs.cherrypick_commits }}
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
---
name: 'Dependency Review'
name: "Dependency Review"
on: [pull_request] # yamllint disable-line rule:truthy

permissions:
Expand All @@ -15,7 +15,7 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: 'Dependency Review'
- name: "Dependency Review"
uses: actions/dependency-review-action@v3
16 changes: 8 additions & 8 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Java CI with Maven

on: # yamllint disable-line rule:truthy
Expand All @@ -8,20 +9,19 @@ on: # yamllint disable-line rule:truthy

jobs:
build:

name: Standard build on Java ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: ['11']
java: ["11"]
experimental: [false]
include:
- java: '15'
- java: "15"
experimental: true
- java: '16'
- java: "16"
experimental: true
- java: '17'
- java: "17"
experimental: true
continue-on-error: ${{ matrix.experimental }}

Expand All @@ -32,9 +32,9 @@ jobs:
- name: Configure Java & Maven
uses: actions/setup-java@v3
with:
java-version: '${{ matrix.java }}'
cache: 'maven'
distribution: 'corretto'
java-version: "${{ matrix.java }}"
cache: "maven"
distribution: "corretto"

- name: Build with Maven
run: mvn -B -e -ntp "-Dstyle.color=always" verify
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
---
name: 'Maven: Publish Packages to GitHub'
name: "Maven: Publish Packages to GitHub"

on: # yamllint disable-line rule:truthy
workflow_dispatch:
Expand All @@ -10,8 +10,8 @@ on: # yamllint disable-line rule:truthy
# types: [created]

env:
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'corretto'
JAVA_VERSION: "11"
JAVA_DISTRIBUTION: "corretto"

jobs:
publish:
Expand All @@ -27,7 +27,7 @@ jobs:
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'maven'
cache: "maven"
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml

- name: Build with Maven
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This is a release workflow that leverages the maven release plugin specified in
# the pom.xml to perform a release and create a tag of that release version.
---
name: 'Maven: Release'
name: "Maven: Release"

on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
release_type:
description: 'Choose the release type'
description: "Choose the release type"
required: true
default: 'release'
default: "release"
type: choice
options:
- release
Expand All @@ -21,8 +21,8 @@ on: # yamllint disable-line rule:truthy
default: ""

env:
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'corretto'
JAVA_VERSION: "11"
JAVA_DISTRIBUTION: "corretto"
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"

jobs:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
cache: 'maven'
cache: "maven"
distribution: ${{ env.JAVA_DISTRIBUTION }}
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml

Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'maven'
cache: "maven"

- name: Configure Git user
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/maven-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on: # yamllint disable-line rule:truthy
default: ""

env:
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'corretto'
JAVA_VERSION: "11"
JAVA_DISTRIBUTION: "corretto"
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"

jobs:
Expand All @@ -39,7 +39,7 @@ jobs:
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'maven'
cache: "maven"

- name: Configure Git user
run: |
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: '2'
version: "2"

services:
emissary-worker-1:
Expand Down
8 changes: 4 additions & 4 deletions contrib/elasticsearch/filebeat.agents.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ filebeat.inputs:
json.overwrite_keys: true

output.elasticsearch:
index: 'emissary-test-%{[agent.version]}-%{+yyyy.MM.dd}'
hosts: 'https://elasticsearch:9200'
username: 'elastic'
password: '${ESPASSWORD}'
index: "emissary-test-%{[agent.version]}-%{+yyyy.MM.dd}"
hosts: "https://elasticsearch:9200"
username: "elastic"
password: "${ESPASSWORD}"
ssl.verification_mode: none
ssl.certificate: "/etc/tls/http_ca.crt"
ssl.key: "/etc/tls/http.key.pem"
Expand Down
45 changes: 45 additions & 0 deletions megalinter-reports/IDE-config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
MegaLinter can help you to define the same linter configuration locally

INSTRUCTIONS

- Copy the content of IDE-config folder at the root of your repository
- if you are using Visual Studio Code, just reopen your project after the copy, and you will be prompted to install recommended extensions
- If not, you can install extensions manually using the following links.

IDE EXTENSIONS APPLICABLE TO YOUR PROJECT

prettier (YAML)
- atom:
- prettier-atom: https://github.com/prettier/prettier-atom
- atom-mprettier: https://github.com/t9md/atom-mprettier
- atom-miniprettier: https://github.com/duailibe/atom-miniprettier
- emacs:
- prettier-emacs: https://github.com/prettier/prettier-emacs
- prettier.el: https://github.com/jscheid/prettier.el
- apheleia: https://github.com/raxod502/apheleia
- idea:
- Prettier: https://plugins.jetbrains.com/plugin/10456-prettier
- sublime:
- JsPrettier: https://packagecontrol.io/packages/JsPrettier
- vim:
- vim-prettier: https://github.com/prettier/vim-prettier
- visual_studio:
- JavaScriptPrettier: https://github.com/madskristensen/JavaScriptPrettier
- vscode:
- prettier-vscode: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

v8r (YAML)
- eclipse:
- native support: https://www.eclipse.org/
- idea:
- native support: https://www.jetbrains.com/products/#type=ide
- vim:
- vison: https://github.com/Quramy/vison
- vscode:
- native support: https://code.visualstudio.com/

yamllint (YAML)
- emacs:
- flycheck: https://github.com/krzysztof-magosa/flycheck-yamllint
- vim:
- ale: https://github.com/w0rp/ale
17 changes: 17 additions & 0 deletions megalinter-reports/IDE-config/.yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
###########################################
# These are the rules used for #
# linting all the yaml files in the stack #
# NOTE: #
# You can disable line with: #
# # yamllint disable-line #
###########################################
extends: default
rules:
new-lines:
level: warning
type: unix
line-length:
max: 500
comments:
min-spaces-from-content: 1 # Used to follow prettier standard: https://github.com/prettier/prettier/pull/10926
21 changes: 21 additions & 0 deletions megalinter-reports/linters_logs/ERROR-YAML_YAMLLINT.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Results of yamllint linter (version 1.32.0)
See documentation on https://megalinter.io/7.4.0/descriptors/yaml_yamllint/
-----------------------------------------------

❌ [ERROR] for workspace /tmp/lint
Linter raw log:
.github/workflows/cherrypick.yml
4:1 warning truthy value should be one of [false, true] (truthy)

.github/workflows/codeql-analysis.yml
50:9 warning comment not indented like content (comments-indentation)

.github/workflows/create-patch-branch.yml
1:1 warning missing document start "---" (document-start)
3:1 warning truthy value should be one of [false, true] (truthy)
79:61 error no new line character at the end of file (new-line-at-end-of-file)

.github/workflows/maven-ci.yml
1:1 warning missing document start "---" (document-start)


5 changes: 5 additions & 0 deletions megalinter-reports/linters_logs/SUCCESS-YAML_PRETTIER.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Results of prettier linter (version 3.0.3)
See documentation on https://megalinter.io/7.4.0/descriptors/yaml_prettier/
-----------------------------------------------

✅ [SUCCESS] for workspace /tmp/lint
5 changes: 5 additions & 0 deletions megalinter-reports/linters_logs/SUCCESS-YAML_V8R.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Results of v8r linter (version 2.0.0)
See documentation on https://megalinter.io/7.4.0/descriptors/yaml_v8r/
-----------------------------------------------

✅ [SUCCESS] for workspace /tmp/lint
5 changes: 5 additions & 0 deletions megalinter-reports/linters_logs/SUCCESS-YAML_YAMLLINT.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Results of yamllint linter (version 1.32.0)
See documentation on https://megalinter.io/7.4.0/descriptors/yaml_yamllint/
-----------------------------------------------

✅ [SUCCESS] for workspace /tmp/lint
18 changes: 18 additions & 0 deletions megalinter-reports/linters_logs/WARNING-YAML_PRETTIER.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Results of prettier linter (version 3.0.3)
See documentation on https://megalinter.io/7.4.0/descriptors/yaml_prettier/
-----------------------------------------------

❌ [ERROR] for workspace /tmp/lint
Linter raw log:
Checking formatting...
[warn] .github/workflows/codeql-analysis.yml
[warn] .github/workflows/create-patch-branch.yml
[warn] .github/workflows/dependency-review.yml
[warn] .github/workflows/maven-ci.yml
[warn] .github/workflows/maven-publish.yml
[warn] .github/workflows/maven-release.yml
[warn] .github/workflows/maven-version.yml
[warn] contrib/docker/docker-compose.yml
[warn] contrib/elasticsearch/filebeat.agents.docker.yml
[warn] Code style issues found in 9 files. Run Prettier to fix.

Loading

0 comments on commit e5009df

Please sign in to comment.