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

A pre-commit hook for formatR #97

Open
fabianegli opened this issue Nov 7, 2022 · 4 comments
Open

A pre-commit hook for formatR #97

fabianegli opened this issue Nov 7, 2022 · 4 comments

Comments

@fabianegli
Copy link

fabianegli commented Nov 7, 2022

It would be great to have formatR available as a pre-commit hook to keep R projects formatted consistently.

Since version 2.11.0, pre-commit supports R.

I would be glad to help implementing one if that is desired.

@fabianegli fabianegli changed the title A pre-commit hook for formatr A pre-commit hook for formatR Nov 7, 2022
@yihui
Copy link
Owner

yihui commented Nov 7, 2022

I'm not familiar with pre-commit. Please feel free to submit a pull request if it's simple enough. Thanks!

@lorenzwalthert
Copy link

lorenzwalthert commented Nov 7, 2022

Just for your interest, I built the R integration of pre-commit and I maintain a bunch of hooks, including a hook to format code with {styler}, at https://github.com/lorenzwalthert/precommit. You can add support for pre-commit to this {formatR} repo, as described in the link above. If you need help, let me know.

@fabianegli
Copy link
Author

@lorenzwalthert That looks nice - And I think for the repo I had in mind to use the pre-commit hook in I might actually end up recommending your style-files hook. And any help to implement the hook for formatR is of course welcome. I'm attempting that for the first time.

@lorenzwalthert
Copy link

I hope the above linked docs are self-explanatory, but I think you are the first one to attempt using it (apart from myself), so it's a good test to see if the docs are complete.

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

3 participants