Commit Graph

244 Commits (82b59299cb912efec66af8eff75a0b11a2d18fc0)

Author SHA1 Message Date
Lennart Spitzner 4973298f30 Support same-line let decl when indentAmount>=4 2018-05-01 23:21:31 +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 9ab17cc899 Implement IndentPolicyMultiple 2018-05-01 22:07:05 +02:00
Lennart Spitzner 929e465fd4 Refactor a bit (Internal.ppDecl -> Decl.layoutDecl) 2018-04-25 20:17:36 +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 17fb271694 Fix inlineconfig additions for ghc-8.4 + compat
The semigroup changes are a bit confusing when aiming
for backwards-compat.
2018-04-17 21:45:38 +02:00
Lennart Spitzner 1fc007591c Merge branch 'master' into inlineconfig
# Conflicts:
#	src/Language/Haskell/Brittany/Internal.hs
2018-04-17 20:05:33 +02:00
Lennart Spitzner e559a2cbf7 Implement inline configuration
e.g. "-- brittany --indent=4"

respects the following comment forms as input:

  source comment                       affected target
  ======================================================
  "-- brittany CONFIG"                 whole module
  "-- brittany-next-binding CONFIG"    next binding
  "-- brittany-disable-next-binding"   next binding
  "-- brittany @ myExampleFunc CONFIG" `myExampleFunc`

multiline-comments are supported too, although
the specification must still be a single line. E.g.

  "{- brittany --columns 50 -}"

CONFIG is either:

  1) one or more flags in the form of what brittany accepts
     on the commandline, e.g. "-- columns 50", or
  2) one or more specifications in the form of what brittany
     accepts in its config files for the layouting config
     (a one-line yaml document), e.g. "{ lconfig_cols: 50 }"

see #30
2018-04-17 20:04:40 +02:00
Lennart Spitzner 10e1c19788 Add support for ghc-8.4 2018-04-17 17:50:41 +02:00
Lennart Spitzner 213e82b476 Fix if-then-else paragraph layouting 2018-04-17 06:19:13 +02:00
Lennart Spitzner ae162403ae Support multistate-0.9 (ghc-8.4 preparation) 2018-04-13 22:13:15 +02:00
Lennart Spitzner 8b67a028ea Do not put `where` on newline when no export list
(even when lconfig_allowSingleLineExportList False)
2018-04-09 00:09:07 +02:00
Lennart Spitzner 21ef8b296c Adapt for czipwith-1.0.1.0 2018-04-05 21:06:44 +02:00
Sergey Vinokurov 9bd3bfbe4c
Review suggestions 2018-04-03 22:49:06 +01:00
Sergey Vinokurov 7a60229673
Fix some hlint hints 2018-04-02 22:44:49 +01:00
Sergey Vinokurov 631d9e181d
Replace 'fmap f $' with 'f <$>' 2018-04-02 22:44:49 +01:00
Sergey Vinokurov 545eff9e4f
Remove redundant parens 2018-04-02 22:42:06 +01:00
Sergey Vinokurov 226da07815
Improve vertical alignment 2018-04-02 22:41:15 +01:00
Sergey Vinokurov 0dad5051df
Remove redundant '$'s 2018-04-02 22:41:14 +01:00
Sergey Vinokurov 2ed9a13fdb
Replace 'docAltFilter' with 'runFilteredAlternative' 2018-04-02 21:25:44 +01:00
Sergey Vinokurov 8410fbff8e
Trailing whitespace 2018-04-02 21:25:44 +01:00
Sergey Vinokurov e9689394b1
Add Semigroup instance for 'Max' monoid
Otherwise ghc 8.4 will complain since Semigroup became a superclass
of Monoid.
2018-04-02 21:25:43 +01: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 487c32175a Refactor Alt.hs and Add out-commented alternative 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 a1c832e85c Merge pull request #121 from AlexeyRaga/PR-expose-read-configs
# Conflicts:
#	stack.yaml
2018-03-13 22:45:18 +01:00
Lennart Spitzner c0ea20455c Fixup haddock typos 2018-03-13 22:38:27 +01:00
Lennart Spitzner 15d2250c0b Change _lconfig_importColumn default: 60 -> 50 2018-03-12 17:21:28 +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 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 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 4b53072ccd Correct some commandline help output 2018-02-14 17:18:15 +01:00