Commit Graph

57 Commits (0.12.0.0)

Author SHA1 Message Date
Lennart Spitzner 37e4225c49 Include exact location when printing ErrorUnknownNode 2018-09-18 00:23:23 +02:00
5outh b2795482fa Append input path name to UnknownNode errors 2018-09-17 14:32:20 -04:00
Doug Beardsley 3729a57196 Add check mode for use by test suites
This mode makes no changes to files, but returns 0 (success) when no
changes would be made and 1 (failure) when changes would be made.
2018-09-11 01:25:35 -04:00
Lennart Spitzner 6725d0e119 Refactor/Auto-format Main, Brittany.Internal 2018-06-04 17:10:10 +02:00
Lennart Spitzner 57c48f64c1 Apply inline config to module header (fixes #151) 2018-06-04 16:57:07 +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 18704e403f Fix inline disabling of brittany 2018-04-19 17:09:10 +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 e79af18fb6 Omit file write if file is unchanged (fixes #93) 2018-04-09 00:29:58 +02:00
Lennart Spitzner 62d066d496 Un-ignore coreIO error-numbers when processing one file only 2018-04-05 21:05:19 +02: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 8cabd08477 Update README.md and commandline description 2018-03-25 16:06:36 +02:00
alexeyraga 83b39de3d4 Expose readConfigs 2018-03-07 21:56:52 +11:00
Lennart Spitzner 4b53072ccd Correct some commandline help output 2018-02-14 17:18:15 +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
Erik Schnetter b46f9dd23b
Correct wording of warning message
"certain" -> "some"
2018-01-15 18:11:50 -05:00
Lennart Spitzner e788ac9afd Minor fixup in Main.hs for next butcher release 2018-01-13 18:31:39 +01:00
Lennart Spitzner c709513209 Remove dependency on either package
Following the deprecation and removal of the EitherT transformer
2017-11-27 18:11:49 +01:00
Lennart Spitzner 7d7ec3e8b4 Update commandline help output 2017-10-04 23:43:30 +02:00
d-dorazio 752048882e move inputParams into the reordered block 2017-10-04 20:56:37 +02:00
d-dorazio f21c6b6eac rework the cli interface 2017-10-03 23:32:36 +02:00
Lennart Spitzner bb40870f81 Merge pull request #59 from d-dorazio/master 2017-10-02 14:13:27 +02:00
d-dorazio 95c40f2b1e address review comments 2017-10-02 13:55:52 +02:00
d-dorazio 36af16f881 add inplace flag 2017-10-01 17:04:20 +02:00
d-dorazio 308da71afb support multiple inputs and outputs 2017-10-01 17:04:20 +02:00
Lennart Spitzner a348ae7fbc Switch to XDG path for config; Search conf in parents
- switch to XDG path should be backwards-compatible:
  - new config will be written to XDG path
  - but existing config in ~/.brittany will be respected
- looks for "brittany.yaml" not only in cwd, but in parents too.
  uses the first file found.

fixes #45, fixes #55
2017-09-29 21:42:39 +02:00
Lennart Spitzner 9703ebead5 Fix #53
Previously, if the input did not end with a newline
character and config had 'ppconf_hackAroundIncludes = True'
then due to using unlines/lines the output contained an
additional newline.
2017-09-10 16:37:35 +02:00
Lennart Spitzner b0f211fbfc Add/Use flag `-h` for `--help`, fixes #44 2017-08-10 17:46:21 +02:00
Lennart Spitzner 08e94f0e74 Differentiate ErrNos 2017-08-08 00:47:04 +02:00
Lennart Spitzner 69c50bebd3 Refactor Main.hs in preparation of --inplace (see #40) 2017-08-08 00:46:09 +02:00
Lennart Spitzner 16f5aa118d Add flag to omit reformatting (ghc-exactprint only) 2017-06-03 21:01:24 +02:00
Lennart Spitzner 8443988af3 Change help text 2017-06-03 18:23:03 +02:00
Lennart Spitzner 9f4cda9130 Add license (AGPLv3) 2017-06-03 18:23:03 +02:00
Lennart Spitzner dfec26e55b Refactor/Rename LayoutError -> BrittanyError 2017-06-03 18:23:03 +02:00
Lennart Spitzner f350113f7f Refactor all modules: +Internal; Add public Brittany module 2017-05-22 21:25:08 +02:00
Lennart Spitzner 5dbe0f2c9c Add function pureModuleTransform 2017-05-22 21:06:02 +02:00
Lennart Spitzner 72c87b7b4e Auto-reformat Main.hs 2017-05-22 15:58:04 +02:00
Lennart Spitzner fd9427754e Add "hackAroundIncludes" option (default false)
- Makes brittany work in stdin/stdout mode when
  CPP usage is limited to #includes.
2017-05-22 15:49:18 +02:00
Lennart Spitzner 8f1e366f9c Change config file structure; Add config version tag 2017-05-21 16:48:05 +02:00
Lennart Spitzner 296629b96c Update README.md (installation); Fix copyright notice 2017-05-17 23:31:20 +02:00
Lennart Spitzner 68e77c9337 Fixup for czipwith and Update stack.yaml 2017-05-14 19:32:31 +02:00
Lennart Spitzner 22300d9c62 Minor cleanups 2017-05-14 17:10:20 +02:00
Lennart Spitzner 2dd6fe83f5 Add documentation and examples; Add debugging flag; Minor refactors 2017-03-30 22:47:00 +02:00
Lennart Spitzner bc70eb07e8 Change config setup(!), Refactor, Update deps
- config now uses foo_bar instead of _foo_bar;
- config now will accept missing keys;
- use latest butcher version;
- improve identity testing by moving into separate file.
2017-01-31 18:43:16 +01:00
Lennart Spitzner 508780466c Adapt for butcher-0.2.0.0 2016-10-01 19:06:55 +02:00
Lennart Spitzner 65fee7694d Add commandline param for input (without --input) 2016-09-06 15:29:13 +02:00
Lennart Spitzner 94651934b4 Update --help output 2016-09-04 14:24:19 +02:00
Lennart Spitzner b03996e401 Apply brittany on parts of its source; Add comments 2016-09-03 23:02:32 +02:00
Lennart Spitzner b58a8b0146 Fix commandline flag parsing (again, oops) 2016-08-12 20:57:37 +02:00