Page MenuHomePhabricator

D9626.diff
No OneTemporary

D9626.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -122,6 +122,7 @@
'ArcanistMercurialParser' => 'repository/parser/ArcanistMercurialParser.php',
'ArcanistMercurialParserTestCase' => 'repository/parser/__tests__/ArcanistMercurialParserTestCase.php',
'ArcanistMergeConflictLinter' => 'lint/linter/ArcanistMergeConflictLinter.php',
+ 'ArcanistMergeConflictLinterTestCase' => 'lint/linter/__tests__/ArcanistMergeConflictLinterTestCase.php',
'ArcanistNoEffectException' => 'exception/usage/ArcanistNoEffectException.php',
'ArcanistNoEngineException' => 'exception/usage/ArcanistNoEngineException.php',
'ArcanistNoLintLinter' => 'lint/linter/ArcanistNoLintLinter.php',
@@ -294,6 +295,7 @@
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
'ArcanistMercurialParserTestCase' => 'ArcanistTestCase',
'ArcanistMergeConflictLinter' => 'ArcanistLinter',
+ 'ArcanistMergeConflictLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistNoEffectException' => 'ArcanistUsageException',
'ArcanistNoEngineException' => 'ArcanistUsageException',
'ArcanistNoLintLinter' => 'ArcanistLinter',
diff --git a/src/lint/linter/ArcanistMergeConflictLinter.php b/src/lint/linter/ArcanistMergeConflictLinter.php
--- a/src/lint/linter/ArcanistMergeConflictLinter.php
+++ b/src/lint/linter/ArcanistMergeConflictLinter.php
@@ -38,7 +38,7 @@
if (preg_match('/^(>{7}|<{7}|={7})$/', $line)) {
$this->raiseLintAtLine(
$lineno + 1,
- 0,
+ 1,
self::LINT_MERGECONFLICT,
pht('This syntax indicates there is an unresolved merge conflict.'));
}
diff --git a/src/lint/linter/__tests__/ArcanistMergeConflictLinterTestCase.php b/src/lint/linter/__tests__/ArcanistMergeConflictLinterTestCase.php
new file mode 100644
--- /dev/null
+++ b/src/lint/linter/__tests__/ArcanistMergeConflictLinterTestCase.php
@@ -0,0 +1,12 @@
+<?php
+
+final class ArcanistMergeConflictLinterTestCase
+ extends ArcanistArcanistLinterTestCase {
+
+ public function testMergeConflictLint() {
+ $this->executeTestsInDirectory(
+ dirname(__FILE__).'/mergeconflict/',
+ new ArcanistMergeConflictLinter());
+ }
+
+}
diff --git a/src/lint/linter/__tests__/mergeconflict/mergeconflict.lint-test b/src/lint/linter/__tests__/mergeconflict/mergeconflict.lint-test
new file mode 100644
--- /dev/null
+++ b/src/lint/linter/__tests__/mergeconflict/mergeconflict.lint-test
@@ -0,0 +1,10 @@
+{
+ "foo": "bar",
+<<<<<<< HEAD
+ "bar": "baz"
+=======
+ "baz": "foo"
+>>>>>>> branch2
+}
+~~~~~~~~~~
+error:5:1

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 11, 4:08 AM (3 d, 12 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737216
Default Alt Text
D9626.diff (2 KB)

Event Timeline