Skip to content

Check file extension when identifying files in R to roxygenise #625

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

Closed
mkoohafkan opened this issue Apr 24, 2017 · 4 comments
Closed

Check file extension when identifying files in R to roxygenise #625

mkoohafkan opened this issue Apr 24, 2017 · 4 comments
Labels
feature a feature request or enhancement

Comments

@mkoohafkan
Copy link

If a user does something silly like leave old documented code files in the R folder, but with the extension .oldR, otheR, etc. (such as I sometimes do when rewriting functions) Roxygen will still parse the Roxygen comments in those files, potentially leading to namespace weirdness. I'm guessing there's a regex call to blame that searches for "r$" rather than "\.r$"

@mkoohafkan
Copy link
Author

I think it's a simple fix to change this line from

sort_c(dir(file.path(path, "R"), "[.Rr]$", full.names = TRUE))

to

sort_c(dir(file.path(path, "R"), "\\.[Rr]$", full.names = TRUE))

I'll test it and submit a pull request later.

@hadley
Copy link
Member

hadley commented Aug 16, 2017

Were you still interested in doing the PR?

@hadley hadley added feature a feature request or enhancement wip work in progress labels Aug 16, 2017
@mkoohafkan
Copy link
Author

Sorry, completely forgot---yes, but I won't be able to do it until September (away from computer)

@hadley hadley removed the wip work in progress label Aug 18, 2017
@hadley
Copy link
Member

hadley commented Aug 18, 2017

Ok, in that case I'll just do myself since it's so small :)

@hadley hadley closed this as completed in 202fafa Aug 18, 2017
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

2 participants