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

Ignore comment lines #4

Merged
merged 1 commit into from Mar 8, 2019
Merged

Ignore comment lines #4

merged 1 commit into from Mar 8, 2019

Conversation

srabraham
Copy link
Contributor

Currently there's a bug where a comment line including a colon matches
as an option, breaking the parser. The Python spec says that a comment
starts with a "#" or ";" and can be preceded by whitespace, so
^\s*[#;].*$ seems like a suitable regex.

https://docs.python.org/3/library/configparser.html#supported-ini-file-structure

Currently there's a bug where a comment line including a colon matches
as an option, breaking the parser. The Python spec says that a comment
starts with a "#" or ";" and can be preceded by whitespace, so
`^\s*[#;].*$` seems like a suitable regex.

https://docs.python.org/3/library/configparser.html#supported-ini-file-structure
@mvo5
Copy link
Owner

mvo5 commented Mar 8, 2019

Thanks for this PR! Indeed, this is a bug in the code and you PR looks great.

@mvo5 mvo5 merged commit 6a365a5 into mvo5:master Mar 8, 2019
zchee pushed a commit to unofficial-mirror/chromiumos-infra-go that referenced this pull request Nov 20, 2019
The original author accepted my pull request to fix his code's issue
with comments that include a ":". mvo5/goconfigparser#4

TEST=Ran it manually. This is a contrib directory.

Change-Id: I5dfef6f73e324cdf401d28b1feb71c94e94d3201
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/test_planner/+/1511728
Reviewed-by: Andrew Lamb <andrewlamb@chromium.org>
Commit-Queue: Sean Abraham <seanabraham@chromium.org>
Tested-by: Sean Abraham <seanabraham@chromium.org>
Trybot-Ready: Sean Abraham <seanabraham@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/go/+/1679298
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
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