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

By default ignore 5639 error code from hh_client --lint #422

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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