diff --git a/.editorconfig b/.editorconfig index 5a4d42e..1212197 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,11 @@ tab_width = 4 indent_size = 4 indent_style = tab +[makefile] +tab_width = 4 +indent_size = 4 +indent_style = tab + [*.d] dfmt_align_switch_statements = true dfmt_brace_style = allman diff --git a/dub.json b/dub.json index 342913a..fcab561 100644 --- a/dub.json +++ b/dub.json @@ -1,10 +1,10 @@ { "name": "dfmt", "description": "Dfmt is a formatter for D source code", - "version": "0.2.2", + "version": "0.3.1", "targetType": "executable", "license": "BSL-1.0", "dependencies": { "libdparse": "~master" - }, + } } diff --git a/libdparse b/libdparse index 617b7c6..f0bb347 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 617b7c6f2c33cf7121c75ed2b88460d1416eb85c +Subproject commit f0bb347b9aa9f9cb487531debc67c91057d602aa diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index d351285..669f3a3 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -763,7 +763,7 @@ private: formatAt(); break; case tok!"!": - if (peekIs(tok!"is") && !peekBackIsOneOf(false, tok!"(", tok!"=")) + if ((peekIs(tok!"is") || peekIs(tok!"in")) && !peekBackIsOneOf(false, tok!"(", tok!"=")) write(" "); goto case; case tok!"...": diff --git a/src/dfmt/main.d b/src/dfmt/main.d index 39f0211..47abb65 100644 --- a/src/dfmt/main.d +++ b/src/dfmt/main.d @@ -62,7 +62,7 @@ else "indent_style|t", &optConfig.indent_style, "inplace", &inplace, "max_line_length", &optConfig.max_line_length, - "max_line_length", &optConfig.max_line_length, + "soft_max_line_length", &optConfig.dfmt_soft_max_line_length, "outdent_attributes", &handleBooleans, "outdent_labels", &handleBooleans, "space_after_cast", &handleBooleans, @@ -144,7 +144,7 @@ else private void printHelp() { - writeln(`dfmt 0.3.0-dev + writeln(`dfmt 0.3.1 Options: --help | -h Print this help message @@ -158,7 +158,7 @@ Formatting Options: --indent_size --indent_style|t --inplace - --max_line_length + --soft_max_line_length --max_line_length --outdent_attributes --outdent_labels diff --git a/tests/allman/issue0136.d.ref b/tests/allman/issue0136.d.ref new file mode 100644 index 0000000..c5d8941 --- /dev/null +++ b/tests/allman/issue0136.d.ref @@ -0,0 +1,4 @@ +unittest +{ + auto result = name !in aa; +} diff --git a/tests/issue0136.d b/tests/issue0136.d new file mode 100644 index 0000000..076bab8 --- /dev/null +++ b/tests/issue0136.d @@ -0,0 +1,4 @@ +unittest +{ + auto result = name !in aa; +} diff --git a/tests/otbs/issue0136.d.ref b/tests/otbs/issue0136.d.ref new file mode 100644 index 0000000..9f04038 --- /dev/null +++ b/tests/otbs/issue0136.d.ref @@ -0,0 +1,3 @@ +unittest { + auto result = name !in aa; +}