From 4bb9eb68fce8116a95ebdec824c968c4affbc9f7 Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Tue, 12 Sep 2023 13:09:41 -0700 Subject: [PATCH] Don't autoenable gokart and tfsec (#470) We had originally been pretty aggressive in auto-enabling/suggesting security linters, however there are 2 modifications that should no longer be auto-enabled: - tfsec is migrating to trivy, so we don't want to auto-enable tfsec anymore - gokart has the potential to [fail](https://github.com/praetorian-inc/gokart/issues/88) in a large number of repos, for example [failing](https://github.com/trunk-io/trunk-action/actions/runs/6156480974/job/16705375836?pr=186) in the [tflint repo](https://github.com/terraform-linters/tflint), and it's not very actively maintained, so for now we won't enable it --- linters/gokart/plugin.yaml | 2 +- linters/gokart/test_data/go.mod | 2 +- linters/tfsec/plugin.yaml | 2 +- tests/repo_tests/config_check.test.ts | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linters/gokart/plugin.yaml b/linters/gokart/plugin.yaml index bb3350329..07ea8bc6b 100644 --- a/linters/gokart/plugin.yaml +++ b/linters/gokart/plugin.yaml @@ -11,7 +11,7 @@ lint: - name: gokart files: [go] tools: [gokart] - suggest_if: files_present + suggest_if: config_present environment: - name: PATH list: ["${linter}"] diff --git a/linters/gokart/test_data/go.mod b/linters/gokart/test_data/go.mod index c1557f323..7fdc26c33 100644 --- a/linters/gokart/test_data/go.mod +++ b/linters/gokart/test_data/go.mod @@ -1,3 +1,3 @@ module gokart_linter_test -go 1.19 +go 1.21.1 diff --git a/linters/tfsec/plugin.yaml b/linters/tfsec/plugin.yaml index da3d5e557..233a2558b 100644 --- a/linters/tfsec/plugin.yaml +++ b/linters/tfsec/plugin.yaml @@ -28,7 +28,7 @@ lint: files: [terraform] tools: [tfsec] known_good_version: 1.28.1 - suggest_if: files_present + suggest_if: never commands: - name: lint output: sarif diff --git a/tests/repo_tests/config_check.test.ts b/tests/repo_tests/config_check.test.ts index 1eeea424e..350ec7747 100644 --- a/tests/repo_tests/config_check.test.ts +++ b/tests/repo_tests/config_check.test.ts @@ -149,7 +149,6 @@ describe("Global config health check", () => { "dotenv-linter", "git-diff-check", "gofmt", - "gokart", "golangci-lint", "hadolint", "haml-lint", @@ -168,7 +167,6 @@ describe("Global config health check", () => { "taplo", "terrascan", "tflint", - "tfsec", "trivy", "trufflehog", "yamllint",