Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistJSONLinter.php
Show All 31 Lines | final class ArcanistJSONLinter extends ArcanistLinter { | ||||
protected function canCustomizeLintSeverities() { | protected function canCustomizeLintSeverities() { | ||||
return false; | return false; | ||||
} | } | ||||
public function lintPath($path) { | public function lintPath($path) { | ||||
$data = $this->getData($path); | $data = $this->getData($path); | ||||
try { | try { | ||||
id(new PhutilJSONParser())->parse($data); | (new PhutilJSONParser())->parse($data); | ||||
} catch (PhutilJSONParserException $ex) { | } catch (PhutilJSONParserException $ex) { | ||||
$this->raiseLintAtLine( | $this->raiseLintAtLine( | ||||
$ex->getSourceLine(), | $ex->getSourceLine(), | ||||
$ex->getSourceChar(), | $ex->getSourceChar(), | ||||
self::LINT_PARSE_ERROR, | self::LINT_PARSE_ERROR, | ||||
$ex->getMessage()); | $ex->getMessage()); | ||||
} | } | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0