chore: update .gitignore and clean up README structure - #4
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the manual release workflow’s logic for detecting and updating the version field in pyproject.toml.
Changes:
- Loosened the
versionfield detection to allow leading whitespace. - Updated the Perl replacement regex to allow optional leading whitespace before
version.
Comments suppressed due to low confidence (1)
.github/workflows/release.yml:63
- The PR title mentions updating
.gitignoreand README structure, but this change is to the release workflow’s version-bump logic. If this is intentional, consider updating the PR title/description to reflect the workflow change so it’s easier to review and track in history.
- name: Bump version in pyproject.toml
id: bump
run: |
set -e
NEW_VERSION="${{ github.event.inputs.version }}"
FILE=pyproject.toml
if ! grep -q '^\s*version' "$FILE"; then
echo "pyproject.toml does not contain a version field" >&2
exit 1
fi
# replace version = "..." (allow optional leading whitespace)
perl -0777 -pe "s/^\s*version\s*=\s*\"[0-9]+\.[0-9]+\.[0-9]+(?:[-+][^\"]*)?\"/version = \"${NEW_VERSION}\"/m" -i "$FILE"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NEW_VERSION="${{ github.event.inputs.version }}" | ||
| FILE=pyproject.toml | ||
| if ! grep -q '^version' "$FILE"; then | ||
| if ! grep -q '^\s*version' "$FILE"; then |
There was a problem hiding this comment.
grep -q '^\s*version' won’t treat \s as whitespace in GNU grep (BRE/ERE); it matches a literal s, so this check may incorrectly fail even when version = ... exists. Use a POSIX character class (e.g. ^[[:space:]]*version) or switch to grep -P if you specifically want \s.
| if ! grep -q '^\s*version' "$FILE"; then | |
| if ! grep -q '^[[:space:]]*version' "$FILE"; then |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
No description provided.