Closed intractable closed 5 years ago
Isn't this the same as #74 which #394 tries to implement? (Although I do not see lots of activity on that one.) I think we're in favor of this, so if you implement the changes they are likely to be merged.
@mrkkrp Sorry, I had somehow missed the other issue in my cursory skim. I will close this in favor of #74 and will comment on the latter if we start to implement it or pick up where the PR left off. I mostly wanted to know if the change would be welcome before getting adoption buy-in with the rest of my team.
Thanks!
@intractable You said "one barrier", what are the others?
@mrkkrp Adoption of automated source code formatting tools in general, but I'm motivated to convince, and I'm a fan of the approach this project is taking.
@mrkkrp There may also be some friction around not being able to globally apply ormolu
due to usage of CPP -- https://github.com/tweag/ormolu/issues/415 might help with that considerably, if implemented.
It's fine to manually remove CPP directives / format / re-insert directives in the short- to medium- term, but eventually I'd like to have CI rejections based on the result of --mode check
applied to everything without the need to maintain a module blacklist or ignore the parsing failures that come up if --tolerate-cpp
is used.
Thanks for the cool tool! I'm currently evaluating use of
ormolu
at work on production codebases.One barrier for adoption for us is that we tend to use liberal vertical whitespace for readability purposes.
For example, prior to application of
ormolu
, we have some code that looks like this:which after formatting looks like:
I'm interested to know if there's openness to contributions for employing a vertical whitespace policy which leaves more of the original vertical formatting intact (especially around comment blocks that might vertically delimit sections of code).
E.g., a policy that would format the original code to something like this:
or perhaps even be more liberal with whitespace preservation around contiguous lines of code (e.g., retaining the vertical whitespace between
let mkDir =
and its first use, orlogger <- ...
and the followinglet
binding).