Properly scan files in a PR using Checkov - #8910
Merged
Merged
Conversation
Fix syntax error in CheckovLinter.py by correcting if statement and removing unnecessary self references.
bdovaz
requested review from
Kurt-von-Laven,
echoix and
nvuillam
as code owners
September 7, 2026 06:41
Fix syntax error in CheckovLinter.py by adding missing colon.
Contributor
✅
|
echoix
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #8881
The issue mentioned performance in v10, but it was actually “Checkov's fault”. Theoretically, in pull requests, it should only scan the changed files, but in practice, this wasn't the case because even though I added “--file file1 file2 ...,” it didn't remove the “--directory .” from:
megalinter/megalinter/descriptors/repository.megalinter-descriptor.yml
Line 56 in 3eba46a
So it ends up scanning the entire repository anyway.
It must have been a regression that I probably introduced when I refactored the linters and descriptors with the lint_modes, because it didn't happen in the original PR: #7119.
As a temporary workaround until you release v10.2.0, I've done the following:
In my mega-linter.yml that I use only for PRs with EXTENDS.