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

Auto format rendered templates #790

Merged
merged 1 commit into from
Jan 19, 2025
Merged

Auto format rendered templates #790

merged 1 commit into from
Jan 19, 2025

Conversation

ErikSchierboom
Copy link
Member

I've been using cljfmt lately and it has been really helpful getting my code formatted nicely. This PR is an experiment to see what happens if we use that library to auto format our generated templates.

The benefits are:

  • Consistent style amongst exercises
  • Templates become less of a hassle when trying to fix whitespace and do alignment (to me, these have been the most annoying things when building templates)

The main downside is that you would have to adhere to the style used by cljfmt. We could add support to opt-out of auto-formatting, but it would have to be the exception I feel.

Copy link
Contributor

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@ErikSchierboom
Copy link
Member Author

This PR has two commits:

  • The actual changes to support auto formatting
  • What the changes to the rendered tests look like if they were auto-formatted

Copy link
Member

@tasxatzial tasxatzial left a comment

Choose a reason for hiding this comment

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

Well, this looks perfectly fine to me 👍

@ErikSchierboom ErikSchierboom merged commit ad4007a into main Jan 19, 2025
2 checks passed
@ErikSchierboom ErikSchierboom deleted the generator-format branch January 19, 2025 14:41
@ErikSchierboom
Copy link
Member Author

ErikSchierboom commented Jan 19, 2025

@tasxatzial I've also included an update to the GENERATORS.md file to document this.

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