Skip to content

Add pre-commit hook for bsrefmt. Run refmt over codebase.#15

Merged
kitten merged 1 commit into0no-co:masterfrom
parkerziegler:task/add-refmt
Apr 13, 2019
Merged

Add pre-commit hook for bsrefmt. Run refmt over codebase.#15
kitten merged 1 commit into0no-co:masterfrom
parkerziegler:task/add-refmt

Conversation

@parkerziegler
Copy link
Copy Markdown
Collaborator

This PR is purely a formatting PR. It adds a yarn refmt script that runs the bsrefmt CLI over the whole codebase, and a husky pre-commit hook to do the same. There are no actual code changes included in this PR. @kitten the main motivation for this PR is just to get wonka to a state where it works with refmt so the code is a bit more readable and so that we have nice editor integration with Jared's reason-language-server. If you don't want to include this change, no worries. I've just found myself disabling editor settings when working on wonka tests previously so I didn't end up with a bunch of formatting changes in the diff. But since we have a formatter in Reason, we might as well use it!

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 13, 2019

Coverage Status

Coverage remained the same at 72.83% when pulling b46218c on parkerziegler:task/add-refmt into 6be9f26 on kitten:master.

"terser:cjs": "terser --config-file .terser.config.json -o ./dist/wonka.js ./dist/wonka.js",
"terser": "run-p terser:es terser:cjs",
"prettier": "prettier --write ./dist/*.js",
"refmt": "bsrefmt --in-place **/**/*.re",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Providing a local script for users to run if they like.

Copy link
Copy Markdown
Member

@kitten kitten left a comment

Choose a reason for hiding this comment

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

I'm simply not a fan of some of their default choices but I suppose, like with gofmt, it's great! Previously there's been some bugs with some reformatting but afaik they're fixed so let's get this in for THE GREATER GOOD 😂

"rimraf": "^2.6.3",
"terser": "^3.14.1"
},
"lint-staged": {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

And our pre-commit setup.

@kitten kitten merged commit 21e02f2 into 0no-co:master Apr 13, 2019
@parkerziegler
Copy link
Copy Markdown
Collaborator Author

Dang I hadn't heard about the formatting drama. But thanks for merging it, I think it'll at least give us a standard pattern across editor setups (even if it's one we don't like). I'll work more on docs / tests this weekend!

@parkerziegler parkerziegler deleted the task/add-refmt branch April 13, 2019 17:04
kitten pushed a commit that referenced this pull request Apr 14, 2019
This PR adds tests for some of the timing operators included in the `WonkaJs` module, specifically `delay`, `throttle`, `debounce`, and `sample`. Just chipping away at test coverage and having fun learning more `wonka` / observable-based programming 😅.

It also adds `*.rei` files to our pre-commit hook and `yarn refmt` script, which I missed in #15 😞.
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.

3 participants