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

Make sure lint results follow phab api specs #191

Merged
merged 5 commits into from
Dec 8, 2016
Merged

Conversation

jjx
Copy link
Contributor

@jjx jjx commented Dec 8, 2016

Phab API specs does not require these 2 params. By forcefully casting the object we get back from json, we are inherently enforcing requirement.

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2016

CLA assistant check
All committers have signed the CLA.

@jjx
Copy link
Contributor Author

jjx commented Dec 8, 2016

@sectioneight @kageiit

Copy link
Contributor

@ascandella ascandella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression test?

(Integer) json.get("line"),
(Integer) json.get("char"),
line == null ? null : (Integer) line,
charPosition == null ? null : (Integer) charPosition,
(String) json.get("description")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is optional as well

@coveralls
Copy link

Coverage Status

Coverage decreased (-4.3%) to 86.981% when pulling 492ec04 on jx_fatty_ape_fix_npe into 39ada66 on master.

String code = (String) json.get("code");
String severity = (String) json.get("severity");
String path = (String) json.get("path");
Integer line = (Integer) json.opt("line");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will NPE because you are trying to typecast null to Integer

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 91.279% when pulling 87817b4 on jx_fatty_ape_fix_npe into 39ada66 on master.

Copy link
Contributor

@kageiit kageiit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still does not address my previous comments

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 91.279% when pulling ca09b8b on jx_fatty_ape_fix_npe into 39ada66 on master.

assertEquals(results.code, "_code");
assertEquals(results.severity, "error");
assertEquals(results.path, "foobar.java");
assertTrue(results.line == null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not even be sending these fields if they are null

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait I think this does what its supposed to. nvm :)

assertEquals(results.code, "_code");
assertEquals(results.severity, "error");
assertEquals(results.path, "foobar.java");
assertTrue(results.line == null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait I think this does what its supposed to. nvm :)

String path = (String) json.get("path");
Integer line = (Integer) json.opt("line");
Integer charPosition = (Integer) json.opt("char");
String description = (String) json.get("description");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opt here. description is optional according to spec

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 91.279% when pulling 16c189e on jx_fatty_ape_fix_npe into 39ada66 on master.

@jjx jjx merged commit 6f56ac6 into master Dec 8, 2016
@kageiit kageiit deleted the jx_fatty_ape_fix_npe branch December 8, 2016 23:57
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.

5 participants