diff --git a/.editorconfig b/.editorconfig --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +max_line_length = 80 [src/parser/__tests__/bundle/*] trim_trailing_whitespace = false @@ -19,6 +20,32 @@ trim_trailing_whitespace = false insert_final_newline = false +[src/parser/__tests__/**/*.txt] +max_line_length = + +[src/parser/__tests__/diff/*.{git,hg,rcs,svn,u}diff] +indent_style = +max_line_length = +trim_trailing_whitespace = false +insert_final_newline = false + +[src/parser/__tests__/patches/*.{git,hg,rcs,svn,u}patch] +indent_style = +max_line_length = +trim_trailing_whitespace = false +insert_final_newline = false + +[src/repository/parser/__tests__/mercurial/*.txt] +insert_final_newline = false +max_line_length = +trim_trailing_whitespace = false + +[src/unit/parser/__tests__/testresults/go.*] +indent_style = + +[src/unit/parser/__tests__/testresults/xunit.*] +max_line_length = + [externals/**] ; Use editor default (possible autodetection). indent_style = diff --git a/LICENSE b/LICENSE --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/scripts/breakout.py b/scripts/breakout.py --- a/scripts/breakout.py +++ b/scripts/breakout.py @@ -166,7 +166,11 @@ h = height / 10 for x in range(1, width / 7 - 1): for y in range(1, 7): - entities.append(Block(x * 7, y * h + x / 2 % 2, 7, h, colors[y - 1])) + entities.append(Block(x * 7, + y * h + x / 2 % 2, + 7, + h, + colors[y - 1])) while True: while select.select([ sys.stdin ], [], [], 0)[0]: diff --git a/src/lint/linter/ArcanistTextLinter.php b/src/lint/linter/ArcanistTextLinter.php --- a/src/lint/linter/ArcanistTextLinter.php +++ b/src/lint/linter/ArcanistTextLinter.php @@ -15,7 +15,7 @@ const LINT_EOF_WHITESPACE = 9; private $editorconfig; - private $maxLineLength = 80; + private $maxLineLength; public function getInfoName() { return pht('Basic Text Linter'); @@ -107,7 +107,7 @@ } $this->lintNewlines($path); - $this->lintTabs($path); + $this->lintIndentStyle($path); if ($this->didStopAllLinters()) { return; @@ -161,7 +161,7 @@ } } - protected function lintTabs($path) { + protected function lintIndentStyle($path) { switch ($this->getEditorConfig($path, 'indent_style')) { case 'space': break; @@ -178,7 +178,7 @@ if ($pos !== false) { $this->raiseLintAtOffset( $pos, - self::LINT_TAB_LITERAL, + self::LINT_INDENT_STYLE, pht('Configure your editor to use spaces for indentation.'), "\t"); } @@ -191,6 +191,9 @@ if (!$width) { $width = $this->maxLineLength; } + if (!$width) { + return; + } foreach ($lines as $line_idx => $line) { if (strlen($line) > $width) { diff --git a/src/unit/parser/__tests__/testresults/xunit.no-tests b/src/unit/parser/__tests__/testresults/xunit.no-tests --- a/src/unit/parser/__tests__/testresults/xunit.no-tests +++ b/src/unit/parser/__tests__/testresults/xunit.no-tests @@ -1 +1 @@ - \ No newline at end of file +