use checker_state in trailing whitespace style check + add dedicated test#2160
Merged
boegel merged 2 commits intoeasybuilders:developfrom Mar 11, 2017
Merged
use checker_state in trailing whitespace style check + add dedicated test#2160boegel merged 2 commits intoeasybuilders:developfrom
boegel merged 2 commits intoeasybuilders:developfrom
Conversation
wpoely86
approved these changes
Mar 11, 2017
| # keep track of name of last parameter that was defined | ||
| param_def = PARAM_DEF_REGEX.search(line) | ||
| if param_def: | ||
| checker_state['eb_last_key'] = param_def.group('key') |
| comment_re = re.compile(r'^\s*#') | ||
| if comment_re.match(physical_line): | ||
| # apparently this is not the same as physical_line line?! | ||
| line = lines[line_number-1] |
Member
Author
There was a problem hiding this comment.
Because apparently this is not the same as physical_line... I noticed that for the description = line, only the part after the = was included in physical_line...
boegel
commented
Mar 11, 2017
| ({}, None), | ||
| ({'eb_last_key': 'description'}, None), | ||
| ({'eb_last_key': 'description'}, None), | ||
| ({'eb_last_key': 'description'}, (21, "W299 trailing whitespace")), |
Member
Author
There was a problem hiding this comment.
I should change this, I should be specifying the state manually, but just use state = {} before the loop and then pass in state without touching it in the test.
Member
Author
|
Thanks for the review @wpoely86! |
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.
@wpoely86 While working on additional style check for the order of easyconfig parameters, I noticed that we're not using the
checker_statethatpep8supports, which comes in useful in the check for trailing whitespace where we want to ignore trailing whitespace in thedescription...