From c9f7c7593c02e67320f11da629b4424e9a7c4ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 19 Apr 2022 18:28:02 +0200 Subject: [PATCH 01/21] Add megalint to project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9493168472..997cd9ef6f 100644 --- a/Makefile +++ b/Makefile @@ -92,4 +92,9 @@ help: ## Display this help screen. test-scanner: make test -C $(SCANNERS_DIR)/$(target) test-hook: - make test -C $(HOOKS_DIR)/$(target) \ No newline at end of file + make test -C $(HOOKS_DIR)/$(target) + + +.PHONY: +megalint: + npx mega-linter-runner \ No newline at end of file From 37ec2eb7c4017e01a95b1b88b27963b6af74411b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 19 Apr 2022 18:51:59 +0200 Subject: [PATCH 02/21] Add megalint config files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .cspell.json | 15 ++++++ .github/workflows/mega-linter.yml | 82 +++++++++++++++++++++++++++++++ .gitignore | 4 ++ .mega-linter.yml | 12 +++++ 4 files changed, 113 insertions(+) create mode 100644 .cspell.json create mode 100644 .github/workflows/mega-linter.yml create mode 100644 .mega-linter.yml diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000000..c312eab451 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,15 @@ +{ + "ignorePaths": [ + "**/node_modules/**", + "**/vscode-extension/**", + "**/.git/**", + ".vscode", + "megalinter", + "package-lock.json", + "report" + ], + "language": "en", + "noConfigSearch": true, + "words": [], + "version": "0.2" +} diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml new file mode 100644 index 0000000000..a38d06c104 --- /dev/null +++ b/.github/workflows/mega-linter.yml @@ -0,0 +1,82 @@ +--- +# 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: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Set 'true' if you always want to lint all sources + 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 + + # Create pull request if applicable (for now works only on PR from same repository, not from forks) + - name: Create Pull Request with applied fixes + id: cpr + if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + commit-message: "[MegaLinter] Apply linters automatic fixes" + title: "[MegaLinter] Apply linters automatic fixes" + labels: bot + - name: Create PR output + if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + + # Push new commit if applicable (for now works only on PR from same repository, not from forks) + - name: Prepare commit + if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') + run: sudo chown -Rc $UID .git/ + - name: Commit and push applied linter fixes + if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} + commit_message: "[MegaLinter] Apply linters fixes" diff --git a/.gitignore b/.gitignore index 13524d4da8..752435a286 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,7 @@ tags [._]*.un~ # End of https://www.toptal.com/developers/gitignore/api/vim + + +# Megalint report dir +report diff --git a/.mega-linter.yml b/.mega-linter.yml new file mode 100644 index 0000000000..b3127d6193 --- /dev/null +++ b/.mega-linter.yml @@ -0,0 +1,12 @@ +# 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 + # - SPELL # Uncomment to disable checks of spelling mistakes +SHOW_ELAPSED_TIME: true +FILEIO_REPORTER: false +DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass From 7600b2d46aceae81bd90d0c15b394448a679c9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 19 Apr 2022 18:56:14 +0200 Subject: [PATCH 03/21] Fix megalint workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index a38d06c104..fcc53d8078 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -40,7 +40,7 @@ jobs: env: # All available variables are described in documentation # https://megalinter.github.io/configuration/ - VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Set 'true' if you always want to lint all sources + VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Set 'true' if you always want to lint all sources GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY From cdf96fab93894dcd20e68c97bcda7edd61179ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 22:14:03 +0200 Subject: [PATCH 04/21] Lint only changed files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 997cd9ef6f..21789e6b6e 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,12 @@ test-hook: make test -C $(HOOKS_DIR)/$(target) +# only lints changed files .PHONY: -megalint: +lint: + npx mega-linter-runner --env VALIDATE_ALL_CODEBASE=false + +# lints every file in the repo +.PHONY: +lintall: npx mega-linter-runner \ No newline at end of file From 909317628da77f142bf93c7cd2d47c0e769509d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 22:15:38 +0200 Subject: [PATCH 05/21] Only lint changed files in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index fcc53d8078..6f752cc8fd 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -40,7 +40,7 @@ jobs: env: # All available variables are described in documentation # https://megalinter.github.io/configuration/ - VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Set 'true' if you always want to lint all sources + 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 From efe8e83f894d1c46d297700faee0f5aa20e2ff82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 22:16:03 +0200 Subject: [PATCH 06/21] Remove unused CI steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .github/workflows/mega-linter.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 6f752cc8fd..f37d0bf96e 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -53,30 +53,3 @@ jobs: path: | report mega-linter.log - - # Create pull request if applicable (for now works only on PR from same repository, not from forks) - - name: Create Pull Request with applied fixes - id: cpr - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} - commit-message: "[MegaLinter] Apply linters automatic fixes" - title: "[MegaLinter] Apply linters automatic fixes" - labels: bot - - name: Create PR output - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" - - # Push new commit if applicable (for now works only on PR from same repository, not from forks) - - name: Prepare commit - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') - run: sudo chown -Rc $UID .git/ - - name: Commit and push applied linter fixes - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') - uses: stefanzweifel/git-auto-commit-action@v4 - with: - branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} - commit_message: "[MegaLinter] Apply linters fixes" From 95e8b923aee848597ae3585ef11b8b9690301068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 22:37:10 +0200 Subject: [PATCH 07/21] Add words to spellchecker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .cspell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index c312eab451..fcd0f38100 100644 --- a/.cspell.json +++ b/.cspell.json @@ -10,6 +10,6 @@ ], "language": "en", "noConfigSearch": true, - "words": [], + "words": ["secureCodeBox", "kubernetes"], "version": "0.2" } From c44dee1a24b47dd5a79bb45ba8a1df5f78287434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 22:37:39 +0200 Subject: [PATCH 08/21] Move config from Makefile to yaml file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 3 ++- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index b3127d6193..121385a11b 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -8,5 +8,6 @@ DISABLE: - COPYPASTE # Comment to enable checks of excessive copy-pastes # - SPELL # Uncomment to disable checks of spelling mistakes SHOW_ELAPSED_TIME: true -FILEIO_REPORTER: false DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass +FILTER_REGEX_EXCLUDE: (.*\.md) +VALIDATE_ALL_CODEBASE: false diff --git a/Makefile b/Makefile index 21789e6b6e..4c763d5a40 100644 --- a/Makefile +++ b/Makefile @@ -98,9 +98,9 @@ test-hook: # only lints changed files .PHONY: lint: - npx mega-linter-runner --env VALIDATE_ALL_CODEBASE=false + npx mega-linter-runner # lints every file in the repo .PHONY: lintall: - npx mega-linter-runner \ No newline at end of file + npx mega-linter-runner --env VALIDATE_ALL_CODEBASE=true From a2841a040bc8a7bc22148c1d61aee8d1f421884d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 22:47:26 +0200 Subject: [PATCH 09/21] Change comment to fix make help MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4c763d5a40..ce917258ba 100644 --- a/Makefile +++ b/Makefile @@ -95,12 +95,10 @@ test-hook: make test -C $(HOOKS_DIR)/$(target) -# only lints changed files .PHONY: -lint: +lint: ## Lint only changed files with respect to main branch npx mega-linter-runner -# lints every file in the repo .PHONY: -lintall: +lintall: ## Lint complete repo npx mega-linter-runner --env VALIDATE_ALL_CODEBASE=true From b79b24ff170ca37010c754a3e6644194e06a5723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Tue, 26 Apr 2022 23:07:51 +0200 Subject: [PATCH 10/21] Add message at end of linting explaining where logs can be found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index ce917258ba..014d766c4a 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,9 @@ test-hook: .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: 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" From 9afd170aa12d3b25da624ab98ffe6fe8480dc892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Thu, 28 Apr 2022 18:03:48 +0200 Subject: [PATCH 11/21] Add autogenerated files to ignore list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 121385a11b..29efbc45a6 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -9,5 +9,7 @@ DISABLE: # - SPELL # Uncomment to disable checks of spelling mistakes SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass -FILTER_REGEX_EXCLUDE: (.*\.md) + +# ignore autogenerated markdown files and files generated by controller-gen +FILTER_REGEX_EXCLUDE: (.*.md|.*rbac/role\.yaml|.*bases/.*\.yaml) VALIDATE_ALL_CODEBASE: false From 7fac4528b5485891f1c90963d984c9ef01935bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 11:50:22 +0200 Subject: [PATCH 12/21] Disable alpaca MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index 29efbc45a6..734c706e92 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -13,3 +13,7 @@ DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not # ignore autogenerated markdown files and files generated by controller-gen FILTER_REGEX_EXCLUDE: (.*.md|.*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 \ No newline at end of file From 7507aa5f0548fc4076427396cfd9219455b2bcde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 13:00:17 +0200 Subject: [PATCH 13/21] Disable javascript standard linter and rename eslintrc to enable eslint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .eslintrc => .eslintrc.json | 0 .mega-linter.yml | 3 +++ 2 files changed, 3 insertions(+) rename .eslintrc => .eslintrc.json (100%) diff --git a/.eslintrc b/.eslintrc.json similarity index 100% rename from .eslintrc rename to .eslintrc.json diff --git a/.mega-linter.yml b/.mega-linter.yml index 734c706e92..ed768d46f5 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -7,6 +7,9 @@ APPLY_FIXES: none # all, none, or list of linter keys DISABLE: - COPYPASTE # Comment to enable checks of excessive copy-pastes # - SPELL # Uncomment to disable checks of spelling mistakes +DISABLE_LINTERS: + - JAVASCRIPT_STANDARD # standard is a javascript linter that by design can not be configured in any way. This project uses eslint anyway. + SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass From e493074eb620ddd1b0ae2606167a7ee74e6f7e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 13:03:49 +0200 Subject: [PATCH 14/21] Disable markdown linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index ed768d46f5..e97cb9a879 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -6,15 +6,16 @@ APPLY_FIXES: none # all, none, or list of linter keys # 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 # - SPELL # Uncomment to disable checks of spelling mistakes DISABLE_LINTERS: - - JAVASCRIPT_STANDARD # standard is a javascript linter that by design can not be configured in any way. This project uses eslint anyway. + - JAVASCRIPT_STANDARD # standard is a javascript linter that by design can not be configured in any way. This project uses eslint anyways. SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass -# ignore autogenerated markdown files and files generated by controller-gen -FILTER_REGEX_EXCLUDE: (.*.md|.*rbac/role\.yaml|.*bases/.*\.yaml) +# ignore files generated by controller-gen +FILTER_REGEX_EXCLUDE: (.*rbac/role\.yaml|.*bases/.*\.yaml) VALIDATE_ALL_CODEBASE: false IGNORE_GENERATED_FILES: true From 5d3de4c4d61f2d73ff32e74bfd5378ed0248bc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 13:29:20 +0200 Subject: [PATCH 15/21] Disable cspell linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index e97cb9a879..3edeab6749 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -10,6 +10,7 @@ DISABLE: # - SPELL # Uncomment to disable checks of spelling mistakes DISABLE_LINTERS: - JAVASCRIPT_STANDARD # standard is a javascript 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 SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass From dd3074187c236a53ab50ac89f3f41b414f69f367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 13:46:33 +0200 Subject: [PATCH 16/21] Disable credential linters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 3edeab6749..f74420fe77 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -7,7 +7,7 @@ APPLY_FIXES: none # all, none, or list of linter keys DISABLE: - COPYPASTE # Comment to enable checks of excessive copy-pastes - MARKDOWN # Disable markdown as the readmes are generated automatically - # - SPELL # Uncomment to disable checks of spelling mistakes + - 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. - 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 From c4e1c646cd4f0ecb9c3597420225e7758800af1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 15:18:19 +0200 Subject: [PATCH 17/21] Disable editorconfig linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index f74420fe77..c4baf0cf70 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -11,6 +11,7 @@ DISABLE: DISABLE_LINTERS: - JAVASCRIPT_STANDARD # standard is a javascript 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 # this linter complains about non important stuff like tabs instead of spaces etc. Disabled because its annoying SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass From 89b37d981c21630a1e9c393fa3004e8fd6545370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 15:46:18 +0200 Subject: [PATCH 18/21] Add lintfix make target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 014d766c4a..414e1ca729 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,11 @@ 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 From 99930f1f344f0e20831584a78f7332bf60896a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 15:50:49 +0200 Subject: [PATCH 19/21] Disable mypy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index c4baf0cf70..b27579813c 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -12,6 +12,7 @@ DISABLE_LINTERS: - JAVASCRIPT_STANDARD # standard is a javascript 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 # 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 From 9e362c6d6f269f6a6a40db825b5f5be65464baab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Fri, 29 Apr 2022 15:59:36 +0200 Subject: [PATCH 20/21] Acutally disable editorconfig linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index b27579813c..8516da0e1d 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -11,7 +11,7 @@ DISABLE: DISABLE_LINTERS: - JAVASCRIPT_STANDARD # standard is a javascript 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 # this linter complains about non important stuff like tabs instead of spaces etc. Disabled because its annoying + - 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 From 3f7b71a28c2e695441aceeb74d0b23d7899ea319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Sat, 30 Apr 2022 19:46:20 +0200 Subject: [PATCH 21/21] Disable typescript standard linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index 8516da0e1d..d22ae6a30c 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -10,6 +10,7 @@ DISABLE: - 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