Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891375
ArcanistFilenameLinter.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
ArcanistFilenameLinter.php
View Options
<?php
/**
* Stifles creativity in choosing imaginative file names.
*/
final
class
ArcanistFilenameLinter
extends
ArcanistLinter
{
const
LINT_BAD_FILENAME
=
1
;
public
function
getInfoName
(
)
{
return
pht
(
'Filename'
)
;
}
public
function
getInfoDescription
(
)
{
return
pht
(
'Stifles developer creativity by requiring files have uninspired names '
.
'containing only letters, numbers, period, hyphen and underscore.'
)
;
}
public
function
getLinterName
(
)
{
return
'NAME'
;
}
public
function
getLinterConfigurationName
(
)
{
return
'filename'
;
}
protected
function
shouldLintBinaryFiles
(
)
{
return
true
;
}
public
function
getLintNameMap
(
)
{
return
array
(
self
::
LINT_BAD_FILENAME
=>
pht
(
'Bad Filename'
)
,
)
;
}
public
function
lintPath
(
$path
)
{
if
(
!
preg_match
(
'@^[a-z0-9./\\\\_-]+$@i'
,
$path
)
)
{
$this
->
raiseLintAtPath
(
self
::
LINT_BAD_FILENAME
,
pht
(
'Name files using only letters, numbers, period, hyphen and '
.
'underscore.'
)
)
;
}
}
protected
function
shouldLintDirectories
(
)
{
return
true
;
}
protected
function
shouldLintSymbolicLinks
(
)
{
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 15:07 (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1113698
Default Alt Text
ArcanistFilenameLinter.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment