-
Notifications
You must be signed in to change notification settings - Fork 42
Add a test to detect duplicated lint rules #427
Conversation
9e16b4d
to
a8a775b
Compare
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.
It's fine to have two errors for the same node, just as long as they're not talking about the same problem - e.g. await-in-a-loop with an always-false condition is a valid combination.
I think you're already handling this with the HHAST_IGNORE_ALL in the tests, but just wanted to make sure?
If so, it would be good to add an explanation comment to the test case itself about this, and saying use HHAST_IGNORE_ALL
in tests to suppress false positives
@@ -6,6 +6,7 @@ | |||
* LICENSE file in the root directory of this source tree. | |||
* | |||
*/ | |||
// HHAST_IGNORE_ALL[0] because the error code is not the interested in this example |
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.
Are we raising 0
, or does this have a magic meaning?
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.
It means this file does not type check.
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.
Why does it have this meaning? hh_client
doesn't pay attention to it, and it's not really intuitive.
Does this have special meaning to HHClientLinter, affecting non-lint errors? If so:
- this behavior should probably be removed
- HHClientLinter should probably always ignore any errors out of the 5xxx range:
- all linters are in the 5xxx range
- 1xxx-4xxx should be handled via
/* HH_FIXME */
+ hh_client - they shouldn't affect hhast at all (beyond whether or not hhast can parse the file)
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.
It means a bug in the OCaml linter. facebook/hhvm#8950
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.
IMO we should not report this as a lint error, and we should not require suppression - similarly to how we skip files that hh_parse
can't deal with - unless the specific file is requested.
a8a775b
to
8851216
Compare
c32fbc8
to
b94f654
Compare
Comments added in b94f654 |
HHClientDuplicatedLintErrorTest
ensures that no lint error is found byHHClientLinter
in examples forSingleRuleLinter
s, closing #409.