-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
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.
- test failure: either use a lint for the test that exists in all supported versions, or increase the minimum version (grep for the old one, probably composer.json and .github/workflows/*)
- needs adding to
LintRunConfig::NON_DEFAULT_LINTERS
so it's include inall
runs.- this will make it so that it's include in HHAST's own runs; probably best to exclude this linter explicitly in hhast-lint.json for now, then fix them up separately
src/Linters/HHClientLinter.hack
Outdated
|
||
final class HHClientLinter extends BaseLinter { | ||
|
||
const type TConfig = shape(); |
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.
The active lints need to be configurable; perhaps:
shape(
?'ignore_except' => keyset<int>,
?'ignore' => keyset<int>,
)
Both would default to empty; if something is present in both, that should be a runtime error.
Additionally, there should probably be a hardcoded list of lints to always ignore, e.g. 5583 - await in a loop - is known buggy, and has a pure Hack implementation in HHAST and Facebook www already. The current list is HackLintRule::HACK_LINT_IGNORED_CODES in FB WWW, mostly being known-bad linters that should be fixed at some point, but for 5583/AWAIT_IN_LOOP, this is permanently replaced by the linters written in Hack so blocking it here (and in FB) is a band aid - the right fix is probably to delete that one from the ocaml code.
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.
I will implement the config in another PR as this PR is already too large
341cb0d
to
d9de021
Compare
d9de021
to
ba3fc24
Compare
ba00fa8
to
ff1784d
Compare
ff1784d
to
9d5c688
Compare
af9e9b7
to
1267b3f
Compare
Fixed
Will be addressed in another PR |
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.
note followup PRs (to add to non-default linters, and the configurability) are required before this can actually be used outside of unit tests.
src/Linters/HHClientLintError.hack
Outdated
return $this->getBlameCode(); | ||
} | ||
|
||
public function getLintRule(): LintRule { |
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 probably be memoized or passed in to the constructor given that it's never going to change for a particular instance
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.
By the way, Hotspot JVM is good at optimizing allocation for short-lived objects like this (when it is not memoized). Is HHVM able to eliminate the allocation like JVM does?
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.
Sorry, I'm not familiar enough with either VM:)
1267b3f
to
bd84bc6
Compare
bd84bc6
to
6707140
Compare
This is the initial implementation of
HHClientLinter
, which is a proxy callinghh_client --lint
.