Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#467: Catch ValueError - Audit #568

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

jpdakran
Copy link
Member

Problem:

  • There is an existing issue with the YAML file parser with respect to block vs literal style
  • This causes secret line numbers to be 1 off the actual line number
  • When performing an audit - and the secret line number is off by 1, an error causing the tool to fail occurs since the secret cannot be found on that line

Solution:

  • Catch the error when we cannot find the secret on that specified line
  • Will be looking into how to fix the YAML parser to accomodate for block vs literal styles

… is not found on that line, instead of breaking the tool
@jpdakran jpdakran linked an issue Jun 22, 2022 that may be closed by this pull request
@jpdakran jpdakran merged commit b261af9 into master Jun 23, 2022
clonejo added a commit to clonejo/detect-secrets that referenced this pull request Nov 6, 2022
- move try-except up the stack, so we actually have a line number and
  not only the column
- also catch IndexError (eg. if the file has fewer lines than
  secret.line_number)
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.

ValueError: substring not found
3 participants