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

R support #182

Closed
mllg opened this issue Nov 24, 2016 · 7 comments
Closed

R support #182

mllg opened this issue Nov 24, 2016 · 7 comments
Labels
new tool Support for new linters, fixers, etc.
Milestone

Comments

@mllg
Copy link

mllg commented Nov 24, 2016

I've setup a linter for R using the lintr package here: https://github.com/mllg/ale. This was ridiculously easy!

The only hindrance is that lintr does not support stdin and at the same time the script needs to be executed in the directory of the buffer to find .lintr config files. Probably the same problem as in #173. Are there any plans on implementing a general solution (like an option to set the directory or a flag signaling whether the command should be run in the same directory as the buffer or not)?

@w0rp w0rp added the new tool Support for new linters, fixers, etc. label Nov 25, 2016
@w0rp
Copy link
Member

w0rp commented Nov 25, 2016

It's hard to propose a general solution for that. There are two ways you can lint files while you type. You can either save a temporary file in the same directory, or you can use the text buffer in Vim and send the text via stdin to the program. Both have their issues, and ALE does the latter.

Is the only problem finding the .lintr config files? You could support this by finding the config files in Vim before running the command, and then pass an argument to use them manually. The jshint linter works that way. I'd look at the script for that linter. For eslint and some other linters, they allow you to both send stdin input to the programs and also indicate what the filename is. If the R linter supports that, that's another option.

@gkapfham
Copy link

Hello @mllg and @w0rp! I am please to learn that you have setup a linter for R. I also do a lot of programming in R and I am wondering if you can post the details of your solution here. Even if the solution is not general-purpose, I anticipate that others like myself would benefit from it.

Finally, @w0rp, thanks for developing Ale! I use this on a very regular basis and would enjoy using it even more if it was fully integrated with lintr.

@w0rp
Copy link
Member

w0rp commented Jun 23, 2017

I might see if I can merge this and use the lint_file option, which was added months after this issue was opened.

@w0rp w0rp added this to the Version 1.5 milestone Jun 23, 2017
@gkapfham
Copy link

Hi @w0rp! Once again, thanks for developing Ale. I use it very regularly and find that it is a great addition to my writing and programming workflow in vim and neovim. If you could add this feature to an upcoming version of Ale, then I would be glad to test it on my Ubuntu 16.04 development workstation running:

NVIM v0.2.1-dev
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 23 2016 18:16:55)
Included patches: 1-134

Again, I have numerous R code bases and I would be glad to test this linter once it is integrated. Thanks again! i look forward to testing out this linter in the near future.

@w0rp
Copy link
Member

w0rp commented Jun 24, 2017

@gkapfham Cool, thanks. There are some languages I don't use frequently, and R is one of them, so getting some of the linters to work well depends on others testing them against real projects.

I marked this with the milestone for the version after the one I'm working on now. It'll get done eventually.

@w0rp w0rp closed this as completed in a1cf7f6 Jul 3, 2017
@w0rp
Copy link
Member

w0rp commented Jul 3, 2017

I have added support for lintr now. It didn't take me too long to figure out how to install R, run the REPL, and install lintr. R's tools are okay. 👍

rsrchboy added a commit to rsrchboy/ale that referenced this issue Jul 4, 2017
* origin/master:
  Remove the issue template note about the log_output option, now it's on by default.
  Store the output of commands by default so I don't have to ask people to turn it on any more.
  Fix dense-analysis#216 - Filter out errors for other files for ansible-lint
  Fix dense-analysis#182 - Add support for lintr
  Fix dense-analysis#178 - Check Stylus files with stylelint
  Drop "only master branch" travis restriction
  Add a function for fixing the alignment of Vim help tags
@gkapfham
Copy link

gkapfham commented Jul 5, 2017

Hello @w0rp, I am writing to confirm that the integration with lintr is working correctly. I have tested it with the version of lintr that I installed with devtools and it worked exactly as expected. In the next two weeks I will be doing a lot of R programming. I will report back here if I notice any problems.

In summary, thanks again for developing ale — I use it on a very regular basis and I am really looking forward to trying out this integration with lintr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new tool Support for new linters, fixers, etc.
Projects
None yet
Development

No branches or pull requests

3 participants