-
Notifications
You must be signed in to change notification settings - Fork 185
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
Implement tag based documentation #908
Implement tag based documentation #908
Conversation
A test that might be worth adding would be to check that all exported functions with the This test would pass currently:
|
We may want to use this PR as an opportunity to switch to markdown style roxygen documentation in lintr. e.g. run |
We might want to also |
The PR is quite large... it will be easier to review if subdivided. at a glance each of your bullets could be their own PR (though feel free to rearrange). if we want to avoid merging to main until it's done, let's have a sequence of PRs that we merge into this branch, then to main, WDYT? |
Hmm I'm not so sure this will make it easier to review, since multiple of those points touch nearly every file in the codebase. If it helps, I can try to write down my refactoring process? |
I think even so, if I can scroll through all the files looking for just one thing that'll be easier than checking for several things at once |
I see. Will try to make a somewhat sensible sequence of PRs into this branch, force-resetting this one to step 1. |
thanks! appreciate the extra effort |
@MichaelChirico I've split up the PR so far into 3 separate steps. I plan on adding a Step 4 to include the suggestion by @jimhester to switch to md based roxygen, as well as to add |
how does that translate into the .Rd exactly? |
Exactly. See AshesITR/lintr#3.
|
I'm done with Step 4 now. In case of changes in a step, I would rebase the following PRs on the altered version of the previous step, so in the end we could merge all steps into #908 and finally write up a NEWS bullet and merge #908 into master. |
OK thanks. I take it that's why this is still marked as draft -- kept as draft until the other PRs are merged here. Starting to review now. |
I'll review the other PR, then we can merge to here. GitHub doesn't make it easy to say "I've reviewed through commit X, show me the diff relative to that" (it's possible but cumbersome) |
The oldrel-4 build failure is due to a bug in rmarkdown: |
@MichaelChirico, @jimhester PTAL. |
* New tag based documentation pages for linters (#888, @AshesITR) | ||
* Each linter has its own help page | ||
* `?linters` also links to tag help pages, collecting linters with a similar goal | ||
* Each linter can have multiple tags | ||
* New function `available_linters()` to list available linters and their tags | ||
This feature is extensible by package authors providing add-on linters for {lintr}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could add the bullets on the top level and duplicate the issue number?
* `?linters` also links to tag help pages, collecting linters with a similar goal | ||
* Each linter can have multiple tags | ||
* New function `available_linters()` to list available linters and their tags | ||
This feature is extensible by package authors providing add-on linters for {lintr}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this bullet is pretty vague maybe a See ?available_linters reference?
@@ -79,6 +79,12 @@ function calls. (#850, #851, @renkun-ken) | |||
* Debugging functions (`browser()`, `debug()`, `debugcall()`, `debugonce()`, `trace()`, `undebug()`, `untrace()`) are now part of the default set of undesirable functions to help prevent them from being committed by mistake. (#876, @michaelchirico) | |||
* New linter `package_hooks_linter()` runs a series of checks also done by `R CMD check` on the `.onLoad()`, `.onAttach()`, `.Last.lib()` and `.onDetach()` hooks (#882, @MichaelChirico) | |||
* Improved location information for R parse errors (#894, #892, @renkun-ken and @AshesITR) | |||
* New tag based documentation pages for linters (#888, @AshesITR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would help to motivate this (why as lintr user do I care about this update?). maybe a quick blurb like
Add new tag-based documentation pages for linters to help organize information surrounding the growing number of linters available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refining:
To help organize information surrounding the growing number of linters available, we've added metadata "tags" for each linter
(#888)
.
bullet: each tag gets a help page, e.g. ?x
WDYT
@@ -79,6 +79,12 @@ function calls. (#850, #851, @renkun-ken) | |||
* Debugging functions (`browser()`, `debug()`, `debugcall()`, `debugonce()`, `trace()`, `undebug()`, `untrace()`) are now part of the default set of undesirable functions to help prevent them from being committed by mistake. (#876, @michaelchirico) | |||
* New linter `package_hooks_linter()` runs a series of checks also done by `R CMD check` on the `.onLoad()`, `.onAttach()`, `.Last.lib()` and `.onDetach()` hooks (#882, @MichaelChirico) | |||
* Improved location information for R parse errors (#894, #892, @renkun-ken and @AshesITR) | |||
* New tag based documentation pages for linters (#888, @AshesITR) | |||
* Each linter has its own help page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe add an example ", e.g. ?seq_linter"
@@ -79,6 +79,12 @@ function calls. (#850, #851, @renkun-ken) | |||
* Debugging functions (`browser()`, `debug()`, `debugcall()`, `debugonce()`, `trace()`, `undebug()`, `untrace()`) are now part of the default set of undesirable functions to help prevent them from being committed by mistake. (#876, @michaelchirico) | |||
* New linter `package_hooks_linter()` runs a series of checks also done by `R CMD check` on the `.onLoad()`, `.onAttach()`, `.Last.lib()` and `.onDetach()` hooks (#882, @MichaelChirico) | |||
* Improved location information for R parse errors (#894, #892, @renkun-ken and @AshesITR) | |||
* New tag based documentation pages for linters (#888, @AshesITR) | |||
* Each linter has its own help page | |||
* `?linters` also links to tag help pages, collecting linters with a similar goal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea (you may have mentioned this/similar before): it may be nice to have an API to set linters by tag in .lintr, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An idea might be to export alll those linter lists like default_linters
and think of a smart way of deduplication?
e.g. make something like linters: with_defaults(best_practices_linters, readability_linters)
work, returning all linters that are tagged any of default, best_practices or readability work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NEWS is the only thing new to this PR right? that's all I've reviewed so far
Sorry @MichaelChirico I saw only the last comment. Let's fix these up when preparing for the 3.0.0 release. |
Closes #888
So far:
available_linters(packages = "lintr")
to return a tibble of available linters contained in the packages specifiedavailable_linters(packages = ...)
always returns a data framedefault
tag is consistent withdefault_linters
inst/lintr/linters.csv
in a Package Authors section of?available_linters
?linters
tag_linters
for all tags, each listing all linters tagged with the tag, plus a small description?linters