ropensci / spelling

Tools for Spell Checking in R
https://docs.ropensci.org/spelling
Other
105 stars 27 forks source link

Load Rd macros if checking package #44

Closed gaborcsardi closed 4 years ago

gaborcsardi commented 4 years ago

Closes #42

jeroen commented 4 years ago

I think we need a default value for the macros parameter in spell_check_file_rd because now it doesn't work at all if we don't specify macros :

> spell_check_files("man/spell_check_files.Rd")
# Error in tools::RdTextFilter(rdfile, macros = macros) : 
#  argument "macros" is missing, with no default 
codecov-io commented 4 years ago

Codecov Report

Merging #44 into master will decrease coverage by 0.88%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage   45.11%   44.22%   -0.89%     
==========================================
  Files           7        7              
  Lines         317      303      -14     
==========================================
- Hits          143      134       -9     
+ Misses        174      169       -5
Impacted Files Coverage Δ
R/spell-check.R 30.7% <0%> (-0.12%) :arrow_down:
R/check-files.R 63.51% <0%> (+0.35%) :arrow_up:
R/rmarkdown.R 33.33% <0%> (-10.67%) :arrow_down:
R/parse-markdown.R 83.33% <0%> (-0.88%) :arrow_down:
R/remove-chunks.R 85.71% <0%> (-0.65%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 569a24f...befbd78. Read the comment docs.

gaborcsardi commented 4 years ago

I changed it to use the RdTextFilter default if macros is not specified.

jeroen commented 4 years ago

Thanks. Is the ... in spell_check_file_one() really needed you think? I guess most users will just use spell_check_package() for Rd files?

I think it's a bit confusing to have undocumented parameters in ... that only apply to a specific format (rd in this case). It it's not essential I'm going to take that out.

Looks good otherwise I think.

gaborcsardi commented 4 years ago

I don't think it is essential, but I don't know when spell_check_file_one() is called.

jeroen commented 4 years ago

OK I'll take it out then. It's only used for spell_check_files(), i.e. manually spelling checking a single file that is not part of a pkg.

gaborcsardi commented 4 years ago

I took it out.

jeroen commented 4 years ago

OK looks good now thanks!!