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 a CI check for code formatting #151

Merged
merged 27 commits into from
Oct 8, 2019
Merged

Conversation

Schniz
Copy link
Owner

@Schniz Schniz commented Oct 8, 2019

This PR adds a GitHub action (🎉) that checks for the latest refmt syntax.

This is done thanks to @thomsj which brought up the problems with formatting in the repo! 👏 #105 (comment)

The current implementation is not ideal: it installs esy and then installs OCaml and @esy-ocaml/reason. A better way to do it is to distribute refmt as a standalone binary from the latest Reason release. This will be fast to install and therefore fast to integrate with CI.

An approach to do so is to add an artifact to the CircleCI runs, and then use something like https://circleci-artifacts.now.sh to fetch the artifact, extract it and profit 💰

In the meantime, it takes <4m to run it, which is much faster than the Azure Linux build, not to mention the Windows one.

@Schniz Schniz self-assigned this Oct 8, 2019
@Schniz Schniz force-pushed the add-github-action-for-refmt branch from 9a8f38d to c954044 Compare October 8, 2019 05:31
@Schniz Schniz added the PR: Internal An internal work has been made label Oct 8, 2019
@Schniz Schniz changed the title Try to add a github action that verifies refmt Add a CI check for code formatting Oct 8, 2019
@Schniz
Copy link
Owner Author

Schniz commented Oct 8, 2019

"is this a pidegon meme": CI configurations, 27 commits, is this TDD?

@Schniz Schniz merged commit c5048fc into master Oct 8, 2019
@Schniz Schniz deleted the add-github-action-for-refmt branch October 8, 2019 11:36
@@ -76,7 +76,7 @@
"verify-fnm-package": "node ./.ci/prepare-fnm-package.js --fail-on-difference",
"bootstrap": ".ci/bootstrap",
"test": "esy x TestFnm.exe",
"fmt": "bash -c 'refmt --in-place {library,executable,test}/*.re'",
"fmt": "bash -c 'esy @fmt refmt --in-place ./*/*.re'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I need to do something to get this to work? Currently I get:

error: project is not installed, run esy install

Is @fmt a project, and if so, how do I install it?

@Schniz
Copy link
Owner Author

Schniz commented Oct 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Internal An internal work has been made
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants