From 6d54d581b2d83ba51d2e14c2290473e74de25ba2 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Sat, 3 Oct 2026 20:32:43 +0200 Subject: [PATCH] (v3.0.1.9100) Fix unit test on wrapped warnings; taxonomy build never touches the version number - test-data-microorganisms.R: warnings are wrapped to the console width, so the expected patterns now allow a line break between words (failed on GitHub Actions since v3.0.1.9097) - reproduction_of_microorganisms_CLAUDE.md, step 4: the agent never changes the version number or date, the human sets them when merging Co-Authored-By: Claude Opus 5.5 --- DESCRIPTION | 2 +- NEWS.md | 2 +- .../reproduction_of_microorganisms_CLAUDE.md | 8 +++++--- tests/testthat/test-data-microorganisms.R | 7 ++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 49c8b8e46..decf80642 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 3.0.1.9099 +Version: 3.0.1.9100 Date: 2026-10-03 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 0e6f8113e..8082ff342 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 3.0.1.9099 +# AMR 3.0.1.9100 Planned as v3.1.0, mid October 2026. diff --git a/data-raw/_reproduction_scripts/reproduction_of_microorganisms_CLAUDE.md b/data-raw/_reproduction_scripts/reproduction_of_microorganisms_CLAUDE.md index 280a45867..9f0a4a016 100644 --- a/data-raw/_reproduction_scripts/reproduction_of_microorganisms_CLAUDE.md +++ b/data-raw/_reproduction_scripts/reproduction_of_microorganisms_CLAUDE.md @@ -230,9 +230,11 @@ something (then fix the script)? Never weaken a test just to make it pass. 1. Update `TAXONOMY_VERSION` in `R/aa_globals.R` with the values from step 1. 2. Run `devtools::document()`. 3. `NEWS.md`: add one short bullet under `### Updates` (e.g. "Updated taxonomy of microorganisms to - GBIF/COL , LPSN and MycoBank of "), no full stop at the end. The version - number in `DESCRIPTION` and on line 1 of `NEWS.md` is set by the git pre-commit hook; check after - the first commit that it was bumped exactly once for this PR, following `CLAUDE.md`. + GBIF/COL , LPSN and MycoBank of "), no full stop at the end. +4. **Never touch the version number or date**: not the `Version:` or `Date:` field in `DESCRIPTION`, + not line 1 of `NEWS.md`, and no version prefix in commit messages. This overrides the PR section + of `CLAUDE.md` for this PR: the human sets the version when merging. The git pre-commit hook only + acts on `main`, so it leaves them unchanged on this branch. ## Step 5: findings report for the human diff --git a/tests/testthat/test-data-microorganisms.R b/tests/testthat/test-data-microorganisms.R index 526cf623a..bba794963 100644 --- a/tests/testthat/test-data-microorganisms.R +++ b/tests/testthat/test-data-microorganisms.R @@ -181,15 +181,16 @@ test_that("MO codes: codes of earlier releases are translated, never guessed", { mo_name_without_suffix(translated$fullname) ) + # warnings are wrapped to the console width, so the patterns allow a line break between words # regression: in October 2026, the code of Trichophyton (F_TRCHP, v3.0.1) was guessed as Talaromyces - expect_warning(x <- as.mo("F_TRCHP_RBRM", info = FALSE), "earlier AMR package version") + expect_warning(x <- as.mo("F_TRCHP_RBRM", info = FALSE), "earlier AMR package\\s+version") expect_identical(mo_name(x, language = NULL), "Trichophyton rubrum") expect_identical(suppressWarnings(mo_genus("F_TRCHP", language = NULL)), "Trichophyton") # codes from before v2.0.0 and unknown codes are never guessed (decision by Matthijs S. Berends, 3 October 2026) - expect_warning(x <- as.mo("B_ESCH_COL", info = FALSE), "not supported") + expect_warning(x <- as.mo("B_ESCH_COL", info = FALSE), "not\\s+supported") expect_true(is.na(x)) - expect_warning(x <- as.mo(c("B_ESCHR_COL", "B_ESCHR_COLI"), info = FALSE), "unknown MO code") + expect_warning(x <- as.mo(c("B_ESCHR_COL", "B_ESCHR_COLI"), info = FALSE), "unknown\\s+MO\\s+code") expect_identical(as.character(x), c(NA, "B_ESCHR_COLI")) # regression: until October 2026, a MycoBank target that was not in the data set replaced a valid GBIF target by NA