Lennart Spitzner
cc0718e964
Add indentation to import-hiding-paragraph
2018-06-04 18:18:44 +02:00
Lennart Spitzner
5816704658
Fix import-hiding-paragraph with policy/=free ( fixes #150 )
2018-06-04 17:30:50 +02:00
Lennart Spitzner
bdee27cb59
Add spaces around record braces (single-line) ( fixes #126 )
2018-05-25 17:57:54 +02:00
Lennart Spitzner
ef7b0fcc70
Add test for #144
2018-05-16 21:25:40 +02:00
Lennart Spitzner
a42bf2e03f
Merge branch 'IndentPolicyMultiple'
2018-05-01 23:26:05 +02:00
Lennart Spitzner
dd53948a23
Fix IndentPolicyMultiple for indentAmount>4
2018-05-01 23:21:09 +02:00
Lennart Spitzner
e91bb6aec9
Clean up IndentPolicyMultiple
2018-05-01 23:19:44 +02:00
Bryan Richter
004dee73e0
Add test for IndentPolicyMultiple
2018-05-01 22:07:03 +02:00
Lennart Spitzner
601dd05be6
Change test file name
2018-05-01 21:45:31 +02:00
Lennart Spitzner
e9aacb27ff
Implement hacky workaround for issue 89
2018-04-25 19:54:35 +02:00
Lennart Spitzner
a237e591b2
Implement `--obfuscate`
...
Support replacing all (non-keyword) identifiers with
randomly generated characters
2018-04-24 00:47:50 +02:00
Lennart Spitzner
696f72d336
Fixup last two commits (tests were effectively disabled
...
- re-enable tests
- un-break tests by fixing the alignment code behaviour
2018-04-24 00:38:40 +02:00
Lennart Spitzner
315a7e1ee1
Fix overflowing due to alignment; Add docs (alignment algorithm)
2018-04-23 19:33:04 +02:00
Lennart Spitzner
18704e403f
Fix inline disabling of brittany
2018-04-19 17:09:10 +02:00
Lennart Spitzner
b43ee43220
Fix/Implement empty type constraint handling ( fixes #133 )
2018-04-02 17:11:53 +02:00
Lennart Spitzner
0845142727
Fix let-in comment placement bug ( fixes #110 )
2018-03-23 17:34:36 +01:00
Lennart Spitzner
bdd3b155f3
Fix HsPar comment placement bug (see #111 )
2018-03-23 17:11:39 +01:00
Lennart Spitzner
3847325fd5
Omit single-line layout for OpApp with comments ( fixes #111 )
2018-03-23 17:02:58 +01:00
Lennart Spitzner
a003b932a9
Fix comments in tuples being dropped ( fixes #37 )
2018-03-23 16:55:28 +01:00
Lennart Spitzner
d634d34ff1
Fix module-import-hiding-items layout
2018-03-23 15:41:41 +01:00
Lennart Spitzner
90a2f65ba7
Align applications on for same function, plus minor fixup
...
Arguments of two function applications will only be aligned
if the same function is called in both cases.
The column transform was altered slightly to fix #65
properly as well.
fixes #65 , #128
2018-03-22 01:19:56 +01:00
Lennart Spitzner
46de13256b
Add one more testcase
2018-03-21 16:03:38 +01:00
Lennart Spitzner
f1536b8966
Merge pull request #83/#124 from sniperrifle2004/import
2018-03-21 01:06:26 +01:00
Lennart Spitzner
8de56ba11d
Support import column vs import-as column
2018-03-21 01:02:44 +01:00
Lennart Spitzner
1330aeb6b4
Fix ticked type operator losing tick ( fixes #125 )
2018-03-13 23:51:22 +01:00
Lennart Spitzner
833ac95fd7
Add two config options to control preamble layouting
2018-03-12 17:11:25 +01:00
Lennart Spitzner
9531edb2a7
Improve module layouting in two aspects
...
- IEThingWith in export list can now be single-line
- Now respect offset of the "module" keyword
(retain empty lines after pragmas, for example)
2018-03-12 16:29:47 +01:00
Lennart Spitzner
20f9c009ee
Stop hanging indent for IEThingWith
...
plus minor refactors/cleanups
this is more in line with IndentPolicyLeft and imo also looks
nicer in general
2018-03-11 22:49:20 +01:00
Lennart Spitzner
41a60ce60f
Merge branch 'master' into import
2018-03-11 17:43:16 +01:00
Lennart Spitzner
19e31fdaf2
Improve layouting of RecordUpd, Fix minor issue for HsLet
2018-02-19 21:33:43 +01:00
Lennart Spitzner
c124336738
Fix NOINLINE pragma layouting
2018-02-19 17:17:39 +01:00
Lennart Spitzner
55b1c71bf3
Fix a layouting mistake that went unnoticed so far
2018-02-14 01:00:01 +01:00
Lennart Spitzner
91de1ca08c
Fix bang deletion on ghc-8.2, Add testcase ( fixes #116 )
2018-02-13 23:48:00 +01:00
Evan Rutledge Borden
019d47bf7e
Change infix patterns to include spaces
...
This commit changes infix patterns to utilize `lrdrNameToTextAnn`. This
function allows the logic to avoid introspecting on the constructor
name.
Additionally this adds spaces to all infix operator pattern matches.
Previously infix symbols did not include spaces:
```
foo (x:xs) = _
```
Now they include a space
```
foo (x : xs) = _
```
2018-02-09 16:43:44 +01:00
Evan Rutledge Borden
18b3cfaf88
Fix infix constructor pattern matching for normal constructors
...
Brittany was previously only support symbol based infix constructors. It
is common in some libraries (for example Esqueleto) to pattern match on
normal constructors as infix. Brittany was failing in this case by not
wrapping the constructor name in back ticks/spaces. Backticks and spaces
have been added in the case where the constructor contains any alpha
characters.
2018-02-09 16:43:29 +01:00
Lennart Spitzner
25ff576dc3
Merge pull request #97 from eborden/let-in-on-single-lines
...
Format let and in on a single line if they fit
2018-01-13 21:39:11 +01:00
Evan Rutledge Borden
f1b49b082f
Format let and in on a single line if they fit
...
The following is wasteful of vertical space:
```
_ =
let
longIdentifierForShortValue = 1
in
longIdentifierForShortValue + longIdentifierForShortValue
```
We should format it on two lines if possible.
```
_ =
let longIdentifierForShortValue = 1
in longIdentifierForShortValue + longIdentifierForShortValue
```
This commit also allows for a mix of variations:
```
_ =
let
longIdentifierForShortValue = 1
in longIdentifierForShortValue + longIdentifierForShortValue
_ =
let longIdentifierForShortValue = 1
in
longIdentifierForShortValue + longIdentifierForShortValue
```
2017-12-31 00:04:53 -05:00
Lennart Spitzner
37e355fea5
Support hanging type signature config option
2017-12-28 21:38:31 +01:00
Lennart Spitzner
43abab2dd2
Remove space after opening parenthesis ( fixes #87 )
2017-12-28 20:46:03 +01:00
sniperrifle2004
98c93f0d63
Move expanded binding list to standard indent level for compact layout
2017-12-22 16:35:39 +01:00
sniperrifle2004
ad34a8b9b9
Only expand empty binding list with comments
2017-12-22 10:18:09 +01:00
sniperrifle2004
3708838b6a
Also handle comments inside ThingWith
2017-12-22 06:58:39 +01:00
sniperrifle2004
21c080572b
Add compact version of import layout
...
Also let layoutLLIEs deal with comments
2017-12-21 23:51:27 +01:00
Lennart Spitzner
f651d02898
Merge branch 'dev' into import
2017-12-19 22:27:37 +01:00
sniperrifle2004
162b6e6bfd
Also fix export comments
...
Also refactored a little to improve reuse of the docWrapNode logic
2017-12-19 16:33:13 +01:00
sniperrifle2004
a59df1f391
Fix comments!! 🎉
2017-12-19 14:28:22 +01:00
sniperrifle2004
7c51a181c8
Fix operators for ThingWith
2017-12-19 01:17:19 +01:00
Lennart Spitzner
8c3a9bec25
Fix operators in import list
2017-12-18 18:56:50 +01:00
sniperrifle2004
c3b6e17261
Improve layout for imports
2017-12-18 13:17:24 +01:00
Lennart Spitzner
204f0aff08
import+module: Refactor and Simplify slightly
2017-12-17 21:14:46 +01:00