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
Descriptive error with exact path in json #48
base: dev
Are you sure you want to change the base?
Conversation
- lint() method in LintRunner will lint the files without returning anything - ReportRunner will generate the report based upon input error data
Fixed test cases Updated readme
@@ -32,7 +34,7 @@ | |||
*/ | |||
public String report(T t) throws NoReportSetException { | |||
if (reportMessage == null) { | |||
throw new NoReportSetException("No Report Message Set When Lint Error Found"); | |||
throw new NoReportSetException("No Report Message Set When Lint LintError Found"); |
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.
this should be when LintError found not Lint LintError
@@ -11,6 +11,8 @@ | |||
*/ | |||
private String reportMessage; | |||
|
|||
private String path; |
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.
what is this used for?
@@ -29,4 +32,25 @@ static WrappedObject getWrappedObject(String originatingKey, | |||
} | |||
return wrappedObject; | |||
} | |||
|
|||
public static String getPath(WrappedObject element) { |
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.
can we make this a list instead of string separated by a '.' as discussed offline
|
||
@Test | ||
public void lintRunnerShouldValidErrorForWrappedPrimitive() throws Exception { | ||
LintRule lintRule = new LintRule.Builder() |
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.
Can pull out lintRule and hold on as a LintRule.Builder and only make implementation to avoid all the duplication in these tests
|
||
public class LintError { | ||
|
||
private final String jsonPath; |
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.
Can we use this in the RB? We are allowing us to get this info but not using it at all in reporting
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the current behavior? (You can also link to an open issue here)
Currently we get all the error message caused in a file. It is difficult for user to pin point the exact location.
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Updated Doc for more info.
Other information: