Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15426855
D11511.id27678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11511.id27678.diff
View Options
diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php
--- a/src/lint/linter/ArcanistPhpcsLinter.php
+++ b/src/lint/linter/ArcanistPhpcsLinter.php
@@ -5,7 +5,7 @@
*/
final class ArcanistPhpcsLinter extends ArcanistExternalLinter {
- private $reports;
+ private $standard;
public function getInfoName() {
return 'PHP_CodeSniffer';
@@ -29,14 +29,40 @@
return 'phpcs';
}
- protected function getMandatoryFlags() {
- return array('--report=xml');
- }
-
public function getInstallInstructions() {
return pht('Install PHPCS with `pear install PHP_CodeSniffer`.');
}
+ public function getLinterConfigurationOptions() {
+ $options = array(
+ 'phpcs.standard' => array(
+ 'type' => 'optional string',
+ 'help' => pht('The name or path of the coding standard to use.'),
+ ),
+ );
+
+ return $options + parent::getLinterConfigurationOptions();
+ }
+
+ public function setLinterConfigurationValue($key, $value) {
+ switch ($key) {
+ case 'phpcs.standard':
+ $this->standard = $value;
+ return;
+
+ default:
+ return parent::setLinterConfigurationValue($key, $value);
+ }
+ }
+
+ protected function getMandatoryFlags() {
+ $options = array('--report=xml');
+
+ if ($this->standard) {
+ $options[] = '--standard='.$this->standard;
+ }
+ }
+
protected function getDefaultFlags() {
$options = $this->getDeprecatedConfiguration('lint.phpcs.options', array());
$standard = $this->getDeprecatedConfiguration('lint.phpcs.standard');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 24 2025, 11:11 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7720130
Default Alt Text
D11511.id27678.diff (1 KB)
Attached To
Mode
D11511: Modernize `ArcanistPhpcsLinter`
Attached
Detach File
Event Timeline
Log In to Comment