这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@thentenaar
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

In case the repo has been checked out to a path that inadvertently matches one of the excluded directory patterns (i.e. .git), we should check for it, and escape the pattern via re.escape() instead of just escaping the leading '.' in '.terraform'.

Otherwise, this causes some tests to fail if the repo is checked out to ~/git/checkov, as this would match the '.git' excluded directory by virtue of the leading '.' not being escaped.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

…begin with '.'

In case the repo has been checked out to a path that inadvertently
matches one of the excluded directory patterns (i.e. .git), we should
check for it, and escape the pattern via ``re.escape()`` instead of just
escaping the leading '.' in '.terraform'.

Otherwise, this causes some tests to fail if the repo is checked out to
``~/git/checkov``, as this would match the '.git' excluded directory by
virtue of the leading '.' not being escaped.
@tsmithv11 tsmithv11 merged commit 7989dd6 into bridgecrewio:main Apr 24, 2025
42 of 43 checks passed
Saarett pushed a commit that referenced this pull request Apr 24, 2025
…begin with '.' (#7112)

In case the repo has been checked out to a path that inadvertently
matches one of the excluded directory patterns (i.e. .git), we should
check for it, and escape the pattern via ``re.escape()`` instead of just
escaping the leading '.' in '.terraform'.

Otherwise, this causes some tests to fail if the repo is checked out to
``~/git/checkov``, as this would match the '.git' excluded directory by
virtue of the leading '.' not being escaped.
Saarett pushed a commit that referenced this pull request Apr 24, 2025
…begin with '.' (#7112)

In case the repo has been checked out to a path that inadvertently
matches one of the excluded directory patterns (i.e. .git), we should
check for it, and escape the pattern via ``re.escape()`` instead of just
escaping the leading '.' in '.terraform'.

Otherwise, this causes some tests to fail if the repo is checked out to
``~/git/checkov``, as this would match the '.git' excluded directory by
virtue of the leading '.' not being escaped.
@thentenaar thentenaar deleted the base-runner-regex branch May 9, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants