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

RccpExports always gives Trailing blank line #282

Closed
EdwinTh opened this issue Nov 16, 2017 · 3 comments
Closed

RccpExports always gives Trailing blank line #282

EdwinTh opened this issue Nov 16, 2017 · 3 comments
Labels
feature a feature request or enhancement

Comments

@EdwinTh
Copy link

EdwinTh commented Nov 16, 2017

Firts of all my n = 1, since I have one package in which Rcpp is used.

The file RcppExports.R that is createad by Rcpp always produces a Trailing blank line. I have to remove it at every rebuild to be lint free.

If this is consistent, IMO it might be desirable to ignore RcppExports when linting. Otherwise you have to remove the trailing line in this file after each build to be lint free.

@kenahoo
Copy link

kenahoo commented Dec 20, 2018

I came here to report the same problem. Options are:

  1. Fix the problem upstream in Rcpp::compileAttributes(). Not sure they should really have to worry about lint checks in their generated code, though.
  2. Always ignore R/RcppExports.R when linting - seems reasonable, but also kind of special-casey and hard-codey.
  3. Detect auto-generated files by some regex on the contents of the file - most of them have something like Rcpp's "Generated by using Rcpp::compileAttributes() -> do not edit by hand" comment. Probably not very standard, though.
  4. Ask people to add exclude="R/RcppExports.R" to their lintr::expect_lint_free() call in the tests - this doesn't seem to actually exclude the file, and it also causes any lines I've marked as # nolint to fail with whatever their linting issue is. And it seems sub-ideal to ask everyone who uses Rcpp to do this.

@jimhester jimhester added the feature a feature request or enhancement label Sep 23, 2019
@jimhester
Copy link
Member

I think just always ignoring R/RcppExports.R is what we should do.

@BenoitLondon
Copy link

there is a typo in the file name
image
please reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants