Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistFilenameLinter.php
Show All 29 Lines | final class ArcanistFilenameLinter extends ArcanistLinter { | ||||
} | } | ||||
public function getLintNameMap() { | public function getLintNameMap() { | ||||
return array( | return array( | ||||
self::LINT_BAD_FILENAME => pht('Bad Filename'), | self::LINT_BAD_FILENAME => pht('Bad Filename'), | ||||
); | ); | ||||
} | } | ||||
public function lintPath($path) { | protected function lintPath(ArcanistWorkingCopyPath $path) { | ||||
if (!preg_match('@^[a-z0-9./\\\\_-]+$@i', $path)) { | $path_name = $path->getPath(); | ||||
if (!preg_match('@^[a-z0-9./\\\\_-]+$@i', $path_name)) { | |||||
$this->raiseLintAtPath( | $this->raiseLintAtPath( | ||||
self::LINT_BAD_FILENAME, | self::LINT_BAD_FILENAME, | ||||
pht( | pht( | ||||
'Name files using only letters, numbers, period, hyphen and '. | 'Name files using only letters, numbers, period, hyphen and '. | ||||
'underscore.')); | 'underscore.')); | ||||
} | } | ||||
} | } | ||||
Show All 9 Lines |