fix(cran): route font cache to tempdir under R CMD check (0.2.4)#16
Merged
Conversation
Resolve a additional issue 'donttest' do CRAN: exemplos (install_fonts, svg_to_png, save_svg) baixavam fontes para ~/.cache/R/cardargus, violando a política de não escrever no home durante checks. font_cache_dir() agora detecta R CMD check via _R_CHECK_PACKAGE_NAME_ (novo helper running_under_check()) e usa um diretório temporário da sessão, deixando o uso interativo/normal inalterado (cache persistente segue padrão). Inclui testes (tests/testthat/test-fonts.R). Bump 0.2.3 -> 0.2.4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexto
Resposta automática do CRAN à submissão da 0.2.3 apontou a additional issue
donttest: a checagem com rede (BDR) detectou que o pacote grava no home do usuário durante os exemplos:Causa:
install_fonts()(exemplo\donttest) esvg_to_png()/save_svg()(exemplos normais) baixam fontes do Google para o cache persistente (tools::R_user_dir("cardargus","cache")). Isso viola a política do CRAN ("não escrever no home filespace durante checks").Correção
font_cache_dir()agora detectaR CMD checkvia a env var_R_CHECK_PACKAGE_NAME_(novo helper internorunning_under_check()) e usa um diretório temporário da sessão. Resultado:tempdir()→ nada no home → CRAN limpoVerificação
Confirmado que
~/.cache/R/cardarguspermanece inalterado após o check com--run-donttest. Teste unitário emtests/testthat/test-fonts.Rvalida o roteamento (78 testes no total).Bump 0.2.3 → 0.2.4.
🤖 Generated with Claude Code