Commit Graph

558 Commits (f80e777163acfe304ffdfcc209c7872c23a7acfd)

Author SHA1 Message Date
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 af7f9017b8 Fix Alt-transformation bug with BDFEnsureIndents
multiple BDFEnsureIndent nodes were mistreated previously
2018-03-11 22:07:12 +01:00
Lennart Spitzner 41a60ce60f Merge branch 'master' into import 2018-03-11 17:43:16 +01:00
alexeyraga 83b39de3d4 Expose readConfigs 2018-03-07 21:56:52 +11:00
Lennart Spitzner e4dea87839 Switch to using branches master/release instead of dev/master 2018-03-04 19:11:10 +01:00
Lennart Spitzner 44af042436 Merge branch 'release' 2018-03-04 19:03:11 +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 4dd28e5052
Merge pull request #120 from MaxGabriel/patch-1
Fix spelling of my name
2018-02-14 18:24:46 +01:00
Lennart Spitzner 34036cbb74 Merge branch 'dev' 2018-02-14 17:30:25 +01:00
Lennart Spitzner bac69ba54f Bump to 0.9.0.1, Add changelog 2018-02-14 17:18:22 +01:00
Lennart Spitzner 4b53072ccd Correct some commandline help output 2018-02-14 17:18:15 +01:00
Maximilian Tagher f17d9f8bf6
Fix spelling of my name 2018-02-14 06:54:39 -08:00
Lennart Spitzner c28636adca Add ghc-exactprint-0.5.6.0 to extra-deps in stack.yaml 2018-02-14 15:20:22 +01:00
Lennart Spitzner c28ec4cfdf Bump butcher version in stack-8.0.2.yaml 2018-02-14 14:42:26 +01:00
Lennart Spitzner 81928ea597 Switch to ghc-exactprint-0.5.6.0, Remove code duplication 2018-02-14 01:14:24 +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
Lennart Spitzner 779a23c380
Update README.md: Conf file discovery description 2018-02-13 20:32:19 +01:00
Lennart Spitzner d749c0da27 Prevent crash if ~/.config does not exist (fixes #115) 2018-02-13 20:06:31 +01:00
Lennart Spitzner 8430b74b1a Switch to butcher-1.3, Improve help layout, fixes #103 2018-02-13 20:05:48 +01:00
Lennart Spitzner 70404a81f3 Merge branch 'master' into dev 2018-02-13 17:29:12 +01:00
Lennart Spitzner 43e79bb174 Merge pull request #107 from eborden/infix-constructor-pattern-match
Fix infix constructor pattern matching for normal constructors
2018-02-13 17:28:26 +01:00
Lennart Spitzner 077b93db01 Minor refactor 2018-02-09 16:50:57 +01:00
Evan Rutledge Borden eb8f0de6c3 Remove redundant import. 2018-02-09 16:43:59 +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 7255ecdbd2
Merge pull request #117 from jez/patch-1
Readme: Add Vim / Neovim plugin
2018-02-03 22:16:16 +01:00
Jake Zimmerman d086140120
Add Vim / Neovim plugin
I saw that you started an editor integration section, and
thought that it might benefit from a Vim / Neovim section \o/

Thanks for this program by the way!
2018-01-24 15:19:04 -08:00
Lennart Spitzner 3d1b104dce
Merge pull request #108 from eschnett/patch-3
Correct wording of warning message
2018-01-16 00:37:26 +01:00
Erik Schnetter b46f9dd23b
Correct wording of warning message
"certain" -> "some"
2018-01-15 18:11:50 -05: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
Lennart Spitzner 399e2f4f43 Minor cleanups 2018-01-13 18:41:51 +01:00
Lennart Spitzner e788ac9afd Minor fixup in Main.hs for next butcher release 2018-01-13 18:31:39 +01:00
Lennart Spitzner 37bc36f10a
Update README.md 2018-01-13 18:05:21 +01:00
Lennart Spitzner 8fe9ba1f43
Update readme: Add editor integration paragraph 2018-01-13 18:02:00 +01:00
Evan Rutledge Borden cab1297585 Change function name to if/else 2017-12-31 00:11:10 -05: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
Lennart Spitzner 96b3a3ab93 Merge pull request #91 from tuncer/stack-lts-10.0
stack.yaml: update to lts-10.0
2017-12-28 20:17:28 +01:00
Lennart Spitzner ac9d505334 Rename the ghc-8.0.2 stack yaml 2017-12-28 17:30:58 +01:00
Tuncer Ayaz 8137035ac2 Resurrect old stack.yaml for lts-9.0 ci job 2017-12-28 17:30:58 +01:00
Tuncer Ayaz 292bd3d216 stack.yaml: update to lts-10.0 2017-12-28 17:30:58 +01:00
Lennart Spitzner 0f3ee76944 Fix shebang handling with stdin input
Fixes #92
probably should update upstream (ghc-exactprint)
2017-12-27 23:26:18 +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