Skip to content

0.2.2 - #49

Merged
davidycliao merged 14 commits into
masterfrom
0.2.2
Jul 20, 2026
Merged

davidycliao merged 14 commits into
masterfrom
0.2.2

Conversation

@davidycliao

Copy link
Copy Markdown
Owner

No description provided.

davidycliao and others added 14 commits July 20, 2026 12:58
bill_to_network() used several igraph functions (V, V<-, E, membership)
that were not declared via @importFrom, and igraph itself was missing
from DESCRIPTION Imports, so the function would fail at runtime for
users without igraph already loaded. Add tests covering the function's
output structure, top_n selection, and use_all mode.

Also adds accessibility alt-text to logo images, a GIND@NTU link to the
pkgdown homepage, and rebuilds the pkgdown site.
…n_info duplicate

R CMD check --as-cran previously failed with 2 ERRORs:
- checking examples: review_session_info() was defined twice in R/info.R;
  the dead first definition's unguarded example got merged into the Rd
  file's \examples block ahead of the working implementation's \dontrun
  block, so R CMD check ran a live network call. Removed the dead
  duplicate definition (the second, curl-based implementation always won
  at runtime anyway).
- checking tests: numerous tests call the live Legislative Yuan API with
  no guard, so a CRAN check machine hitting a flaky/unreachable endpoint
  would fail the whole check and risk the package being pulled. Added
  skip_on_cran() plus graceful tryCatch-based skips to every
  network-dependent test.

Also switches bill_to_network() off the igraph::get.edgelist() function
deprecated in igraph 2.0, and adds cran-comments.md documenting the
remaining non-ASCII WARNING (Traditional Chinese strings are load-bearing:
they match live API column names and split Chinese legislator name lists,
so escaping or translating them isn't safe to automate) and the
CRAN-machine-only "unable to verify current time" NOTE.
… PDF manual, non-ASCII docs)

win-builder's incoming pretest reported 1 ERROR, 2 WARNINGs, 2-3 NOTEs on
both Windows and Debian. Root causes and fixes:

- LICENSE contained MIT-license boilerplate copy-pasted from an unrelated
  package (flaiR), conflicting with DESCRIPTION's "GPL-3 + file LICENSE".
  Replaced with the standard GPL-3 stub (YEAR/COPYRIGHT HOLDER).

- Authors@R had Chinese-language name fields ("歐噴有限公司", "立法院")
  that made the PDF reference manual fail to build entirely (LaTeX has no
  CJK font support in CRAN's default build). Removed the Chinese, kept the
  English org names. Verified \uXXXX and \enc{}{} do NOT survive Rd-to-
  LaTeX rendering for CJK, so the only real fix is translating all
  roxygen-derived content (title/description/params/examples/return docs)
  across 17 R files (~240 lines) to English. Functionally load-bearing
  Chinese (regex separators, live API column/category names) stays in
  the R code itself, documented in English with a note instead.

- Found two more copy-paste bugs while auditing every roxygen block:
  get_committee_record had a second, fully orphaned doc block (roxygen
  silently discarded it), and get_legislators' docs had a stray
  get_executive_response() example call sitting outside \dontrun{},
  silently hitting a live, unrelated API endpoint on every check.

- DESCRIPTION: removed the invalid 'AS-CRAN' field, reworded Description
  to not start with "The package".

- Fixed the CONDUCT.md link (real path is inst/CONDUCT.md, not repo root)
  and the codecov.io link (redirects to app.codecov.io). Removed
  inst/README.Rmd/.md, a stale v0.1.6-era duplicate of the root README
  that CRAN's URL check was actually scanning instead of the current one.

- Wrapped get_meetings()'s second example in \dontrun{} (was silently
  hitting the live API on every check like the other bugs above) and
  shortened a resulting example line under the 100-char Rd width limit.

R CMD check --as-cran --manual now reports 0 errors, with the PDF manual
building cleanly; see cran-comments.md for the two remaining justified
NOTEs and the non-ASCII WARNING (now confined to functionally load-bearing
Chinese in R code, not documentation).
The skip_if(is.null(result), ...) guards already catch errors via
tryCatch, but the underlying curl/jsonlite connection attempt also
signals a warning before failing, which testthat surfaced as a WARNING
on 6 tests even though they correctly skipped afterward. Wrap each
guarded call in suppressWarnings() so an unreachable API produces a
clean SKIP with no noise.
…odeFactor

The repository's CodeFactor grade (C) is dragged down by vendored/generated
paths it shouldn't be analyzing as source: pkgdown's bundled third-party JS/CSS
(docs/deps/**, minified and inherently "low quality" by static analysis),
RStudio's local notebook cache (.Rproj.user/**), and auto-generated Rd/vignette
output (man/**, inst/doc/**). Add .codefactor.yml to exclude them.
LICENSE had drifted back to MIT-license boilerplate text, inconsistent
with DESCRIPTION's "License: GPL-3 + file LICENSE". Restore the standard
GPL-3 stub format (YEAR/COPYRIGHT HOLDER) so the two agree.
…README)

- Exclude .codefactor.yml from the built package via .Rbuildignore;
  CRAN flagged it as an unrecognized hidden file ("checking for hidden
  files and directories" NOTE). Verified it's now absent from a fresh
  R CMD build tarball.
- Fill in an empty markdown link ("[the newer functions]()") in
  README.Rmd that CRAN's URL check flagged as an empty URL; points to
  the pkgdown reference page's API V2 section.

The LICENSE/DESCRIPTION mismatch this same review flagged was already
fixed in 8aaa5cc, prior to this submission's tarball being built.
CRAN's incoming check flagged it as a non-standard top-level file. It's
a stray local rendering artifact from knitting README.Rmd (rmarkdown
sometimes writes an intermediate .html alongside the .md), never meant
to ship in the package.
…XXXX

R CMD check's "checking code files for non-ASCII characters" WARNING
persisted even after translating all roxygen documentation, because 15
R/ files still contain functionally load-bearing Chinese: regex
separators splitting Chinese-language legislator name lists, gsub
patterns stripping Chinese honorific prefixes, and string literals/list
names matching the Legislative Yuan API's own Traditional Chinese
column and category names verbatim.

Verified experimentally that \uXXXX escapes are valid R syntax inside
double-quoted string literals and bracket-notation (`x[["name"]]`)
names, and are byte-for-byte identical to the literal character at
runtime (confirmed via identical() round-trips and, for the more
complex nested-list extraction logic in get_ly_committees.R, a direct
side-by-side comparison against the pre-escape function body on
synthetic API-shaped data).

Backtick-quoted names (`` `中文` ``) do NOT support \u escapes (R errors
with "sequences not supported inside backticks"), so bare/backtick
Chinese identifiers were first rewritten to equivalent quoted-string or
bracket-notation form (`list("屆" = term)`, `meet[["發言紀錄"]]`) before
escaping - a syntax change only, with no behavioral difference.

Pure comments and user-facing cat()/message()/stop() text (not tied to
matching live data) were translated to English instead of escaped, to
keep the source readable.

R CMD check --as-cran --manual now reports 0 errors, 0 warnings, 2 notes
(both pre-existing environment artifacts, documented in cran-comments.md).
Full test suite unchanged: 130 pass, 10 skip (network-dependent, skip
gracefully when the Legislative Yuan API is unreachable), 0 fail.
@davidycliao
davidycliao merged commit 9d480bd into master Jul 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant