Fix #439 - Line length false positives in Phobos (#440)

This commit is contained in:
Sebastian Wilzbach 2017-06-12 10:29:00 +02:00 committed by Basile Burg
parent dc395eb3c8
commit 6fad779ec2
1 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class LineLengthCheck : BaseAnalyzer
{
immutable info = tokenLength(token, i > 0 ? tokens[i - 1].line : 0);
if (info[1])
endColumn = info[0] + token.column;
endColumn = info[0] + token.column - 1;
else
{
immutable wsChange = i > 0
@ -93,6 +93,10 @@ private:
sac.long_line_check = Check.enabled;
assertAnalyzerWarnings(q{
Window window = Platform.instance.createWindow("Дистанционное управление сварочным оборудованием", null);
unittest {
assert("foo" == "fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo");
assert("foo" == "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"); // [warn]: Line is longer than 120 characters
}
}c, sac);
stderr.writeln("Unittest for LineLengthCheck passed.");