Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/vscode-extension/**",
"**/.git/**",
".vscode",
"megalinter",
"package-lock.json",
"report"
],
"language": "en",
"noConfigSearch": true,
"words": ["secureCodeBox", "kubernetes"],
"version": "0.2"
}
File renamed without changes.
55 changes: 55 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.github.io
name: MegaLinter

on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
pull_request:
branches: [master, main]

env: # Comment env block if you do not want to apply fixes
# Apply linter fixes configuration
APPLY_FIXES: none # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

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

jobs:
build:
name: MegaLinter
runs-on: ubuntu-latest
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0

# MegaLinter
- name: MegaLinter
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.github.io/flavors/
uses: megalinter/megalinter@v5
env:
# All available variables are described in documentation
# https://megalinter.github.io/configuration/
VALIDATE_ALL_CODEBASE: false # only lint changed files
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY

# Upload MegaLinter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: MegaLinter reports
path: |
report
mega-linter.log
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ tags
[._]*.un~

# End of https://www.toptal.com/developers/gitignore/api/vim


# Megalint report dir
report
27 changes: 27 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configuration file for MegaLinter
# See all available variables at https://megalinter.github.io/configuration/ and in linters documentation

APPLY_FIXES: none # all, none, or list of linter keys
# ENABLE: # If you use ENABLE variable, all other languages/formats/tooling-formats will be disabled by default
# ENABLE_LINTERS: # If you use ENABLE_LINTERS variable, all other linters will be disabled by default
DISABLE:
- COPYPASTE # Comment to enable checks of excessive copy-pastes
- MARKDOWN # Disable markdown as the readmes are generated automatically
- CREDENTIALS # Disable checks for credentials, as there are some false positives in the repo for documentation purposes (e.g demo-targets)
DISABLE_LINTERS:
- JAVASCRIPT_STANDARD # standard is a javascript linter that by design can not be configured in any way. This project uses eslint anyways.
- TYPESCRIPT_STANDARD # standard is a typescript linter that by design can not be configured in any way. This project uses eslint anyways.
- SPELL_CSPELL # disable cspell because if finds way to many false positives and it would be way to much work to exclude all false positives
- EDITORCONFIG_EDITORCONFIG_CHECKER # this linter complains about non important stuff like tabs instead of spaces etc. Disabled because its annoying
- PYTHON_MYPY # fails because missing cache file "error: --install-types failed (no mypy cache directory)". See https://github.com/python/mypy/issues/10600#issuecomment-857351152

SHOW_ELAPSED_TIME: true
DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass

# ignore files generated by controller-gen
FILTER_REGEX_EXCLUDE: (.*rbac/role\.yaml|.*bases/.*\.yaml)
VALIDATE_ALL_CODEBASE: false
IGNORE_GENERATED_FILES: true

# disable useless alpaca ascii art that gets printed at the start of the linting
PRINT_ALPACA: false
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,20 @@ help: ## Display this help screen.
test-scanner:
make test -C $(SCANNERS_DIR)/$(target)
test-hook:
make test -C $(HOOKS_DIR)/$(target)
make test -C $(HOOKS_DIR)/$(target)


.PHONY:
lint: ## Lint only changed files with respect to main branch
npx mega-linter-runner
@printf "\033[36m\n\n\nThe generated reports can be found under ./report/linters_logs/ \n\n\033[0m"

.PHONY:
lintfix: ## Lint only changed files with respect to main branch and apply automatic fixes if possible
npx mega-linter-runner --fix
@printf "\033[36m\n\n\nThe generated reports can be found under ./report/linters_logs/ \n\n\033[0m"

.PHONY:
lintall: ## Lint complete repo
npx mega-linter-runner --env VALIDATE_ALL_CODEBASE=true
@printf "\033[36m\n\n\nThe generated reports can be found under ./report/linters_logs/ \n\n\033[0m"