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

Add option to XamlStyler.Console to perform a formatting check without changing output #176

Closed
HofmeisterAn opened this issue Feb 7, 2019 · 3 comments · Fixed by #262
Closed

Comments

@HofmeisterAn
Copy link

It would be great if we are able to check, if XamlStyler was applied to the xaml files. I would like to add a stage to my CI build which breaks, if anyone forgot to apply the style rules.

Is there anything like that? Otherwise, I’ll have a look at it.

@grochocki
Copy link
Contributor

Have you explored some of the script integration options? A team that I worked on utilized a Git Hook to enforce format on commit. It could easily be adapted to run as a build task in a CI build.

@HofmeisterAn
Copy link
Author

Yes, I have seen the script integration options and I'm already using them with Cake. However, I don't want to use Git hooks. I'm not sure if VSTS support those kind of server side Git hooks and I don't want to rely on client side hooks.

I would like to make sure that the code is formatted correct before it gets merged into the main branch without any bypass (I know these feature from other projects like diffplug/spotless). A simple check option for XamlStyler.Console would be enough. For example, we can easily compare originalContent with formattedOutput and break the build or use a specific exit code.

@grochocki
Copy link
Contributor

grochocki commented Feb 9, 2019

This seems like a reasonable feature request for the console app.

For example, we can easily compare originalContent with formattedOutput and break the build or use a specific exit code.

Edit: Updating title to reflect specific feature request.

@grochocki grochocki changed the title Check if style changes are necessary Add option to XamlStyler.Console to perform a formatting check without changing output Feb 9, 2019
@grochocki grochocki added this to the vNext milestone Dec 31, 2019
@grochocki grochocki modified the milestones: vNext, 3.2003.9 Sep 10, 2020
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