Português
Contribuições são bem-vindas. Para relatar erros em get_*(), abra uma issue com exemplo mínimo reproduzível. Para propor dados, abra uma issue antes do PR. Para alterações no painel, inclua captura ou esboço. Correções de texto e novos testes de funções existentes podem vir diretamente por PR.
Discussões de compatibilidade com o educabR, de Sidney Bissoli, estão na issue #8 e em planning/integration-educabR.md. Consulte planning/ antes de propor algo que já esteja planejado.
Acrescentar dados
A proposta deve trazer:
- Proveniência estável: DOI, arquivo permanente ou portal oficial.
- Licença clara de redistribuição; fontes restritas exigem permissão explícita dos autores, registrada na issue.
- Referência bibliográfica em
inst/dict/vocabularies/sources.yaml, utilizada poreducabr_cite(). - Script ETL em
data-raw/NN_build_<dataset>.R, que harmonize os dados ao esquema deinst/dict/schema.yamle gravedata/<dataset>.rda. - Validação por
educabr2:::validate_against_schema()ao fim do ETL. - Teste em
tests/testthat/test-<dataset>.R, com fixture do carregador.
Estilo e verificação
Use roxygen2 com Markdown para funções exportadas, cli::cli_abort() e cli::cli_warn() para novos erros/avisos, nomes snake_case e verbos no estilo dplyr. Mantenha dependências mínimas; prefira base R e rlang::%||% a acrescentar pacotes desnecessários.
Antes do PR, execute devtools::document(), devtools::test(), devtools::check(cran = TRUE) e spelling::spell_check_package(). Documente limitações da validação. Para novas funções, use @export, registre a função em _pkgdown.yml, escreva exemplo executável e explique o que mudou e por quê no commit/PR. Mantenha a documentação pública nos dois idiomas. Para mudanças no painel ou traduções, execute também Rscript tools/check-bilingual.R.
English
Thanks for considering a contribution. The fastest way to be useful depends on what you have in mind.
Quick map
| You want to… | Best path |
|---|---|
Report a bug in a get_*() function |
Open an issue with a minimal reprex |
| Suggest a new data source | Open an issue first (see “Adding a dataset” below) — please do not open a PR cold |
| Propose a UX change to the dashboard | Open an issue with a screenshot or sketch |
| Fix a typo / improve docs | Send a PR straight away, no issue needed |
| Add tests for an existing function | Send a PR straight away |
Discuss compatibility with educabR
|
See planning/integration-educabR.md and chime in via issue |
The planning/ folder lists everything queued for the package (roadmap, CRAN checklist, datasets wishlist, integration designs). Skim it before proposing something new — your idea may already be scoped, or live in a related design doc.
Adding a dataset
educabr2 is opinionated about which data it ships. New sources are welcome but they need:
- A stable provenance — DOI, archive link, or government portal URL that will not vanish next year.
- A clear redistribution licence — public domain, CC0, CC BY are straightforward; restrictive academic licences need explicit permission from the authors (paste correspondence in the issue).
-
A bibliographic citation added to
inst/dict/vocabularies/sources.yaml(the helpereducabr_cite()reads from there). -
An ETL script under
data-raw/NN_build_<dataset>.Rthat takes the raw file, harmonises it to the canonical schema documented ininst/dict/schema.yaml, and writes adata/<dataset>.rda. -
Validation via
educabr2:::validate_against_schema()(called at the end of the ETL script). -
A test file under
tests/testthat/test-<dataset>.Rwith a fixture exercising the loader.
Open the issue with these six bullets in mind — we’ll iterate on the design before any code is written.
Code style
- Roxygen2 (markdown) for all exported functions.
-
cli::cli_abort()/cli::cli_warn()for user-facing errors; do not use basestop()/warning()for new code. - snake_case for objects and functions;
dplyr-style verb naming for helpers (filter_,arrange_, etc.). - Keep imports minimal: prefer
rlang::%||%and base R over adding a new dependency.
Before opening a PR
devtools::document() # roxygen
devtools::test() # all tests pass
devtools::check(cran = TRUE) # 0 errors, 0 warnings, 0 notes
spelling::spell_check_package() # 0 issues
# For dashboard or translation changes:
# Rscript tools/check-bilingual.RIf you added a new function: - export it in roxygen (@export) - add it to _pkgdown.yml under the appropriate reference section - describe the change and its motivation in the commit and PR; keep public documentation equivalent in Portuguese and English - write at least one example in the roxygen block (CRAN runs them)
