diff --git a/src/Linters/BaseLinter.hack b/src/Linters/BaseLinter.hack index a776ae89..72b760fd 100644 --- a/src/Linters/BaseLinter.hack +++ b/src/Linters/BaseLinter.hack @@ -73,12 +73,20 @@ abstract class BaseLinter { |> Str\strip_suffix($$, 'Linter'); } + protected static function ignoreAllMarkerOf(string $code_or_linter): string { + return 'HHAST_IGNORE_ALL['.$code_or_linter.']'; + } + /** * A user can choose to ignore all errors reported by this linter for a * whole file using this string as a marker */ public function getIgnoreAllMarker(): string { - return 'HHAST_IGNORE_ALL['.$this->getLinterName().']'; + return self::ignoreAllMarkerOf($this->getLinterName()); + } + + protected static function ignoreSingleErrorMarkerOf(string $code_or_linter): string { + return 'HHAST_IGNORE_ERROR['.$code_or_linter.']'; } /** @@ -86,7 +94,11 @@ abstract class BaseLinter { * using this string as a marker */ public function getIgnoreSingleErrorMarker(): string { - return 'HHAST_IGNORE_ERROR['.$this->getLinterName().']'; + return self::ignoreSingleErrorMarkerOf($this->getLinterName()); + } + + protected static function fixmeMarkerOf(string $code_or_linter): string { + return 'HHAST_FIXME['.$code_or_linter.']'; } /** @@ -97,7 +109,7 @@ abstract class BaseLinter { * fixed. */ public function getFixmeMarker(): string { - return 'HHAST_FIXME['.$this->getLinterName().']'; + return self::fixmeMarkerOf($this->getLinterName()); } /**