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

Github Action: Add Action to check code is formatted. #20

Closed
wants to merge 7 commits into from

Conversation

KFoxder
Copy link
Contributor

@KFoxder KFoxder commented Apr 19, 2024

Overview

  • Added simple GHA to check if code committed is formatted correctly. I found myself more than once opening a PR and then realizing there was so formatting required.

@leostera
Copy link
Collaborator

Thanks for the PR! What is the difference between that lint-fmt workflow you have and this change: cb8d348

It looks like both will fail when the code isn't properly formatted, but maybe I'm missing something else that lint-fmt does.

@KFoxder
Copy link
Contributor Author

KFoxder commented Apr 26, 2024

@leostera your change I think is functionally the same as what this PR is doing. I was just following what I saw in the official setup-ocaml action: https://github.com/ocaml/setup-ocaml?tab=readme-ov-file#extends.

Two quick things:

  1. The commit you made though is breaking the builds now. I think the GHA I was using installs ocamlformat
  2. Totally your decision but having the lint in its own GHA allows a developer to know if the build is working or not separate from knowing if they forgot to format their files before committing. Right now the build status is unknown for example since it is failing on the lint step which is before the build or tests in your commit. Either one is fine, really just your preference.

@KFoxder KFoxder closed this May 1, 2024
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