Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
By default ignore 5639 error code from hh_client --lint (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry authored Dec 9, 2021
1 parent a3b3f2b commit d14917c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Linters/HHClientLinter.hack
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ final class HHClientLinter implements Linter {
5583 /* DontAwaitInALoop, which should have been covered by DontAwaitInALoopLinter */,
];

/**
* The error code that are ignored by default when both `ignore_except` and
* `ignore` are `null`
*/
const keyset<int> DEFAULT_IGNORE_ERRORS = keyset[
5639 /* potential co(tra)variant marker, which is highly opinionated */,
];

<<__Memoize>>
private function isErrorCodeConfiguredToIgnore(): (function(
this::TErrorCode,
Expand All @@ -38,7 +46,8 @@ final class HHClientLinter implements Linter {
$ignore = $this->config['ignore'] ?? null;
if ($ignore is null) {
if ($ignore_except is null) {
return $_ ==> false;
return $error_code ==>
C\contains(self::DEFAULT_IGNORE_ERRORS, $error_code);
}
return $error_code ==> !C\contains($ignore_except, $error_code);
}
Expand Down

0 comments on commit d14917c

Please sign in to comment.