Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2890146
ArcanistMergeConflictLinter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistMergeConflictLinter.php
View Options
<?php
/**
* Checks files for unresolved merge conflicts.
*/
final
class
ArcanistMergeConflictLinter
extends
ArcanistLinter
{
const
LINT_MERGECONFLICT
=
1
;
public
function
getInfoName
(
)
{
return
pht
(
'Merge Conflicts'
)
;
}
public
function
getInfoDescription
(
)
{
return
pht
(
'Raises errors on unresolved merge conflicts in source files, to catch '
.
'mistakes where a conflicted file is accidentally marked as resolved.'
)
;
}
public
function
getLinterName
(
)
{
return
'MERGECONFLICT'
;
}
public
function
getLinterConfigurationName
(
)
{
return
'merge-conflict'
;
}
public
function
getLintNameMap
(
)
{
return
array
(
self
::
LINT_MERGECONFLICT
=>
pht
(
'Unresolved merge conflict'
)
,
)
;
}
public
function
lintPath
(
$path
)
{
$lines
=
phutil_split_lines
(
$this
->
getData
(
$path
)
,
false
)
;
foreach
(
$lines
as
$lineno
=>
$line
)
{
// An unresolved merge conflict will contain a series of seven
// '<', '=', or '>'.
if
(
preg_match
(
'/^(>{7}|<{7}|={7})$/'
,
$line
)
)
{
$this
->
raiseLintAtLine
(
$lineno
+
1
,
1
,
self
::
LINT_MERGECONFLICT
,
pht
(
'This syntax indicates there is an unresolved merge conflict.'
)
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 13:07 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1113645
Default Alt Text
ArcanistMergeConflictLinter.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment