-
-
Notifications
You must be signed in to change notification settings - Fork 847
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
ParserFile: Allow comments in settings file #358
ParserFile: Allow comments in settings file #358
Conversation
adc1695
to
cc0b5eb
Compare
- Ruby-style or semi-colon-style accepted
cc0b5eb
to
4569fad
Compare
It just occurred to me: a blank line, or a line of only whitespace, should also be skipped and ignored (not a failure). |
- defined as: lines that consist only of whitespace
OK, @skywinder - ready for review! |
option_name, value = extract_pair(line) | ||
@options[option_key_for(option_name)] = convert_value(value, option_name) | ||
rescue | ||
raise ParserError, "Failed on line ##{line_number}: \"#{line.gsub(/[\n\r]+/, '')}\"" | ||
end | ||
|
||
# Returns true if the line starts with a pound sign or a semi-colon. | ||
def non_configuration_line?(line) | ||
line =~ /^[\#;]/ || line =~ /^[\s]+$/ |
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.
All good. Just question about ";"-comment syntax:
Why strings, starts from ;
should specified as comment?
First time, when see such syntax.
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.
INI files have those comments?
…mments ParserFile: Allow comments in settings file
Got it! Git it! |
.github_changelog_generator
settings file.Other non-setting-like lines are still reported as failures to parse.