Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add help docs about semver-checks #1590

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@ cargo +nightly miri test

Run `just` to see all available commands.

### 💥 API-breaking changes

Any breaking change in the public Rust APIs will cause the next release to be a
major version bump. You can check the next release version [draft release
PR](https://github.com/CQCL/hugr/pulls?q=is%3Aopen+is%3Apr+label%3Arelease) on
github.

Use `cargo semver-checks` to alert you of any problematic changes.
Replace the baseline-rev with a commit hash if your branch is not up-to-date with the main branch.

```bash
# Ensure you have cargo-semver-checks installed
cargo install cargo-semver-checks --locked
# Check for breaking changes against the main branch
cargo semver-checks --baseline-rev origin/main
```

These checks are also run on the CI. You will see a warning comment on your PR
if you introduce a breaking change.

## 💅 Coding Style

The rustfmt tool is used to enforce a consistent rust coding style. The CI will fail if the code is not formatted correctly.
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ gen-extensions:
cargo run -p hugr-cli gen-extensions -o specification/std_extensions
cp -r specification/std_extensions/* hugr-py/src/hugr/std/_json_defs/

# Build the python documentation in hugr-py/docs.
build-py-docs:
cd hugr-py/docs && ./build.sh

# Run rust semver-checks to detect breaking changes since the last release.
semver-checks:
cargo semver-checks

# Runs a rust and a python command, depending on the `language` variable.
#
# If `language` is set to `rust` or `python`, only run the command for that language.
Expand Down
3 changes: 2 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"initial-version": "0.0.0",
"extra-label": "release",
"packages": {
"hugr-py": {
"release-type": "python",
Expand Down Expand Up @@ -62,4 +63,4 @@
"hidden": true
}
]
}
}
1 change: 1 addition & 0 deletions release-plz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pr_draft = true
# (This would normally only be enabled once there are multiple packages in the workspace)
git_tag_name = "{{ package }}-v{{ version }}"
git_release_name = "{{ package }}: v{{ version }}"
pr_labels = ["release"]

# Only create releases / push to crates.io after merging a release-please PR.
# This lets merge new crates to `main` without worrying about accidentally creating
Expand Down