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 new formatter / linter tasks #17

Closed
wants to merge 1 commit into from

Conversation

hillcg-aws
Copy link
Collaborator

A new DafnyFormatTask is added that can run as either a passive checker / linter task "checkFormatDafny", or an active formatter task "formatDafny". Both are disabled by default.

Enabling the linter will fail a build on badly formatted source code, whereas enabling the formatter will ensure source is always correctly formatted prior to compilation.

A new DafnyFormatTask is added that can run as either a passive checker
/ linter task "checkFormatDafny", or an active formatter task
"formatDafny". Both are disabled by default.

Enabling the linter will fail a build on badly formatted source code,
whereas enabling the formatter will ensure source is always correctly
formatted prior to compilation.
Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution as well!

I've been debating what the right integration into the standard Gradle graph should be for these tasks. I think we should have checking the format automatically triggered somehow from the build task, but actually applying the formatter as a separate step to be triggered manually.

After digging into the most popular approaches to this, I actually think we should submit support for Dafny to Spotless: https://github.com/diffplug/spotless/tree/main?tab=readme-ov-file#current-feature-matrix. It looks like that takes very little code and they are open to just accepting a formatter for only one build system. That will get us exactly the UX I'm looking for, and get a bit more visibility for Dafny to boot. :)

If that's too much of an ask, I'm happy to do at least some of the work myself.

@hillcg-aws
Copy link
Collaborator Author

Closing as a Spotless component is likely a better solution

@hillcg-aws hillcg-aws closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants