From a60815531bec906a288f4caa6cd1f66dc1679a41 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:42:47 +0200 Subject: [PATCH] wip --- .editorconfig | 8 ++++++ .github/dependabot.yml | 2 +- .github/workflows/actions-lint.yaml | 11 ++++++++ .github/workflows/ci.yml | 16 ++++++++++- .github/workflows/spellchecker.yml | 14 ---------- .gitignore | 1 + .prettierrc.yaml | 4 +++ .vale.ini | 8 ++++++ .vale/styles/README.md | 3 +++ .yamllint.yaml | 41 +++++++++++++++++++++++++++++ 02-safe/.golangci.yaml | 25 ++++++++++++++++++ 02-safe/README.md | 7 +++++ README.md | 1 + 13 files changed, 125 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/actions-lint.yaml delete mode 100644 .github/workflows/spellchecker.yml create mode 100644 .gitignore create mode 100644 .prettierrc.yaml create mode 100644 .vale.ini create mode 100644 .vale/styles/README.md create mode 100644 .yamllint.yaml create mode 100644 02-safe/.golangci.yaml create mode 100644 02-safe/README.md diff --git a/.editorconfig b/.editorconfig index 35ae7b4..b3a0895 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,9 +2,17 @@ # https://editor.timseverien.com/#config root = true +[*.{md}] +charset = utf-8 +end_of_line = lf +tab_width = 2 +trim_trailing_whitespace = true +max_line_length = 200 + [*.{yml,yaml}] charset = utf-8 end_of_line = lf insert_final_newline = true tab_width = 2 trim_trailing_whitespace = true +max_line_length = 100 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a86341d..e169881 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ updates: # They will have to be merged manually by a maintainer - package-ecosystem: github-actions directory: / - open-pull-requests-limit: 10 # avoid spam, if no one reacts + open-pull-requests-limit: 10 # avoid spam, if no one reacts schedule: interval: weekly time: '11:00' diff --git a/.github/workflows/actions-lint.yaml b/.github/workflows/actions-lint.yaml new file mode 100644 index 0000000..17c717e --- /dev/null +++ b/.github/workflows/actions-lint.yaml @@ -0,0 +1,11 @@ +--- +on: push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: rethab/actions-lint@v1 + with: + files: .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8978e9..0cd7e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,27 @@ --- name: CI -on: # yamllint disable-line rule:truthy +on: push: jobs: ci-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: yaml-lint uses: ibiqlik/action-yamllint@v3 + - name: EditorConfig-Action uses: zbeekman/EditorConfig-Action@v1.1.1 + + - name: Vale Linter + uses: errata-ai/vale-action@v2.1.0 + + - name: Vale Action + uses: errata-ai/vale-action@reviewdog + + - name: Vale Action + uses: errata-ai/vale-action@reviewdog + + - name: typos-action + uses: crate-ci/typos@v1.21.0 diff --git a/.github/workflows/spellchecker.yml b/.github/workflows/spellchecker.yml deleted file mode 100644 index 71708ac..0000000 --- a/.github/workflows/spellchecker.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: spell checking -on: # yamllint disable-line rule:truthy - push: - -jobs: - typos: - name: Spell Check with Typos - runs-on: ubuntu-latest - steps: - - name: Checkout Actions Repository - uses: actions/checkout@v4 - - name: typos-action - uses: crate-ci/typos@v1.21.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549fbd5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +megalinter-reports/ diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..c0c7678 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,4 @@ +--- +trailingComma: 'es5' +semi: false +singleQuote: true diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000..f3f500f --- /dev/null +++ b/.vale.ini @@ -0,0 +1,8 @@ +StylesPath = .vale/styles/ + +MinAlertLevel = suggestion + +Packages = RedHat + +[*.md] +BasedOnStyles = Vale, RedHat diff --git a/.vale/styles/README.md b/.vale/styles/README.md new file mode 100644 index 0000000..3aa69be --- /dev/null +++ b/.vale/styles/README.md @@ -0,0 +1,3 @@ +# Vale styles for repository + +Please examine the files \ No newline at end of file diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..13c87f8 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,41 @@ +--- +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +ignore: | + megalinter-reports + +rules: + anchors: enable + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + min-spaces-from-content: 1 + comments-indentation: enable + document-end: disable + document-start: + level: warning + empty-lines: enable + empty-values: disable + float-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: + max: 100 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: false + level: warning + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + allowed-values: ['true', 'false'] + check-keys: false # this one is a nightmare GitHub Actions diff --git a/02-safe/.golangci.yaml b/02-safe/.golangci.yaml new file mode 100644 index 0000000..00e63c1 --- /dev/null +++ b/02-safe/.golangci.yaml @@ -0,0 +1,25 @@ +--- +run: + tests: true + skip-dirs-use-default: true + +linters: + # some linters are enabled by default + # https://golangci-lint.run/usage/linters/ + # + # enable some extra linters + enable: + - gci + - revive + - thelper + +linters-settings: + # define the import orders + gci: + sections: + # Standard section: captures all standard packages. + - standard + # Default section: catchall that is not standard or custom + - default + # linters that related to local tool, so they should be separated + - localmodule diff --git a/02-safe/README.md b/02-safe/README.md new file mode 100644 index 0000000..918f096 --- /dev/null +++ b/02-safe/README.md @@ -0,0 +1,7 @@ +# Empty settings + +One way to use the default settings is to use `--no-config` parameter. + +Another is to create an empty YAML file + +See [.golangci.yaml](.golangci.yaml) diff --git a/README.md b/README.md index c7760b5..8d47112 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # golangci-lint-config-examples + These are .golangci.yml to go based on your need