-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: add recommended field notice #1157
Conversation
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
440a6ae
to
cbef9f8
Compare
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
cbef9f8
to
3b2cef9
Compare
980541c
to
4ee2769
Compare
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
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.
Thanks @KClough! A few things before approval.
@@ -0,0 +1,35 @@ | |||
/* | |||
* Copyright 2020 Google LLC |
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.
Same as in #1151: you can update the copyright if you'd like.
core/src/main/java/org/mobilitydata/gtfsvalidator/parsing/RowParser.java
Outdated
Show resolved
Hide resolved
* | ||
* <p>Severity: {@code SeverityLevel.ERROR} | ||
*/ | ||
public class MissingRecommendedFieldNotice extends ValidationNotice { |
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.
We would need the changes to RULES.md to be done in this PR if possible.
@@ -112,6 +113,14 @@ public String asString(int columnIndex, FieldLevelEnum level) { | |||
noticeContainer.addValidationNotice( | |||
new MissingRequiredFieldNotice( | |||
fileName, row.getRowNumber(), header.getColumnName(columnIndex))); | |||
} else if (level == FieldLevelEnum.RECOMMENDED && s == null) { |
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.
Also, I think we would need unit tests in RowParserTest.java
to test the behavior of asString()
depending on FieldLevelEnum
value.
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.
Good call. I've added some unit tests for both Recommended and Required. Let me know if you'd like me to cover any additional cases.
82edfbb
to
3ad06de
Compare
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
…arser.java Co-authored-by: Maxime Armstrong <46797220+maximearmstrong@users.noreply.github.com>
c7156af
to
2330794
Compare
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
2330794
to
507e50d
Compare
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
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.
LGTM, thank you @KClough!
Summary:
Related #885
Expected behavior:
Adds the recommended field notice.
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything- [ ] Include screenshot(s) showing how this pull request works and fixes the issue(s)