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

ParserFile: Allow comments in settings file #358

Conversation

olleolleolle
Copy link
Collaborator

  • Ruby-style or semi-colon-style accepted in the .github_changelog_generator settings file.

Other non-setting-like lines are still reported as failures to parse.

@olleolleolle olleolleolle force-pushed the feature/parserfile-allow-comments branch 2 times, most recently from adc1695 to cc0b5eb Compare March 19, 2016 15:49
  - Ruby-style or semi-colon-style accepted
@olleolleolle olleolleolle force-pushed the feature/parserfile-allow-comments branch from cc0b5eb to 4569fad Compare March 19, 2016 15:50
@olleolleolle
Copy link
Collaborator Author

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
@olleolleolle
Copy link
Collaborator Author

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]+$/
Copy link
Member

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.

Copy link
Collaborator Author

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?

skywinder added a commit that referenced this pull request Mar 21, 2016
…mments

ParserFile: Allow comments in settings file
@skywinder skywinder merged commit 6d9fcf2 into github-changelog-generator:master Mar 21, 2016
@skywinder
Copy link
Member

Got it! Git it!

@olleolleolle olleolleolle deleted the feature/parserfile-allow-comments branch March 21, 2016 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants