Skip to content
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

Feature request: offer an option to see only non standard values in a configuration #2079

Closed
Khady opened this issue May 19, 2022 · 0 comments · Fixed by #2084
Closed

Feature request: offer an option to see only non standard values in a configuration #2079

Khady opened this issue May 19, 2022 · 0 comments · Fixed by #2084

Comments

@Khady
Copy link
Contributor

Khady commented May 19, 2022

Is your feature request related to a problem? Please describe.

We have a .ocamlformat configuration that grew organically over time. It has many options (that interact with each other). And changing that file is always tricky (creates noise, makes existing PR harder to merge, requires us to go through the diff to make sure that we didn't introduce some ugly formatting, ...). But it actually contains values that are the default, which could be removed from our config, and would make the whole thing less scary. And it's kind of hard to know that without reading help.txt for each option we are using.

Describe the solution you'd like

I'd like to have an option like --print-config (or maybe a new flag that would affect --print-config) to show only the minimum .ocamlformat required for our project. Or maybe which would show a warning for every option we use that is also the default value

Additional context

Our .ocamlformat

version=0.21.0
quiet=true
break-cases=toplevel
break-infix-before-func=false
break-infix=fit-or-vertical
break-separators=after
space-around-lists=false
dock-collection-brackets=true
break-sequences=true
break-struct=natural
cases-exp-indent=2
doc-comments=before
exp-grouping=preserve
field-space=loose
indicate-multiline-delimiters=closing-on-separate-line
indicate-nested-or-patterns=unsafe-no
leading-nested-match-parens=true
let-and=sparse
m=120
max-indent=2
nested-match=align
ocp-indent-compat=true
parens-ite=true
parens-tuple=multi-line-only
sequence-blank-line=preserve-one
sequence-style=terminator
space-around-arrays=true
space-around-lists=true
space-around-records=true
space-around-variants=true
type-decl=sparse
wrap-fun-args=true
module-item-spacing=preserve

would become

version=0.21.0
quiet=true
profile=default

break-cases=toplevel
break-infix-before-func=false
break-infix=fit-or-vertical
break-struct=natural
cases-exp-indent=2
doc-comments=before
exp-grouping=preserve
indicate-multiline-delimiters=closing-on-separate-line
leading-nested-match-parens=true
let-and=sparse
m=120
max-indent=2
module-item-spacing=preserve
nested-match=align
ocp-indent-compat=true
parens-ite=true
parens-tuple=multi-line-only
type-decl=sparse

This is part of an effort to try to preserve the usage of ocamlformat in our codebase despite the fact that some deprecated options look critical to us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant