Commit Graph

414 Commits

Author SHA1 Message Date
Kotet 2cc1f59235 Fix #433 2019-05-13 12:13:32 +09:00
Hackerpilot b4e97d3381 Fix #436 2019-02-20 11:25:31 -08:00
Laurent Tréguier b34acc9f26 Update libdparse to v0.11.2 (#429)
Update libdparse to v0.11.2
merged-on-behalf-of: Basile-z <Basile-z@users.noreply.github.com>
2019-02-12 18:53:19 +01:00
Laurent Tréguier dae7d85c80 Fix #427 - Crash on invariant (#428)
Fix #427 - Crash on invariant
merged-on-behalf-of: Basile-z <Basile-z@users.noreply.github.com>
2019-02-11 13:55:33 +01:00
WebFreak001 7f41c8ae7f fix array item access regression 2019-01-12 12:25:46 +01:00
WebFreak001 98cd73ec80 Fix 2D (assoc) arrays & add tests
Fix #312
2019-01-11 22:06:57 +01:00
WebFreak001 eebd341343 Allow multilineAt to stop at commas 2019-01-11 22:05:41 +01:00
WebFreak001 733898e013 more informative dump function 2019-01-11 22:04:52 +01:00
WebFreak001 1da1ca6545 Fix isMultilineAt for array + refactor right bracket
Refactor formatRightBracket into own function
2019-01-11 20:19:50 +01:00
WebFreak001 48b2b84c33 Add documentation/comments & undo minor name change 2019-01-11 01:11:03 +01:00
WebFreak001 fcad21ba61 Improve AA formatting
fix #143, fix Pure-D/code-d#188
2019-01-11 00:50:50 +01:00
WebFreak001 85c7d57167 make multiline checking code modular
Arrays and delegates now use the check whether a line is longer
than the max line length using easy to reuse code
2019-01-11 00:48:59 +01:00
WebFreak001 053b775cd1 Add details to indentation stack
This makes more advanced state handling easily possible.
Also moved isWrapIndent/isTempIndent into this, which allows
for exceptions for certain tokens and more control.
2019-01-11 00:47:50 +01:00
WebFreak001 6e4136a353 Make colon almost never break a line 2019-01-11 00:45:47 +01:00
WebFreak001 3b094b16d9 Add ArrayLiterals into arrayStartLocations list
This is done to properly format arrays in function arguments
2019-01-11 00:44:11 +01:00
Laurent Tréguier f4417dc1b5 Update libdparse to v0.10.x (#410)
Update libdparse to v0.10.x
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-11-10 14:02:31 +01:00
Laurent Tréguier 67664c2835
Don't put spaces inside empty braces 2018-11-06 16:40:25 +01:00
Bastiaan Veelo 92d5e1ac8c Allow comments in selective imports. (#403)
Allow comments in selective imports.
merged-on-behalf-of: Brian Schott <Hackerpilot@users.noreply.github.com>
2018-10-19 01:45:52 +02:00
Laurent Tréguier 6ad2fbb6fc Fix #287 - Extra space after import in delegate 2018-10-15 10:14:23 +02:00
Laurent Tréguier 049f86ebfd Fix #349 - Wrong indentation of access modifier after break of long line 2018-10-11 05:43:37 +02:00
Laurent Tréguier 2578dbf2a7 Fix #267 - Indentation with debug inconsistent 2018-10-11 05:43:18 +02:00
Laurent Tréguier 908f32e433 Properly recognize debug as block header 2018-10-11 05:43:18 +02:00
Laurent Tréguier b928eb6d84
Fix #345 - Case of trailing white space 2018-10-10 13:37:06 +02:00
Laurent Tréguier 6ff47e106a
Fix else indentation after debug conditions 2018-10-09 13:19:07 +02:00
Laurent Tréguier 72dd6e83b3
Stop directly accessing top indent token
Accessing the top indent token without using the topIs* () methods is
unsafe and can lead to range violations.
2018-10-09 12:04:44 +02:00
Laurent Tréguier c84db53c7c Fix #372 - Improper indentation after single-line catch (#395)
Fix #372 - Improper indentation after single-line catch
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-10-08 13:32:15 +02:00
Laurent Tréguier f3463cdd34 Fix #326 - Spaces missing after attributes in function literals (#394)
Fix #326 - Spaces missing after attributes in function literals
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-10-07 20:47:28 +02:00
Laurent Tréguier 16c3811261 Fix #286 - Weird indentation in else branch after wrapping expression (#393)
Fix #286 - Weird indentation in else branch after wrapping expression
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-10-07 19:56:08 +02:00
Laurent Tréguier 886903f8ea Fix #246 - Questionable indentation for multiple `with` statements 2018-10-07 12:36:17 +02:00
Basile Burg dca9e15483 fix #244 - Wrong indentation for bool enums 2018-10-03 12:07:54 +02:00
Laurent Tréguier 5e6dd58502 Properly format enum member attributes and parameter attributes 2018-09-29 22:52:49 +02:00
BBasile 7fb46c9aa5 Use automatic versioning (#379)
Use automatic versioning
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-09-19 15:16:41 +02:00
Laurent Tréguier 647bb6daa9 Support for DIP1009 (new contracts syntax), #375 (#376)
Support for DIP1009 (new contracts syntax), #375
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-09-10 14:15:14 +02:00
Brian Schott ae76778801 Add index validity checks to the left paren/bracket code. Fixes #367. (#368)
Add index validity checks to the left paren/bracket code. Fixes #367.
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-09-06 01:01:27 +02:00
BBasile 56097fd106 Deprecate enforce ex (#377)
Deprecate enforce ex
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-09-06 01:01:08 +02:00
BBasile 46788e53ba Handle do as contract header and handle body as identifier (#360)
Handle `do` as contract header and handle `body` as identifier
merged-on-behalf-of: Brian Schott <Hackerpilot@users.noreply.github.com>
2018-06-14 23:29:47 +02:00
Hackerpilot c4b9178e81 Better formatting for UFCS chains 2018-05-09 16:06:12 +02:00
Brian Schott 6eb7b95173 Fix #351 (#352)
Fix #351
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-05-07 07:04:19 +02:00
notna123 08f73d216b Update main.d (#347)
GIT repo change from "Hackerpilot" to "dlang-community"
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-03-27 08:59:46 +02:00
Stefan Koch b3411a3303 Fix Imports to point to the actual symbols rather then wrongly imported ones. 2018-03-08 11:57:07 +01:00
Stefan Koch 0167863b33 Ignore empty files while formatting 2018-03-08 11:57:07 +01:00
Stefan Koch e535f0b2b0 Fix the issue #237
In formatLeftBrace remember if we indented because of a StructInitialzer;
If we did we revert the intdent in formatRightBrace
2018-03-07 21:18:25 +01:00
Stefan Koch dca63110f7 Optionally return position in canFindIndex 2018-03-07 21:18:25 +01:00
Stefan Koch c4a7f9cb04 Add Field to store BraceIndentInfo 2018-03-07 21:18:25 +01:00
BBasile b01c624ef0 fix #236 - Allow constraints to be indented by a single tab (#337)
fix #236 - Allow constraints to be indented by a single tab
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-03-02 16:26:54 +01:00
Stefan Koch 95905cdbf1 Simplify indentStack code 2018-02-28 12:16:16 +01:00
Stefan Koch 4f7f37d664 Change to more effcient optionsToString template 2018-02-22 10:28:21 +01:00
Stefan Koch 06d58ff83a Fix bad formatting in main.d 2018-02-22 00:02:34 +01:00
Brian Schott 5ce4df17a2
Merge pull request #324 from dlang-community/issue-313
Fix #313, and implement a better fix for #314
2018-02-04 16:58:22 -08:00
Hackerpilot a8ac400830 Fix #313, and implement a better fix for #314 2018-02-02 04:48:57 -08:00
Hackerpilot 5aedb2b84b Fix #321 2018-02-02 00:52:30 -08:00
Hackerpilot 1ca3bd9255 Fix #314 2018-01-29 14:18:59 -08:00
Hackerpilot 19e774ebf7 Un-comment the debug functionality of the indentation stack 2018-01-29 14:17:43 -08:00
RazvanN7 d88e1fa5dd Make alias visit public in src/dfmt/ast_info.FormatVisitor 2018-01-25 13:30:34 +02:00
Stefan Koch d8f9cfeae1 Put a space behind static and shared constructors as well 2017-12-11 18:07:21 +01:00
Stefan Koch ddd86f96d8 make --spaces_before_functoion_parameters work in more cases as well as on constructors 2017-12-04 16:02:22 +01:00
The Dlang Bot 82ec339251
Merge pull request #306 from stefan-koch-sociomantic/fix_sbfp
fix space_before_function_parameters
merged-on-behalf-of: stefan-koch-sociomantic <stefan-koch-sociomantic@users.noreply.github.com>
2017-11-30 06:49:33 +01:00
Stefan Koch aa45bda1a8 fix space_before_function_parameters 2017-11-29 17:20:00 +01:00
The Dlang Bot 4feb467dab
Merge pull request #304 from kotet/issue-303
Add support for `static foreach`
merged-on-behalf-of: Brian Schott <Hackerpilot@users.noreply.github.com>
2017-11-29 07:17:03 +01:00
Stefan Koch b69e966df6 Fix issue #301
By adding private and static as valid import prefix
2017-11-28 10:56:55 +01:00
Kotet abc3e6d47e Use std.algorithm.comparison.among instead of a lot of comparisons 2017-11-27 07:32:05 +09:00
Kotet a163eb105f Add support for `static foreach`
Fix #303
2017-11-25 13:20:49 +09:00
Stefan Koch 0847016346 add views/VERSION target to generate the version-number from git 2017-11-03 14:08:53 +01:00
Brian Schott 6de8ff2037
Merge pull request #298 from stefan-koch-sociomantic/fix_sbfp
[UrgentBugifx] Fix space before function parameters
2017-10-29 01:12:49 -07:00
Stefan Koch ec2e223b9a fix bug in --space_before_function_parameters 2017-10-27 16:44:54 +02:00
Hackerpilot 00fda4f5eb Fix #248 2017-10-25 13:26:35 -07:00
Stefan Koch 2de336c39e document --space_before_function_parameters 2017-10-20 13:14:27 +02:00
Stefan Koch 02ba81333e add --space_before_function_parameters 2017-10-11 16:29:14 +02:00
The Dlang Bot 87fd168e06 Merge pull request #289 from stefan-koch-sociomantic/perf_fixes
small perf fix chaching the eol string instead of switching all the time
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2017-10-07 10:24:47 +02:00
Stefan Koch 7c0e4747ed small perf fix chaching the eol string instead of switching all the time 2017-10-06 17:04:01 +02:00
kas-luthor 2645e9cc1f Look for .editorconfig in cwd and parent directories when readinf from STDIN and no explicit config dir given on command line 2017-09-01 09:15:13 +02:00
Brian Schott a93efb66fb Merge pull request #271 from CZDanol/master
Fix -c flag not looking into the *bottom level folder
2017-05-12 14:49:49 -07:00
Hackerpilot 019d42a4dc Fix #273 2017-03-07 16:12:27 -08:00
Daniel 'Danol' Čejchan 98aad22f67 Fix -c flag not looking into the top level folder 2017-01-17 12:57:05 +01:00
Brian Schott 4a4704896b Merge pull request #265 from leandro-lucarella-sociomantic/patch-1
Fix typo in help message
2016-12-05 16:15:20 -08:00
Leandro Lucarella d95d69e31b Fix typo in help message
`.editconfig` should be `.editorconfig` instead.
2016-11-14 16:59:18 +01:00
Basile Burg 593b9885ff fix #263, Impossible to build under Windows with phobos 2.072 2016-11-11 23:04:28 +01:00
Hackerpilot 7961bfc15f #261 2016-11-07 13:18:12 -08:00
Hackerpilot 821f9439e4 Fix #251 2016-06-30 17:41:13 -07:00
ZombineDev e92b90bbf8 Fix compilation in Windows for CRuntime_Microsoft
Use _setmode instead of setmode, because it works for all supported C runtimes on Windows.
This should fix compilation errors for dmd -m32coff, m64, and ldc2 (LDC uses only CRuntime_Microsoft).
2016-06-14 18:39:21 +03:00
Brian Schott 90b68b7e57 Merge pull request #242 from shishkander/issue240
Add option to specify where to look for .editorconfig files.
2016-05-04 15:26:31 -07:00
Andrii Shyshkalov afd5799eb1 Add option to specify where to look for .editorconfig files.
Adds a --config|c option which takes a directory in which the search for
.editorconfig files will start.

When --config|c is used together with explicit filenames of files to format,
.editorconfig is searched only in --config directory, and not in directories
where files are.

Fixes #240.
2016-05-04 12:49:21 +02:00
Hackerpilot d6861cc5a2 Fix #241 2016-04-28 15:23:00 -07:00
Basile Burg 2d18ded428 fix imports for dmd 2.071 + update win bat 2016-04-14 21:08:24 +02:00
Hackerpilot 0f7727e31b Fix #235 2016-03-27 23:29:38 -07:00
Hackerpilot 789019fc86 Update parser and fix imports for 2.071 2016-03-27 22:37:15 -07:00
Gautam Kotian 1392ef52cf Fix typo 2016-02-29 23:56:24 +01:00
Gautam Kotian d7737c0da5 Add missing parameters in function documentation 2016-02-28 00:13:00 +01:00
Gautam Kotian 649ee08e62 Fix typo in function name 2016-02-28 00:12:11 +01:00
Gautam Kotian be6f5706ae Fix typos 2016-02-28 00:11:19 +01:00
Hackerpilot 65ac0871fd Fix #229 2016-02-25 14:02:12 -08:00
Hackerpilot fd214032a4 Fix bug with multi-line string literals 2016-02-01 00:35:26 -08:00
Hackerpilot 3bc810dcd4 Update libdparse 2016-01-29 02:00:18 -08:00
Hackerpilot 851affb63c Docopt-style help output 2016-01-26 23:55:56 -08:00
Hackerpilot 845358bb61 Prefer breaking on ternary operators 2016-01-26 13:05:59 -08:00
Hackerpilot c1f189b124 Run dfmt on itself 2016-01-26 13:02:06 -08:00
Hackerpilot 0ea6b340a4 Fix #226 2016-01-26 12:56:19 -08:00
Hackerpilot e6fe5df515 Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
Hackerpilot 0eea53a628 Fix #225 2016-01-22 19:06:09 -08:00
Hackerpilot e2d23726b9 Fix #224 2016-01-22 18:48:36 -08:00