Fix bad formatting in main.d

This commit is contained in:
Stefan Koch 2018-02-21 16:45:29 +01:00
parent 4725a622c6
commit 942f03513e
1 changed files with 8 additions and 8 deletions

View File

@ -18,18 +18,18 @@ static immutable VERSION = () {
{ {
// takes the `git describe --tags` output and removes the leading // takes the `git describe --tags` output and removes the leading
// 'v' as well as any kind of newline // 'v' as well as any kind of newline
// if the tag is considered malformed it gets used verbatim // if the tag is considered malformed it gets used verbatim
enum gitDescribeOutput = import("VERSION"); enum gitDescribeOutput = import("VERSION");
string result; string result;
if (gitDescribeOutput[0] == 'v') if (gitDescribeOutput[0] == 'v')
result = gitDescribeOutput[1 .. $]; result = gitDescribeOutput[1 .. $];
else else
result = null; result = null;
uint minusCount; uint minusCount;
foreach (i, c; result) foreach (i, c; result)
{ {
@ -39,17 +39,17 @@ static immutable VERSION = () {
break; break;
} }
if (c == '-') if (c == '-')
{ {
++minusCount; ++minusCount;
} }
} }
if (minusCount > 1) if (minusCount > 1)
result = null; result = null;
return result ? result ~ DEBUG_SUFFIX return result ? result ~ DEBUG_SUFFIX
: gitDescribeOutput ~ DEBUG_SUFFIX; : gitDescribeOutput ~ DEBUG_SUFFIX;
} }
else else
@ -103,7 +103,7 @@ else
break; break;
case "space_before_function_parameters": case "space_before_function_parameters":
optConfig.dfmt_space_before_function_parameters = optVal; optConfig.dfmt_space_before_function_parameters = optVal;
break; break;
case "split_operator_at_line_end": case "split_operator_at_line_end":
optConfig.dfmt_split_operator_at_line_end = optVal; optConfig.dfmt_split_operator_at_line_end = optVal;
break; break;