diff --git a/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot b/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot index 4fe2209ca..e5b0d64c0 100644 --- a/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot +++ b/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot @@ -26,6 +26,15 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/Dockerfile.empty", + ], + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", @@ -44,6 +53,15 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/nested/Dockerfile.debug", + ], + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", @@ -72,6 +90,16 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/Dockerfile.empty", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", @@ -92,6 +120,16 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/nested/Dockerfile.debug", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", diff --git a/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot b/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot index 4fe2209ca..e5b0d64c0 100644 --- a/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot +++ b/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot @@ -26,6 +26,15 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/Dockerfile.empty", + ], + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", @@ -44,6 +53,15 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/nested/Dockerfile.debug", + ], + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", @@ -72,6 +90,16 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/Dockerfile.empty", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", @@ -92,6 +120,16 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, + { + "command": "lint", + "fileGroupName": "docker", + "linter": "hadolint", + "paths": [ + "test_data/nested/Dockerfile.debug", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, { "command": "lint", "fileGroupName": "docker", diff --git a/linters/plugin.yaml b/linters/plugin.yaml index c57210920..e6fa05042 100644 --- a/linters/plugin.yaml +++ b/linters/plugin.yaml @@ -221,8 +221,7 @@ lint: # ?: is a non-capturing group, so that the RE2 DFA is more memory efficient # NOTE(Tyler): This is more strict than it realistically needs to be, but this partial match # and the file extensions provide a general enough capture. - # Note that re2 does not support ?!, so this does not capture all correct cases. - - (?i)(?:^|/)Dockerfile\.(?!.*\.dockerignore$).+$ + - (?i)(?:^|/)Dockerfile\..+$ filenames: - dockerfile - Dockerfile @@ -707,3 +706,6 @@ lint: - linters: [osv-scanner] paths: ["**/go.sum"] + + - linters: [checkov, hadolint, snyk, terrascan, trivy] + paths: ["**/*.dockerignore"]