Skip to content

Commit

Permalink
feat(ci): add linters and stuff
Browse files Browse the repository at this point in the history
Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Nov 19, 2024
1 parent bf1f64b commit 6003c48
Show file tree
Hide file tree
Showing 6 changed files with 321 additions and 0 deletions.
183 changes: 183 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
{
"ignorePaths": [
"**/*.defconfig",
"**/.git/**",
"**/node_modules/**",
"**/vscode-extension/**",
".cspell.json",
".editorconfig",
".flake8",
".github/dependabot.yml",
".github/workflows/documentation-pages.yml",
".gitignore",
".goreleaser.yaml",
".mega-linter.yml",
".pylintrc",
".ruff.toml",
".trivy.yaml",
".vscode",
"CHANGELOG.md",
"LICENSE",
"Taskfile.yml",
"docker/**",
"docs/book.toml",
"docs/mdbook-admonish.css",
"docs/theme/index.hbs",
"docs/theme/pagetoc.css",
"docs/theme/pagetoc.js",
"go.mod",
"go.sum",
"megalinter",
"package-lock.json",
"pyproject.toml",
"report",
"requirements.txt",
"tests/**"
],
"language": "en",
"noConfigSearch": true,
"words": [
"BOOTLOADER",
"BUILDGCC",
"CPUS",
"GOARCH",
"HEALTHCHECK",
"Hadolint",
"IPXE",
"NOTSET",
"REPOPATH",
"TARGETARCH",
"TOOLSDIR",
"Taskfile",
"acpica",
"addinivalue",
"addoption",
"automerge",
"autopep",
"blkio",
"bsdmainutils",
"cbfstool",
"clusterfuck",
"cmds",
"cocogitto",
"commitlint",
"composefile",
"coreboot",
"coreinfo",
"covermode",
"coverprofile",
"cpio",
"crossgcc",
"daggerci",
"defconfig",
"delenv",
"dirpath",
"distclean",
"dockerfile",
"dockerfiles",
"dooper",
"dotconfig",
"dpkg",
"edkii",
"elif",
"emeraldlake",
"exitcode",
"githubaction",
"githubactions",
"gocyclo",
"golangci",
"gorecurcopy",
"goreleaser",
"iasl",
"ifdtool",
"inargs",
"iucode",
"kbuild",
"kconfig",
"kernelbuild",
"levelname",
"libelf",
"libncurses",
"libnss",
"logdir",
"mainboard",
"mainboarddir",
"markdownlint",
"megalinter",
"menuconfig",
"modifyitems",
"mountpoint",
"multilib",
"nasm",
"naturalsize",
"nolint",
"noninteractive",
"nonosi",
"nproc",
"nvramcui",
"olddefconfig",
"opencontainers",
"oxsecurity",
"pacman",
"pwsh",
"pyaload",
"pylint",
"pytest",
"rdparty",
"rootdir",
"runslow",
"rustup",
"savedefconfig",
"seabios",
"setenv",
"sethvargo",
"shellcheck",
"skipframes",
"sloglint",
"startswith",
"stmsg",
"testregex",
"textfile",
"tianocore",
"tinyconfig",
"tzdata",
"uefi",
"uroot",
"vmlinux",
"wagoid",
"workdir",
"worktree",
"xgcc"
],
"ignoreWords": [
"Eeuo",
"Kengo",
"Ovmf",
"TODA",
"aarch",
"agrc",
"alecthomas",
"anyio",
"bugbundle",
"coveragerc",
"dawidd",
"defaultsh",
"dorny",
"dumpversion",
"edksetup",
"genqlient",
"gnueabi",
"heimdalr",
"hhmmss",
"htmlcov",
"ldflags",
"mypy",
"opengrabeso",
"prettytable",
"stretchr",
"unxz",
"wholename",
"xvzf"
],
"version": "0.2"
}
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# EditorConfig: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
charset = utf-8
indent_style = tab

[*.py]
indent_style = space
indent_size = 4

[*.{json,yml,yaml,js,mjs,css}]
indent_style = space
indent_size = 2

[Dockerfile]
indent_style = space
indent_size = 4

[{*.md,.pylintrc,index.hbs,LICENSE}]
indent_style = unset
indent_size = unset
generated_code = true

13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
time: '00:00'
groups:
github:
update-types:
- 'minor'
- 'patch'
28 changes: 28 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
bugfix:
- head-branch:
- '^fix'
github_actions:
- any:
- changed-files:
- any-glob-to-any-file:
- '.github/workflows/**'
- head-branch:
- '^ci'
coreboot:
- any:
- changed-files:
- any-glob-to-any-file:
- 'coreboot/**'
testing:
- any:
- changed-files:
- any-glob-to-any-file:
- '.cspell.json'
- '.mega-linter.yml'
- head-branch:
- '^test'
feature:
- any:
- head-branch:
- '^feat'
- '^feature'
52 changes: 52 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# Run linters

name: lint
on:
pull_request:
pull_request_review:
types: ['submitted']
merge_group:
push:
branches: ['main']
tags: ['v*']

env:
APPLY_FIXES: none
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_MODE: commit
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true

permissions:
contents: read

jobs:
commit-lint:
runs-on: ubuntu-latest
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') }}
# Skip if pull_request_review on PR not made by a bot
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Commit-Lint
uses: wagoid/commitlint-github-action@v6
with:
configFile: .commitlint.config.mjs
megalinter:
runs-on: ubuntu-latest
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') }}
# Skip if pull_request_review on PR not made by a bot
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: MegaLinter
uses: oxsecurity/megalinter/flavors/cupcake@v8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
17 changes: 17 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
APPLY_FIXES: all
DISABLE:
- COPYPASTE
DISABLE_LINTERS:
- CSS_STYLELINT
- GO_GOLANGCI_LINT
- REPOSITORY_KICS
- SPELL_LYCHEE
- REPOSITORY_TRIVY
SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: false

# Spelling
SPELL_CSPELL_ANALYZE_FILE_NAMES: false

# yaml v8r
YAML_V8R_DISABLE_ERRORS: true

0 comments on commit 6003c48

Please sign in to comment.