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

Move editor config to library rather than tool #3031

Open
4 tasks done
Smaug123 opened this issue Dec 29, 2023 · 6 comments
Open
4 tasks done

Move editor config to library rather than tool #3031

Smaug123 opened this issue Dec 29, 2023 · 6 comments

Comments

@Smaug123
Copy link
Contributor

Smaug123 commented Dec 29, 2023

In consumers such as Myriad, it would be nice if we could automatically read the editorconfig appropriate to the files we want to write out, and use that directly, rather than writing out with no config and then forcing the user to reformat with a manual invocation of fantomas.

This would be pretty easy to do, I'd say: we just need to move the EditorConfig files to Fantomas.Core, so that consumers can use them.

Definition of done: a user can call EditorConfig.readConfiguration, after having automatically located the correct .editorconfig file using the same mechanism that Fantomas uses.

I'd be happy to implement this if we think it's desirable.

Pros and Cons

The advantages of making this adjustment to Fantomas are:

  • the user doesn't have to manually run fantomas after a Myriad invocation.

The disadvantages of making this adjustment to Fantomas are:

  • more chance for the embedded Fantomas in the downstream tool (like Myriad) to be backward-incompatible with the Fantomas expected in the workspace;
  • bloat of the Fantomas library, including a reference to the editorconfig NuGet package.

Extra information

Estimated cost (XS, S, M, L, XL, XXL): XS

Affidavit (please submit!)

Please tick this by placing a cross in the box:

Please tick all that apply:

  • This is not a breaking change to Fantomas
  • I or my company would be willing to help implement and/or test this
@nojaf
Copy link
Contributor

nojaf commented Dec 29, 2023

Hi there,

First reaction: I'm against this. I don't think it is worth it.
Why would you want to format the generated code? I would just ignore it via .fantomasignore file.

Or course, since Fantomas.Client, having the extra dependency might not be the end of the world.

I'm gonna let @dawedawe and @josh-degraw decide on this one!
No pressure lads.

@Smaug123
Copy link
Contributor Author

Fair enough - it's just an aesthetic preference, nothing more! Happy to close if you like.

@josh-degraw
Copy link
Contributor

Yeah I'm inclined to agree with Florian at least about the case where generated files should be ignored. But I can totally see value in having the editorconfig parser available outside the tool fwiw. But right now I'd say without a stronger use case I'd prefer to leave things as they are.

@dawedawe
Copy link
Member

dawedawe commented Jan 1, 2024

Hey, sorry for the late reply, I took a few days off from GitHub.
The cons are stronger for me, too.

@nojaf
Copy link
Contributor

nojaf commented Jan 2, 2024

Alright, let's leave this one open for a while. Maybe some other real-world use-cases show up.

@Smaug123
Copy link
Contributor Author

Smaug123 commented Jan 2, 2024

Happy to close it as won't-fix!

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

No branches or pull requests

4 participants