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

Handling yaml files #16

Merged
merged 4 commits into from
Apr 10, 2018
Merged

Handling yaml files #16

merged 4 commits into from
Apr 10, 2018

Conversation

domanchi
Copy link
Contributor

@domanchi domanchi commented Apr 9, 2018

Part 2/2 for the fix to: #12

@domanchi domanchi requested a review from KevinHock April 9, 2018 19:21
@@ -0,0 +1,9 @@
credentials:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts on badly formatted YAML files? If I'm reading the code right the line-numbers won't be correct but maybe we decide it doesn't matter that much.

e.g.

repos: [
    {repo: ..., sha: ..., hooks: [{id: ...}]},
]

@@ -110,6 +128,44 @@ def _analyze_ini_file(self, file, filename):

return potential_secrets

def _analyze_yaml_file(self, file, filename):
"""
:returns: same format as super().analyze()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe add e.g. :raises: yaml.YAMLError and the same w/ configparser.Error to _analyze_ini_file.

@domanchi domanchi merged commit c54ad3a into master Apr 10, 2018
@domanchi domanchi deleted the handling-yaml-files branch April 10, 2018 19:08
jimmyhlee94 pushed a commit to jimmyhlee94/detect-secrets that referenced this pull request Aug 19, 2021
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.

None yet

2 participants