Aditional configuration request #7
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#7
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I'm trying out brittany and really like it, I think it has the potential to beat hindent through configuration capabilities; The latest hindent version completely removes the styles mechanism and is fixed to the "Johan Tibell" one with no more configuration other than indentation size and line length, Johan Tibell's style is pretty good but I'm not always necessarily happy with every way it changes the code.
As I try brittany I found out a couple things that bothers me and that I would like to be able to configure on
~/.brittany/config.yaml
. Not to say that the default behavior is bad though:Guards
Have/Want:
Get:
Case
Have/Want:
Get:
Sorry for the slow reply, I struggle to find time to work more on brittany. You are totally right about the incomplete Guard layouting, there simply is one case missing from the corresponding translation ruleset. I have run into this exact problem as well, so there is a good chance that I will fix it relatively soon :p
For the
case
part, I am not sure what exactly you want. The implementation currently roughly works like this: Certain syntactical constructs are translated to a (first line, indented-rest-of-lines-list) thingy.Examples for applications of this rule include:
And while it certainly is possible to disable this, before I implement this I would like to confirm in what instances you actually want this. just for
case
and after=
of a binding?(Note to self: maybe the desired effect is just replacing docForceParSpacing with docForceSingleLine in this line)
The "guards" part of this issue should be resolved with that commit.
Great, But I'm not sure what the
config.yaml
option is to configure that behavior (?)There is a problem though, it gives an error:
I've already tried removing the old
~/.brittany/config.yaml
and let brittany re-generate it, but the problem persistsI can reproduce.. that must have been broken since some commits. One sec.
fix is pushed.
The behaviour for guards is improved "unconditionally", i.e. not behind some config flag. Like in other cases, the layouting changes depending on available space. See the testcases for the new behaviour (these tests confirm that brittany acts as identity on them).
(oh, and looking at the testcases, I notice that one is missing. And it really did not work; fix is pushed. But you prob. won't run into that unless you have multiple, long guards.)
Perfect, now it works nicely, thanks!
closing due to no feedback on the "case" part of the initial description; feel free to open again if desired.