Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[HBASE-5575] Java lint should only report problems for modified lines

Summary: Making Java linter work treat all messages as warnings, which makes it
only report issues for modified lines. It would be difficult to reformat all
HBase code to satisfy the linter, so if a patch does not touch certain lines, we
should not report problems for those lines.

Test Plan:
Make some local changes in HBase code with lines longer than 80 characters and
trailing whitespace, then run arc lint

Reviewers: nspiegelberg, mareksapotafb, jsichi, davidrecordon, nh

Reviewed By: nh

Differential Revision: https://reviews.facebook.net/D2295
  • Loading branch information...
commit 2479608f42fa8f5b127ca1352d2a1c5711679c96 1 parent 666d51c
Mikhail Bautin authored
View
2  arc_jira_lib/arcanist/ArcJIRAConfiguration.php
@@ -1,7 +1,7 @@
<?php
/*
- * Copyright 2011 Facebook
+ * Copyright 2012 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
View
1  arc_jira_lib/arcanist/__init__.php
@@ -8,7 +8,6 @@
phutil_require_module('arcanist', 'configuration');
phutil_require_module('arcanist', 'differential/commitmessage');
-phutil_require_module('arcanist', 'differential/revision');
phutil_require_module('arcanist', 'exception/usage');
phutil_require_module('arcanist', 'parser/diff');
phutil_require_module('arcanist', 'parser/diff/changetype');
View
24 arc_jira_lib/lint/engine/JavaLintEngine.php
@@ -1,7 +1,7 @@
<?php
/*
- * Copyright 2011 Facebook
+ * Copyright 2012 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,28 @@ public function buildLinters() {
}
}
+ // Make all lint messages warnings so we only show them for modified
+ // lines.
+ $text_linter->setCustomSeverityMap(
+ array(
+ ArcanistTextLinter::LINT_DOS_NEWLINE
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ArcanistTextLinter::LINT_TAB_LITERAL
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ArcanistTextLinter::LINT_LINE_WRAP
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ArcanistTextLinter::LINT_EOF_NEWLINE
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ArcanistTextLinter::LINT_BAD_CHARSET
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ArcanistTextLinter::LINT_TRAILING_WHITESPACE
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ArcanistTextLinter::LINT_NO_COMMIT
+ => ArcanistLintSeverity::SEVERITY_WARNING,
+ ));
+
return $linters;
}
+
}
+
View
3  arc_jira_lib/lint/engine/__init__.php
@@ -8,6 +8,9 @@
phutil_require_module('arcanist', 'lint/engine/base');
phutil_require_module('arcanist', 'lint/linter/text');
+phutil_require_module('arcanist', 'lint/severity');
+
+phutil_require_module('phutil', 'filesystem');
phutil_require_source('JavaLintEngine.php');
Please sign in to comment.
Something went wrong with that request. Please try again.