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 GHA to check formatting #27

Open
gvrooyen opened this issue Aug 28, 2024 · 0 comments
Open

Add GHA to check formatting #27

gvrooyen opened this issue Aug 28, 2024 · 0 comments

Comments

@gvrooyen
Copy link
Contributor

This should probably be a separate GHA. The formatter should fail if something is found so the contributor can fix it themselves. Several tracks follow that setup. (@BNAndras)

Add a GitHub action that checks the following:

  • Whether any source files have not been formatted. The current version of odinfmt only writes the correctly formatted file to stdout, or it overwrites the source file if the -w flag is specified. However, diff <(odinfmt $F | perl -pe 'chomp if eof') $F correctly returns a status code of 0 if a file is correctly formatted, or 1 if not. The GHA could check for formatting errors and advise the contributor to run odinfmt on the file (or bin/format-all.sh to fix all source files).
  • Whether config files are correctly formatted (configlet fmt). This could prompt the contributor to run configlet fmt -u to update the offending files.
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

No branches or pull requests

1 participant