Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15383072
D9057.id21504.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9057.id21504.diff
View Options
diff --git a/.arcconfig b/.arcconfig
--- a/.arcconfig
+++ b/.arcconfig
@@ -1,7 +1,7 @@
{
"project.name" : "arcanist",
"phabricator.uri" : "https://secure.phabricator.com/",
- "lint.engine" : "PhutilLintEngine",
+ "lint.engine" : "ArcanistConfigurationDrivenLintEngine",
"unit.engine" : "PhutilUnitTestEngine",
"load" : [
"src/"
diff --git a/.arclint b/.arclint
new file mode 100644
--- /dev/null
+++ b/.arclint
@@ -0,0 +1,41 @@
+{
+ "exclude": [
+ "(^externals/)",
+ "(\\.lint-test$)"
+ ],
+ "linters": {
+ "filename": {
+ "type": "filename"
+ },
+ "generated": {
+ "type": "generated"
+ },
+ "merge-conflict": {
+ "type": "merge-conflict"
+ },
+ "nolint": {
+ "type": "nolint"
+ },
+ "phutil-xhpast": {
+ "type": "phutil-xhpast",
+ "include": "(\\.php$)"
+ },
+ "text": {
+ "type": "text"
+ },
+ "spelling": {
+ "type": "spelling"
+ },
+ "xhpast": {
+ "type": "xhpast",
+ "include": "(\\.php$)",
+ "severity": {
+ "16": "advice",
+ "29": "warning",
+ "31": "error",
+ "34": "error",
+ "35": "error"
+ }
+ }
+ }
+}
diff --git a/src/lint/linter/ArcanistPhutilXHPASTLinter.php b/src/lint/linter/ArcanistPhutilXHPASTLinter.php
--- a/src/lint/linter/ArcanistPhutilXHPASTLinter.php
+++ b/src/lint/linter/ArcanistPhutilXHPASTLinter.php
@@ -1,8 +1,5 @@
<?php
-/**
- * @group linter
- */
final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
const LINT_ARRAY_COMBINE = 2;
@@ -36,8 +33,7 @@
public function setEngine(ArcanistLintEngine $engine) {
if (!$this->xhpastLinter) {
- throw new Exception(
- 'Call setXHPASTLinter() before using ArcanistPhutilXHPASTLinter.');
+ $this->xhpastLinter = new ArcanistXHPASTLinter();
}
$this->xhpastLinter->setEngine($engine);
return parent::setEngine($engine);
@@ -64,6 +60,10 @@
return 'PHLXHP';
}
+ public function getLinterConfigurationName() {
+ return 'phutil-xhpast';
+ }
+
public function getCacheVersion() {
$version = '2';
$path = xhpast_get_binary_path();
diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -2,8 +2,6 @@
/**
* Uses XHPAST to apply lint rules to PHP.
- *
- * @group linter
*/
final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
@@ -96,6 +94,10 @@
return 'XHP';
}
+ public function getLinterConfigurationName() {
+ return 'xhpast';
+ }
+
public function getLintSeverityMap() {
$disabled = ArcanistLintSeverity::SEVERITY_DISABLED;
$advice = ArcanistLintSeverity::SEVERITY_ADVICE;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 3:28 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7696804
Default Alt Text
D9057.id21504.diff (2 KB)
Attached To
Mode
D9057: Use the `ArcanistConfigurationDrivenLintEngine` as a linting engine.
Attached
Detach File
Event Timeline
Log In to Comment