-
Notifications
You must be signed in to change notification settings - Fork 35
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
apply ValuePemPatternCheck for PEM rule #367
Conversation
5c6c7fc
to
a50a938
Compare
@@ -58,15 +60,12 @@ def is_pem_key(cls, lines: List[str], config: Config) -> bool: | |||
lines = cls.strip_lines(lines) | |||
lines = cls.remove_leading_config_lines(lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About checking line length is over 190
or not, this method remove_leading_config_lines()
can reduce size of lines
.
So isn't it good to just remain line length check code here?
Like below.
for line_num, line in enumerate(lines): | ||
if line_num >= 190: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(lines) >= 190:
return False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opposite. It will skip huge files.
```remove_leading_config_lines`` does not trim ending so there might be a long tail over 190 lines with remaining.
If the key will be not found in given 190 lines - it returns False at end of function.
Closing due many conflicts. All the changes will be in #373 |
Description
REVIEW AFTER #370 !!!
Please include a summary of the change and which is fixed.
How has this been tested?
Please describe the tests that you ran to verify your changes.