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

XamlStyler.Console should be able to accept options via command line arguments #244

Closed
Tyrrrz opened this issue Jan 6, 2020 · 4 comments · Fixed by #249
Closed

XamlStyler.Console should be able to accept options via command line arguments #244

Tyrrrz opened this issue Jan 6, 2020 · 4 comments · Fixed by #249

Comments

@Tyrrrz
Copy link
Contributor

Tyrrrz commented Jan 6, 2020

Hey there. Thanks for adding XamlStyler.Console to NuGet, I've integrated it with my project and now my XAML files are formatted on every build. I'm no longer bound to Visual Studio and can now use Rider, yay. Good job!

Anyway, it would be really nice if the console tool would also accept individual formatting settings as command line options. Currently it accepts a path to a configuration file (or infers it automatically) but it's not super convenient if you just want to set 1 option.

I like how Prettier did it, they have default settings, configuration file and command line arguments, and the priority goes like this (first to last):

Command line arguments -> Config file -> Default settings.

That means both config file and command line arguments can coexist and there's no need for some extra validation.

If this issue is approved and there's no one willing to take it, I can probably make a PR to implement this.

@grochocki
Copy link
Contributor

Great idea! What are your thoughts on support for AttributeOrderingRuleGroups as a command line argument? IMO, it is relatively complex compared to all other options, and I am not sure if there is as clear of a benefit with this one as with all the other settings.

@Tyrrrz
Copy link
Contributor Author

Tyrrrz commented Jan 6, 2020

I personally don't need it. My use case is just setting indent size to 4. :)
I think it's okay to mark this attribute as only configurable from file.

@grochocki
Copy link
Contributor

Ah, gotcha. I think this feature makes a lot of sense, so feel free to tackle this if you are up for it.

Command line arguments -> Config file -> Default settings

This priority makes sense too. Config file -> Default settings should be the current behavior already.

@Tyrrrz
Copy link
Contributor Author

Tyrrrz commented Jan 7, 2020

Cool! I'll take take a look at it when I have some more time next week.

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.

2 participants