-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixity info from .ormolu overrides CLI flags #1030
Comments
I don't immediately see a reason to use the CLI flags when one already has an But indeed, this was changed in #994, this seems to be the relevant review comment: #994 (comment) (before that, the behavior you are expecting was preserved by that diff). |
Perhaps this is where the expected behavior of I personally don't see a concrete use-case for specifying fixities and reexports on the command line. But given that the flags exist, this is surprising behavior. I would be more in favor of removing the flags altogether than keeping the current behavior. |
I think it is related to my remark here: #994 (comment) I didn't have full context to understand the code when I wrote my review, and then @mrkkrp accepted my suggestion. Now, I agree with @brandonchinn178 and I think CLI flags should have priority over config file ones. I suppose we could revert the change? |
It is true that there is a conflict between semantics of
I think the flags are very useful in situations when you don't want to write to the filesystem, e.g. in scripts when you want to execute a one-off action without extra state. I will see if I can adjust this... |
I think we should probably keep |
Describe the bug
Reading the code here:
ormolu/src/Ormolu.hs
Lines 193 to 207 in 49eb083
It seems like configuration in
.ormolu
files take precedence over command line flags, when the help text (and standard behavior of flags vs config files) seems to indicate that flags take precedence. Specifically,Map.union
is left-biased, sofixityOverrides
(coming frommfixityOverrides
, which comes frommDotOrmolu
) is preferred overcfgFixityOverrides rawConfig
(which is parsed from command line flags)To Reproduce
.ormolu
--fixity
Expected behavior
Ormolu should format with the fixity specified on the command line
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: