Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22396420
ArcanistJSONLinter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
966 B
Referenced Files
None
Subscribers
None
ArcanistJSONLinter.php
View Options
<?php
/**
* A linter for JSON files.
*/
final
class
ArcanistJSONLinter
extends
ArcanistLinter
{
const
LINT_PARSE_ERROR
=
1
;
public
function
getInfoName
()
{
return
pht
(
'JSON Lint'
);
}
public
function
getInfoDescription
()
{
return
pht
(
'Detect syntax errors in JSON files.'
);
}
public
function
getLinterName
()
{
return
'JSON'
;
}
public
function
getLinterConfigurationName
()
{
return
'json'
;
}
public
function
getLintNameMap
()
{
return
array
(
self
::
LINT_PARSE_ERROR
=>
pht
(
'Parse Error'
),
);
}
protected
function
canCustomizeLintSeverities
()
{
return
false
;
}
public
function
lintPath
(
$path
)
{
$data
=
$this
->
getData
(
$path
);
try
{
id
(
new
PhutilJSONParser
())->
parse
(
$data
);
}
catch
(
PhutilJSONParserException
$ex
)
{
$this
->
raiseLintAtLine
(
$ex
->
getSourceLine
(),
$ex
->
getSourceChar
(),
self
::
LINT_PARSE_ERROR
,
$ex
->
getMessage
());
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 16:45 (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1207204
Default Alt Text
ArcanistJSONLinter.php (966 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline