smithy icon indicating copy to clipboard operation
smithy copied to clipboard

Add option to fail the build on formatting violations

Open RenFraser opened this issue 1 year ago • 2 comments

Hi folks, thanks for the great work on Smithy.

Is there an option to fail the Gradle build on formatting violations? It would be great to be able to be able to set options for the smithyFormat task to fail on violations, if not already an option to do so.

If this isn't an option, is it on the roadmap, or is there existing information that would make implementing it via a PR easier, if this is aligned with the maintainers' vision?

RenFraser avatar Jun 11 '24 22:06 RenFraser

Do you mean failing if the formatter would apply changes? For example, like black --check for python?

JordonPhillips avatar Jun 19 '24 13:06 JordonPhillips

Yeah, that's right. I'm not familiar with the black formatter sorry, though I have heard of it. The idea is that instead of formatting on build, it would instead check the formatting of smithy fails and fail the build. That way, formatting could be enforced when the pipeline Gradle build command is run.

RenFraser avatar Jun 19 '24 20:06 RenFraser