-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
How to add support for a language? #926
Comments
Yep! you've found the right files to get started. I'd be happy to help you through the python parts of this if you're interested in getting started! You shouldn't need to deal with There's ~roughly a couple flavors of "languages" right now -- either those which pre-commit will bootstrap an entire environment for you ( Depending on how the R ecosystem works (I'm not at all familiar with it) you'd pick to either set up a full For the apis you have to implement for a language here's what they would do (for instance for R):
|
def run_hook(hook, file_args): | |
with in_env(hook.prefix, hook.language_version): | |
return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args) |
recent PRs
Probably the best most-recent PR which added a language is this one: #751
Then the last bit is adding a few tests for that -- I can help you out with that :)
I think we can for simplicity depend on the global installation of R. |
Sounds good, is there a mechanism for local package installation in R? |
Within the R console (again), you can
|
I've decided to clean this up and add it to the docs #1056 -- thanks for the issue it definitely helped me collect my thoughts on this :) |
Awesome, thank you :-) |
@katrinleinweber did you ever work out how to write a pre-commit hook for styler? I'm interested in doing the same but don't want to reinvent the wheel |
@scottgigante-immunai you can use the {styler} hook from https://github.com/lorenzwalthert/precommit, hopefully soon with pre-commit.ci support :D |
Amazing! Thank you! |
Hi! Please apologise the definitely honest, but probably noob-y question.
I skimmed through pre-commit.com/#contributing, CONTRIBUTING.md and #564 looking for info on adding support for a new language.
Having found
languages/all.py
, as well as the PRs 812 & 120, I'm left wondering what level of Python knowledge would be needed? Merely Python modules (like for data analysis), or system-level integration & experience with git-interfacing modules?Thanks for any hints :-)
PS: Specifically, R would be of interest (see r-lib/styler#467) because of its use in academia.
The text was updated successfully, but these errors were encountered: