mirror of
https://github.com/msberends/AMR.git
synced 2026-03-07 21:50:11 +01:00
Fix version to single bump (9029) and update CLAUDE.md versioning rules
CLAUDE.md: Rewrite the "Version and date bump" subsection to document that:
- Exactly ONE version bump is allowed per PR (PRs are squash-merged into one
commit on the default branch, so one commit = one version increment)
- The correct version is computed from git history:
currentversion="${currenttag}.$((commits_since_tag + 9001 + 1))"
with the +1 accounting for the PR's own squash commit not yet on the
default branch
- Fall back to incrementing DESCRIPTION's version by 1 if git describe fails
- The Date: field tracks the date of the *last* PR commit (updated each time)
DESCRIPTION / NEWS.md: Correct the version from 3.0.1.9030 back to 3.0.1.9029.
Two version bumps were made across two commits in this PR; since it will be
squash-merged as one commit only one bump is correct. Also update Date to
today (2026-03-07).
https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG
This commit is contained in:
34
CLAUDE.md
34
CLAUDE.md
@@ -148,24 +148,34 @@ Version format: `major.minor.patch.dev` (e.g., `3.0.1.9021`)
|
|||||||
|
|
||||||
### Version and date bump required for every PR
|
### Version and date bump required for every PR
|
||||||
|
|
||||||
Before opening a pull request, always increment the four-digit dev counter by 1 in **both** of these files:
|
All PRs are **squash-merged**, so each PR lands as exactly **one commit** on the default branch. Version numbers are kept in sync with the cumulative commit count since the last released tag. Therefore **exactly one version bump is allowed per PR**, regardless of how many intermediate commits are made on the branch.
|
||||||
|
|
||||||
1. **`DESCRIPTION`** — the `Version:` field:
|
#### Computing the correct version number
|
||||||
```
|
|
||||||
Version: 3.0.1.9021 → Version: 3.0.1.9022
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **`NEWS.md`** — the top-level heading:
|
Run the following from the repo root to determine the version string to use:
|
||||||
```
|
|
||||||
# AMR 3.0.1.9021 → # AMR 3.0.1.9022
|
|
||||||
```
|
|
||||||
|
|
||||||
Read the current version from `DESCRIPTION`, add 1 to the last numeric component, and write the new version to both files in the same commit as the rest of the PR changes.
|
```bash
|
||||||
|
currenttag=$(git describe --tags --abbrev=0 | sed 's/v//')
|
||||||
|
currenttagfull=$(git describe --tags --abbrev=0)
|
||||||
|
defaultbranch=$(git branch | cut -c 3- | grep -E '^master$|^main$')
|
||||||
|
currentcommit=$(git rev-list --count ${currenttagfull}..${defaultbranch})
|
||||||
|
currentversion="${currenttag}.$((currentcommit + 9001 + 1))"
|
||||||
|
echo "$currentversion"
|
||||||
|
```
|
||||||
|
|
||||||
Also bump the date to the current date in **`DESCRIPTION`**, where it's in the `Date:` field in ISO format:
|
The `+ 1` accounts for the fact that this PR's squash commit is not yet on the default branch. Set **both** of these files to the resulting version string (and only once per PR, even across multiple commits):
|
||||||
|
|
||||||
|
1. **`DESCRIPTION`** — the `Version:` field
|
||||||
|
2. **`NEWS.md`** — the top-level heading `# AMR <version>`
|
||||||
|
|
||||||
|
If `git describe` fails (e.g. no tags exist in the environment), fall back to reading the current version from `DESCRIPTION` and adding 1 to the last numeric component — but only if no bump has already been made in this PR.
|
||||||
|
|
||||||
|
#### Date field
|
||||||
|
|
||||||
|
The `Date:` field in `DESCRIPTION` must reflect the date of the **last commit to the PR** (not the first), in ISO format. Update it with every commit so it is always current:
|
||||||
|
|
||||||
```
|
```
|
||||||
Date: 2025-12-31
|
Date: 2026-03-07
|
||||||
```
|
```
|
||||||
|
|
||||||
## Internal State
|
## Internal State
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 3.0.1.9030
|
Version: 3.0.1.9029
|
||||||
Date: 2026-03-06
|
Date: 2026-03-07
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
data analysis and to work with microbial and antimicrobial properties by
|
data analysis and to work with microbial and antimicrobial properties by
|
||||||
|
|||||||
2
NEWS.md
2
NEWS.md
@@ -1,4 +1,4 @@
|
|||||||
# AMR 3.0.1.9030
|
# AMR 3.0.1.9029
|
||||||
|
|
||||||
### New
|
### New
|
||||||
* Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes`
|
* Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes`
|
||||||
|
|||||||
Reference in New Issue
Block a user