-
Notifications
You must be signed in to change notification settings - Fork 773
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
Consider updating Fantomas & explicitly specifying some config settings #16242
Comments
Ah, I remember seeing that now. Do you have an opinion on my suggestion that we explicitly specify some more settings in this repo's .editorconfig, even if they are the default values? It would mean that changes like #15847 (comment) would necessarily be more deliberate and explicit and would come as less of a surprise. Right now, especially with the current version lag, there is a series of extra hops required for a contributor to know what to expect: this repo → the Fantomas version currently used by this repo → the defaults for that Fantomas version → the version of the Microsoft style guide as of that Fantomas version. One argument against specifying more settings explicitly is that there has historically been some amount of churn in the set of options Fantomas exposes, or in the options' names. This repo's .editorconfig already has some obsolete settings, e.g., I would nonetheless still personally prefer more explicit settings in this repo. Thoughts? |
I don't have super strong feelings against making the defaults explicit. The plus of maintenance shouldn't be too big as the file rarely changes. So if you still see other benefits from it, sure, give it a go in a PR and see what the maintainers of this repo say. |
Oh, by "surprised" I didn't mean "upset" (even though I'm also a space-keeper by preference myself 😊)—I just meant that if, in, e.g., #15847, we also explicitly set |
Closing this for now. Things should at least be much more consistent after #15847. |
Sorry if this has been discussed, planned, or documented elsewhere—please close if so. I know the use of Fantomas in this repo is relatively new, but is there a standard process for updating it? I understand the need to weigh fixing bugs against formatting churn.
Nonetheless, I think we should consider doing these:
Why update Fantomas
As I ran into a number of times in my last couple of PRs (37142b6, e79cbbe, 83fa32c, etc.), the version of Fantomas currently used in this repo (5.0.3) has inconsistent treatment of discriminated union cases, especially in matches.
Example
The current version of Fantomas (6.2.3) no longer has this problem, and the space is either always kept or always removed.
I see the following variation when I grep this codebase:
With space:
A… (…
Without space:
A…(…
Some of that inconsistency is certainly due to the Fantomas bug, but some of the rest is likely expected (chained fluent calls, etc.).
Why specify more settings
Even though I understand the desire to use the default Fantomas settings whenever possible, and for the Fantomas defaults themselves to follow the Microsoft style guide, specifying settings like
fsharp_space_before_uppercase_invocation
,fsharp_space_before_member
, etc., here would remove the need for contributors to consult Fantomas's docs or the style guide separately for clarity.The Roslyn repo, for example, explicitly specifies many settings even though they use the default value.
The text was updated successfully, but these errors were encountered: