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

Auto lintr? #227

Closed
naught101 opened this issue Mar 21, 2017 · 3 comments
Closed

Auto lintr? #227

naught101 opened this issue Mar 21, 2017 · 3 comments

Comments

@naught101
Copy link

Has anyone looked at implementing an automatic lint fixer for R? Something along the lines of autopep8? R really lends it self to writing untidy code, and so an automatic tool would be really useful. For example, it could be applied to multiple branches of a repo before merging to make merging much smoother.

I'm not sure how much work would be involved, but I guess a fair bit. I also guess there probably wouldn't be much code worth sharing with autopep8, but there might be some lessons to be learned from there. Perhaps @hhatto or @myint would be able to provide some insight?

@naught101
Copy link
Author

Oh, I just found https://github.com/yihui/formatR, which probably covers most bases. Sorry for the noise.

@naught101
Copy link
Author

Hrm.. except it does not deal very well with line breaks inside function calls (yihui/formatR#53)...

@jimhester
Copy link
Member

I have long wanted to extend lintr, or write a package which builds on lintr outputs to do reformatting / autocorrecting of lint results. There are some issues with the amount of informationHowever there are a few packages that give you some of this functionality.

  • formatR - subject to caveats mentioned in that package.
  • rfmt - Novel layout algorithm which works quite well, however requires python to be installed and is not on CRAN.
  • styler - In development package by @krlmlr and @yihui, part of a google summer of code project, but could be what you are looking for once it is 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

2 participants