Skip to content

Commit

Permalink
Swap yaml-lint for mega-linter (#7)
Browse files Browse the repository at this point in the history
* Swap yaml-lint for mega-linter
Fixes #6

* Adjust mega linter config

* add mega-linter config files

* Added prettier config
  • Loading branch information
reefland authored Jun 10, 2024
1 parent d6b677e commit 1d295ef
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 59 deletions.
23 changes: 23 additions & 0 deletions .ci/markdownlint/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
default: true

# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 240
# Number of characters for headings
heading_line_length: 80
# Number of characters for code blocks
code_block_line_length: 80
# Include code blocks
code_blocks: true
# Include tables
tables: true
# Include headings
headings: true
# Include headings
headers: true
# Strict length checking
strict: false
# Stern length checking
stern: false
14 changes: 14 additions & 0 deletions .ci/markdownlint/markdownlint.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# MD013/line-length - Line length
MD013: false

# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
MD024:
# Only check sibling headings
allow_different_nesting: true
# Only check sibling headings
siblings_only: true

# MD033/no-inline-html - Inline HTML
MD033: false
1 change: 1 addition & 0 deletions .ci/prettier/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
7 changes: 7 additions & 0 deletions .ci/prettier/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
printWidth: 140
semi: false
singleQuote: false
trailingComma: "es5"
tabWidth: 2
useTabs: false
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ rules:
key-duplicates: enable
line-length:
level: warning
max: 100
max: 140
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
trailing-spaces: disable
57 changes: 0 additions & 57 deletions .github/workflows/linter.yaml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/mega-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: MegaLinter

on:
workflow_dispatch:
push:
branches: ["main", "master"]

pull_request:
branches: ["main", "master"]

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# https://megalinter.io/latest/supported-linters/
# https://megalinter.io/7.11.1/flavors/terraform/
- name: MegaLinter
# Terraform image is much smaller than default image
uses: oxsecurity/megalinter/flavors/[email protected]
env:
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'workflow_dispatch' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_LINTERS: |-
${{
join(
fromJSON('
[
"BASH_SHELLCHECK",
"MARKDOWN_MARKDOWNLINT",
"REPOSITORY_GIT_DIFF",
"REPOSITORY_SECRETLINT",
"YAML_YAMLLINT",
"YAML_PRETTIER",
]
'),
','
)
}}
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .ci/markdownlint/markdownlint.config.yaml
MARKDOWN_MARKDOWNLINT_RULES_PATH: .ci/markdownlint/
YAML_YAMLLINT_CONFIG_FILE: .ci/yamllint/.yamllint.yaml
YAML_PRETTIER_CONFIG_FILE: .ci/prettier/.prettierrc.yaml
YAML_PRETTIER_ARGUMENTS: --ignore-path .ci/prettier/.prettierignore

0 comments on commit 1d295ef

Please sign in to comment.