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

Unvendor the vignettes/ directory for R packages #6160

Merged
merged 4 commits into from
Nov 14, 2022
Merged

Unvendor the vignettes/ directory for R packages #6160

merged 4 commits into from
Nov 14, 2022

Conversation

jennybc
Copy link
Contributor

@jennybc jennybc commented Nov 11, 2022

Description

In an R package, the vignettes/ directory holds executable documents that are rendered into documentation at package build time. Currently linguist incorrectly labels this folder as vendored code, which has multiple downstream downsides, including causing exclusion of the files below vignettes/ from code search. (It seems like linguist might use the "vendored" label pragmatically, but then other projects use this data and take the label at face value?)

This was introduced in 9ae0bdb, which was wrong IMO. (Or, at least, has become wrong as other folks started to use linguist's vendored list as if it really means vendored).

The executable documents in vignettes/ tend to be RMarkdown documents, a file type that that is already (correctly) handled elsewhere in linguist:

In languages.yml:

https://github.com/github/linguist/blob/16a7a528ab840dd24188edda671d31881a67e527/lib/linguist/languages.yml#L5428-L5439

The executable documents we keep in vignettes/ are compiled to PDF or html files that live in inst/doc/, which is already handled (by which I mean "excluded"), thanks to #4068:

https://github.com/github/linguist/blob/16a7a528ab840dd24188edda671d31881a67e527/lib/linguist/documentation.yml#L19

linguist is correctly ignoring the rendered documentation but is incorrectly labelling the source as vendored code, which it's not.

Checklist:

  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.

It's not clear to me that this functionality is tested. Sorry if that's just user error.

@jennybc jennybc requested a review from a team as a code owner November 11, 2022 20:52
@jennybc
Copy link
Contributor Author

jennybc commented Nov 11, 2022

If you want to see a bunch of wild-caught R packages, we have a read-only mirror of CRAN here: https://github.com/cran.

Some packages, but not all, have vignettes/ and that mostly contains .Rmd files. When vignettes/ is present, the corresponding rendered documentation is found int inst/doc/.

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know nothing about R but your explanation makes sense and checks out.

@lildude lildude merged commit a7b898e into github-linguist:master Nov 14, 2022
@hadley
Copy link

hadley commented Nov 14, 2022

@lildude any sense of how long it will take this change to percolate in code indexing on github.com?

@lildude
Copy link
Member

lildude commented Nov 14, 2022

Changes don't appear on GitHub until a new Linguist release is made and then deployed. I'm in the process of putting together the next release now. Repo's will also need a push for them to be reanalysed with the newer Linguist knowledge to take effect.

Search won't update until go-enry pulls in the lastest Linguist release.

@hadley
Copy link

hadley commented Nov 14, 2022

@lildude thanks!

@lildude lildude mentioned this pull request Nov 14, 2022
5 tasks
@jennybc jennybc deleted the unvendor-vignettes-for-r branch November 14, 2022 18:08
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants