--- /dev/null
+<?php
+
+/*
+ * Copyright 2012 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Shows lint messages to the user.
+ *
+ * @group lint
+ */
+final class ArcanistLintLikeCompilerRenderer {
+ public function renderLintResult(ArcanistLintResult $result) {
+ $lines = array();
+ $messages = $result->getMessages();
+ $path = $result->getPath();
+
+ foreach ($messages as $message) {
+ $severity = ArcanistLintSeverity::getStringForSeverity(
+ $message->getSeverity());
+ $line = $message->getLine();
+ $code = $message->getCode();
+ $description = $message->getDescription();
+ $lines[] = sprintf(
+ "%s:%d:%s (%s) %s\n",
+ $path,
+ $line,
+ $severity,
+ $code,
+ $description
+ );
+ }
+
+ return implode('', $lines);
+ }
+
+ public function renderOkayResult() {
+ return "";
+ }
+}
phutil_require_module('phutil', 'utils');
+phutil_require_source('ArcanistLintJSONRenderer.php');
+phutil_require_source('ArcanistLintLikeCompilerRenderer.php');
phutil_require_source('ArcanistLintRenderer.php');
phutil_require_source('ArcanistLintSummaryRenderer.php');
-phutil_require_source('ArcanistLintJSONRenderer.php');
'param' => 'format',
'help' =>
"With 'summary', show lint warnings in a more compact format. ".
- "With 'json', show lint warnings in machine-readable JSON format."
+ "With 'json', show lint warnings in machine-readable JSON format. ".
+ "With 'compiler', show lint warnings in suitable for your editor."
),
'advice' => array(
'help' =>
case 'summary':
$renderer = new ArcanistLintSummaryRenderer();
break;
+ case 'compiler':
+ $renderer = new ArcanistLintLikeCompilerRenderer();
+ $prompt_patches = false;
+ $apply_patches = $this->getArgument('apply-patches');
+ break;
default:
$renderer = new ArcanistLintRenderer();
break;