From 9bfab318394814d2515f3959f744d60a12d415f1 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 13:38:11 -0700 Subject: [PATCH 1/7] add a change log - updates CI triggers - adds a workflow to bump version numbers and create a GitHub release The new changelog is hosted in docs, but it is not updated until bumping version numbers (and creating a release). The intention is to keep merge conflicts minimal among simultaneous PRs. --- .github/stale.yml | 1 - .github/workflows/binary-builds.yml | 15 ++- .github/workflows/build-docs.yml | 17 ++- .github/workflows/bump-n-release.yml | 62 +++++++++++ .github/workflows/bump_version.py | 92 +++++++++++++-- .github/workflows/node-js-packaging.yml | 33 ++++-- .github/workflows/python-packaging.yml | 23 +++- .github/workflows/run-dev-tests.yml | 15 +-- .github/workflows/stale.yml | 10 ++ CHANGELOG.md | 119 ++++++++++++++++++++ cliff.toml | 142 ++++++++++++++++++++++++ cspell.config.yml | 7 ++ docs/src/CHANGELOG.md | 3 + docs/src/SUMMARY.md | 1 + docs/theme/pagetoc.js | 10 +- 15 files changed, 511 insertions(+), 39 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/bump-n-release.yml create mode 100644 .github/workflows/stale.yml create mode 100644 CHANGELOG.md create mode 100644 cliff.toml create mode 100644 docs/src/CHANGELOG.md diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 0d0b1c9..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1 +0,0 @@ -_extends: .github diff --git a/.github/workflows/binary-builds.yml b/.github/workflows/binary-builds.yml index 6076ae4..40c4673 100644 --- a/.github/workflows/binary-builds.yml +++ b/.github/workflows/binary-builds.yml @@ -6,10 +6,16 @@ permissions: on: push: branches: [main] + paths: + - cpp-linter/** + - Cargo.{toml,lock} tags: - - v[0-9]+.* + - v* pull_request: branches: [main] + paths: + - cpp-linter/** + - Cargo.{toml,lock} env: CARGO_TERM_COLOR: always @@ -124,7 +130,7 @@ jobs: path: cpp-linter-${{ matrix.target }}* if-no-files-found: error - create-release: + publish: if: startswith(github.ref, 'refs/tags') runs-on: ubuntu-latest needs: [create-assets] @@ -136,6 +142,9 @@ jobs: persist-credentials: false - name: Install Rust run: rustup update stable --no-self-update + - uses: actions/setup-python@v5 + with: + python-version: 3.x - name: Download built assets uses: actions/download-artifact@v4 with: @@ -147,7 +156,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | files=$(ls dist/cpp-linter*) - gh release create ${{ github.ref_name }} ${{ contains(github.ref_name, 'rc') && '--prerelease' || '' }} --generate-notes $files + gh release upload ${{ github.ref_name }} $files - run: cargo publish -p cpp-linter env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 010d0b4..98b34f4 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -1,6 +1,21 @@ name: Docs -on: [push, workflow_dispatch] +on: + push: + branches: [main] + paths: + - docs/** + - .github/workflows/build-docs.yml + - cpp-linter**.rs + - '**.md' + pull_request: + branches: [main] + paths: + - docs/** + - .github/workflows/build-docs.yml + - cpp-linter**.rs + - '**.md' + workflow_dispatch: env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/bump-n-release.yml b/.github/workflows/bump-n-release.yml new file mode 100644 index 0000000..17b3cf8 --- /dev/null +++ b/.github/workflows/bump-n-release.yml @@ -0,0 +1,62 @@ +name: Bump-n-Release + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + workflow_dispatch: + inputs: + component: + type: choice + required: true + default: patch + options: + - major + - minor + - patch + - rc + +jobs: + bump-release: + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.BUMP_N_RELEASE }} + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - uses: cargo-bins/cargo-binstall@main + - run: cargo binstall -y git-cliff + - name: Bump ${{ inputs.component }} verion + env: + GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }} + GH_TOKEN: ${{ secrets.BUMP_N_RELEASE }} + run: python .github/workflows/bump_version.py ${{ inputs.component }} + id: tagged + + update-changelog: + if: github.event_name != 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.BUMP_N_RELEASE }} + fetch-depth: 0 + - name: Generate a changelog + uses: orhun/git-cliff-action@v4 + id: git-cliff + with: + config: cliff.toml + args: --unreleased + env: + OUTPUT: ${{ runner.temp }}/changes.md + GITHUB_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }} + - run: cat ${{ runner.temp }}/changes.md >> $GITHUB_STEP_SUMMARY + # NOTE: The change log is updated upon release in `bump-release` job above diff --git a/.github/workflows/bump_version.py b/.github/workflows/bump_version.py index a80b192..0a896cd 100644 --- a/.github/workflows/bump_version.py +++ b/.github/workflows/bump_version.py @@ -1,3 +1,38 @@ +"""This script automated the release process for all of the packages in this repository. +In order, this script does the following: + +1. Bump version number in manifest files according to given required arg (see `--help`). + This alters the Cargo.toml in repo root and the package.json files in node-binding. + + Requires `yarn` (see https://yarnpkg.com) and `napi` (see https://napi.rs) installed + to bump node-binding versions. + +2. Updates the CHANGELOG.md + + Requires `git-cliff` installed (see https://git-cliff.org) + to regenerate the change logs from git history. + + NOTE: `git cliff` uses GITHUB_TOKEN env var to access GitHub's REST API for + fetching certain data (like PR labels and commit author's username). + +3. Pushes the changes from above 2 steps to remote + +4. Creates a GitHub Release and uses the section from the CHANGELOG about the new tag + as a release description. + + Requires `gh-cli` installed (see https://cli.github.com) to create the release and + push the tag. + + NOTE: This step also tags the commit from step 3. + When a tag is pushed to the remote, the CI builds are triggered and + + - release assets are uploaded to the Github Release corresponding to the new tag + - packages are published for npm, pip and cargo + + NOTE: In a CI run, the GH_TOKEN env var to authenticate access. + Locally, you can use `gh login` to interactively authenticate the user account. +""" + import argparse from pathlib import Path import subprocess @@ -8,6 +43,7 @@ ) VER_REPLACE = 'version = "%d.%d.%d%s" # auto' COMPONENTS = ("major", "minor", "patch", "rc") +VERSION_LOG = re.compile(rb"^## \[\d+\.\d+\.\d+(?:\-rc)?\d*\]") class Updater: @@ -40,10 +76,34 @@ def replace(match: re.Match[str]) -> str: return VER_REPLACE % (tuple(ver[:3]) + (rc_str,)) +def get_release_notes(tag: str = Updater.new_version): + title, buf = ("", b"") + log_file = Path(__file__).parent.parent.parent / "CHANGELOG.md" + tag_buf = f"[{tag}]".encode(encoding="utf-8") + with open(str(log_file), "rb") as log: + found_notes = False + for line in log.readlines(): + matched = VERSION_LOG.match(line) + if matched is not None: + if tag_buf in matched.group(0): + title = tag + line[matched.end() :].decode(encoding="utf-8") + found_notes = True + else: + found_notes = False + elif line.startswith(b"[unreleased]: ") and found_notes: + found_notes = False + elif found_notes: + buf += line + elif line.startswith(tag_buf + b": "): + buf += line.replace(tag_buf, b"Full commit diff", 1) + return title.rstrip(), buf.strip() + + def main(): parser = argparse.ArgumentParser() parser.add_argument("component", default="patch", choices=COMPONENTS) parser.parse_args(namespace=Updater) + cargo_path = Path("Cargo.toml") doc = cargo_path.read_text(encoding="utf-8") doc = VER_PATTERN.sub(Updater.replace, doc) @@ -63,20 +123,34 @@ def main(): ) subprocess.run(["napi", "version"], cwd="node-binding", check=True) print("Updated version in node-binding/**package.json") - tag = "v" + Updater.new_version + + subprocess.run(["git", "cliff", "--tag", Updater.new_version], check=True) + print("Updated CHANGELOG.md") + subprocess.run(["git", "add", "--all"], check=True) - subprocess.run(["git", "commit", "-m", f"bump version to {tag}"], check=True) + tag = "v" + Updater.new_version + subprocess.run(["git", "commit", "-m", f"Bump version to {tag}"], check=True) try: subprocess.run(["git", "push"], check=True) except subprocess.CalledProcessError as exc: raise RuntimeError("Failed to push commit for version bump") from exc - print("Pushed commit to 'bump version to", tag, "'") - try: - subprocess.run(["git", "tag", tag], check=True) - except subprocess.CalledProcessError as exc: - raise RuntimeError("Failed to create tag for commit") from exc - print("Created tag", tag) - print(f"Use 'git push origin refs/tags/{tag}' to publish a release") + + title, notes = get_release_notes() + print("Pushed commit to 'Bump version to", tag, "'") + gh_cmd = [ + "gh", + "release", + "create", + tag, + "--title", + title, + "--notes", + notes.decode("utf-8"), + ] + if Updater.component == "rc": + gh_cmd.append("--prerelease") + subprocess.run(gh_cmd, check=True) + print("Created tag", tag, "and corresponding GitHub Release") if __name__ == "__main__": diff --git a/.github/workflows/node-js-packaging.yml b/.github/workflows/node-js-packaging.yml index ef920d8..1d401e3 100644 --- a/.github/workflows/node-js-packaging.yml +++ b/.github/workflows/node-js-packaging.yml @@ -8,19 +8,26 @@ permissions: id-token: write on: push: - branches: - - main + branches: [main] + paths: + - cpp-linter/**.{rs,toml} + - node-binding/** + - Cargo.{toml,lock} + - '**package.json' + - yarn.lock + - .github/workflows/node-js-packaging.yml tags: - '*' - paths-ignore: - - '**/*.md' - - LICENSE - - '**/*.gitignore' - - .editorconfig - - docs/** pull_request: - branches: - - main + branches: [main] + paths: + - cpp-linter/**.{rs,toml} + - node-binding/** + - Cargo.{toml,lock} + - '**package.json' + - yarn.lock + - .github/workflows/node-js-packaging.yml + jobs: build: strategy: @@ -218,3 +225,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # - name: Upload release assets + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: + # files=$(ls ./npm/**cpp-linter.*.node) + # gh release upload ${{ github.ref_name }} $files diff --git a/.github/workflows/python-packaging.yml b/.github/workflows/python-packaging.yml index 320a41c..fed00c8 100644 --- a/.github/workflows/python-packaging.yml +++ b/.github/workflows/python-packaging.yml @@ -14,14 +14,21 @@ name: Python builds on: push: - branches: - - main + branches: [main] + paths: + - cpp-linter/**.{rs,toml} + - py-binding/** + - Cargo.{toml,lock} + - .github/workflows/python-packaging.yml tags: - '*' pull_request: - branches: - - main - workflow_dispatch: + branches: [main] + paths: + - cpp-linter/**.{rs,toml} + - py-binding/** + - Cargo.{toml,lock} + - .github/workflows/python-packaging.yml permissions: contents: read @@ -180,3 +187,9 @@ jobs: # This workflow is registered as a trusted publisher (for test-pypi and pypi). # A token should not be required (and actually is discouraged with trusted publishers). repository-url: ${{ contains(github.ref_name, 'rc') && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }} + # - name: Upload release assets + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: + # files=$(ls ./dist/cpp-linter*.{whl,atr.gz}) + # gh release upload ${{ github.ref_name }} $files diff --git a/.github/workflows/run-dev-tests.yml b/.github/workflows/run-dev-tests.yml index dbb794f..a9e3f8d 100644 --- a/.github/workflows/run-dev-tests.yml +++ b/.github/workflows/run-dev-tests.yml @@ -4,18 +4,15 @@ on: push: branches: [main] paths: - - "**.rs" - - "*.toml" - - "Cargo.lock" - - ".github/workflows/run-dev-tests.yml" + - cpp-linter**.{rs,toml} + - Cargo.{toml,lock}" + - .github/workflows/run-dev-tests.yml pull_request: - # types: opened branches: [main] paths: - - "**.rs" - - "*.toml" - - "Cargo.lock" - - ".github/workflows/run-dev-tests.yml" + - cpp-linter**.{rs,toml} + - Cargo.{toml,lock}" + - .github/workflows/run-dev-tests.yml env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..952263f --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,10 @@ +name: 'Close stale issues' +on: + schedule: + - cron: '30 1 * * *' +permissions: + issues: write + +jobs: + stale: + uses: cpp-linter/.github/.github/workflows/stale.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..13b1929 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,119 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [Unreleased] + +### 🛠️ Fixed + +- Fix typo in node-binding/README by @2bndy5 in [`7732676`](https://github.com/cpp-linter/cpp_linter_rs/commit/7732676e03941a37a4fb5b474d319c640689985a) + +### 📝 Documentation + +- Release trial follow up by @2bndy5 in [#41](https://github.com/cpp-linter/cpp_linter_rs/pull/41) + +### 🗨️ Changed + +- Gimme them badges by @2bndy5 in [`c0f1ea5`](https://github.com/cpp-linter/cpp_linter_rs/commit/c0f1ea516ee6efdf1137884cbc2e99e4ce1d4a11) + +## [2.0.0-rc4] - 2024-09-21 + +### 🛠️ Fixed + +- Fix metadata in platform-specific node pkgs by @2bndy5 in [`1dbb1de`](https://github.com/cpp-linter/cpp_linter_rs/commit/1dbb1de3abdb231646a33ac2721e6a8778ca4ece) + +### 🗨️ Changed + +- Bump version to v2.0.0-rc4 by @2bndy5 in [`3e98e20`](https://github.com/cpp-linter/cpp_linter_rs/commit/3e98e20d2405b909b038ff87911dc0d5457613cc) + +## [2.0.0-rc3] - 2024-09-21 + +### 🗨️ Changed + +- Bump version to v2.0.0-rc3 by @2bndy5 in [`070c5f7`](https://github.com/cpp-linter/cpp_linter_rs/commit/070c5f75f15d0190ee0204992165673c8f16c47d) +- [node] add life cycle script prepublishOnly by @2bndy5 in [`55650ea`](https://github.com/cpp-linter/cpp_linter_rs/commit/55650ea96aac628023acb120525d674bcf17a529) + +## [2.0.0-rc2] - 2024-09-21 + +### 🚀 Added + +- Add `napi version` cmd to `just bump` script by @2bndy5 in [`a6a8bf2`](https://github.com/cpp-linter/cpp_linter_rs/commit/a6a8bf2f8f02c8d1a7b4047dae7bb13b537c370a) +- Use napi-rs by @2bndy5 in [#39](https://github.com/cpp-linter/cpp_linter_rs/pull/39) + +### 📦 Dependency updates + +- Bump pypa/gh-action-pypi-publish in the actions group by @dependabot[bot] in [#40](https://github.com/cpp-linter/cpp_linter_rs/pull/40) + +### 🗨️ Changed + +- Bump version to v2.0.0-rc2 by @2bndy5 in [`ebcb6c4`](https://github.com/cpp-linter/cpp_linter_rs/commit/ebcb6c4941fbaa8147c768252d6d7d9adcfa3bb3) +- Some cleanup from release trials by @2bndy5 in [`25c3951`](https://github.com/cpp-linter/cpp_linter_rs/commit/25c3951b0ecef9e078ea71932c9401ad8abc2a28) +- Update READMEs by @2bndy5 in [`3e9c128`](https://github.com/cpp-linter/cpp_linter_rs/commit/3e9c12846c0eb96f8cdd68fc7435bd8965e7ce6a) + +## [2.0.0-rc1] - 2024-09-19 + +### 🚀 Added + +- Resort to paginated requests for changed files by @2bndy5 in [#37](https://github.com/cpp-linter/cpp_linter_rs/pull/37) +- Support glob patterns by @2bndy5 in [#25](https://github.com/cpp-linter/cpp_linter_rs/pull/25) +- Support file paths in CLI positional argument by @2bndy5 in [#16](https://github.com/cpp-linter/cpp_linter_rs/pull/16) +- Add more testing and various improvements by @2bndy5 in [#4](https://github.com/cpp-linter/cpp_linter_rs/pull/4) + +### 🛠️ Fixed + +- Fix metadata and switch to pypa-publish action by @2bndy5 in [`092e0c2`](https://github.com/cpp-linter/cpp_linter_rs/commit/092e0c20cf66747b59bab4bdf60be29f7f02dcc6) +- Fix release CI steps by @2bndy5 in [`23efee5`](https://github.com/cpp-linter/cpp_linter_rs/commit/23efee50413ae6b6d1b51d147dcdc832d213de94) +- Fix release CI by @2bndy5 in [`49b3487`](https://github.com/cpp-linter/cpp_linter_rs/commit/49b3487c6d0804c075c7e8863be921c8ba3fdaea) +- Fix CI workflows for publishing releases by @2bndy5 in [`4f9b912`](https://github.com/cpp-linter/cpp_linter_rs/commit/4f9b91234bf05fd14afc60d7c87768d7ca0d7bb0) +- Fix links to clang-analyzer diagnostic's help site by @2bndy5 in [#36](https://github.com/cpp-linter/cpp_linter_rs/pull/36) +- Fix dependabot config by @2bndy5 in [`3957be2`](https://github.com/cpp-linter/cpp_linter_rs/commit/3957be228662faa3ab0c7241a88ac3b9d3bd09f8) +- Fix typo in README by @2bndy5 in [`afa1312`](https://github.com/cpp-linter/cpp_linter_rs/commit/afa1312af05f3920e9750dd1371fcad09643bc3f) +- Fix GithubApiClient init for non-PR events by @2bndy5 in [`5b60ab8`](https://github.com/cpp-linter/cpp_linter_rs/commit/5b60ab8af020f81fc986cdf86568263b5e5f8e50) +- Fix CI docs workflow by @2bndy5 in [`ae33a6d`](https://github.com/cpp-linter/cpp_linter_rs/commit/ae33a6d81da82d8f6c1b2b438e748dd276e4f61f) +- Fix parsing of `--extra-arg` by @2bndy5 in [`03f3de5`](https://github.com/cpp-linter/cpp_linter_rs/commit/03f3de5232e29446d57de00d8ac6deb2fc17d9a5) + +### 📦 Dependency updates + +- Bump the cargo group across 1 directory with 6 updates by @dependabot[bot] in [#34](https://github.com/cpp-linter/cpp_linter_rs/pull/34) +- Bump tempfile from 3.9.0 to 3.12.0 in the cargo group by @dependabot[bot] in [#26](https://github.com/cpp-linter/cpp_linter_rs/pull/26) +- Bump serde from 1.0.208 to 1.0.209 in the cargo group by @dependabot[bot] in [#23](https://github.com/cpp-linter/cpp_linter_rs/pull/23) +- Bump serde_json from 1.0.125 to 1.0.127 in the cargo group by @dependabot[bot] in [#19](https://github.com/cpp-linter/cpp_linter_rs/pull/19) +- Bump the cargo group with 3 updates by @dependabot[bot] in [#15](https://github.com/cpp-linter/cpp_linter_rs/pull/15) +- Bump the cargo group with 5 updates by @dependabot[bot] in [#7](https://github.com/cpp-linter/cpp_linter_rs/pull/7) +- Bump openssl from 0.10.62 to 0.10.66 by @dependabot[bot] in [#6](https://github.com/cpp-linter/cpp_linter_rs/pull/6) + +### 🚦 Tests + +- PR review suggestions by @2bndy5 in [`bd049d0`](https://github.com/cpp-linter/cpp_linter_rs/commit/bd049d06c48b4dc40da958a478873ac30183ee46) +- Mock REST API calls in tests by @2bndy5 in [#21](https://github.com/cpp-linter/cpp_linter_rs/pull/21) +- Refactor line filters; minor metadata updates by @2bndy5 in [`19d5517`](https://github.com/cpp-linter/cpp_linter_rs/commit/19d5517dc1c95c8269c0beb583387df6197b1ec7) + +### 📝 Documentation + +- Begin documenting permissions by @2bndy5 in [#22](https://github.com/cpp-linter/cpp_linter_rs/pull/22) +- Switch to mdbook for docs by @2bndy5 in [#13](https://github.com/cpp-linter/cpp_linter_rs/pull/13) + +### 🗨️ Changed + +- Metadata changes by @2bndy5 in [`f4237ae`](https://github.com/cpp-linter/cpp_linter_rs/commit/f4237ae593e468eca0e63169c9360e97bd6e1f26) +- Refactor files by @2bndy5 in [#38](https://github.com/cpp-linter/cpp_linter_rs/pull/38) +- Prepare for v2.0.0-rc1 by @2bndy5 in [`9189e86`](https://github.com/cpp-linter/cpp_linter_rs/commit/9189e86da499606439f6b65b62df5603f57d9da7) +- Update README by @2bndy5 in [`215485c`](https://github.com/cpp-linter/cpp_linter_rs/commit/215485c3f5032b7253e2d13f6726e3bfe70a16d0) +- Use task runner `just` (or VSCode "tasks") by @2bndy5 in [#14](https://github.com/cpp-linter/cpp_linter_rs/pull/14) +- Rename test CI; add badges to README by @2bndy5 in [`b77058f`](https://github.com/cpp-linter/cpp_linter_rs/commit/b77058f166f1062abe8193ab6fc4bc671793a7c8) +- Some updates from py codebase by @2bndy5 in [#5](https://github.com/cpp-linter/cpp_linter_rs/pull/5) +- Update README.md by @2bndy5 in [`ff4a735`](https://github.com/cpp-linter/cpp_linter_rs/commit/ff4a735ec5a74cc9a2e835e58dc76696233ad688) +- Use separate crates for different entry points by @2bndy5 in [#2](https://github.com/cpp-linter/cpp_linter_rs/pull/2) +- Init commit by @2bndy5 in [`2e25fec`](https://github.com/cpp-linter/cpp_linter_rs/commit/2e25fec0a447df24d0bcc1b80f6624040bab755e) + +[unreleased]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc4...HEAD +[2.0.0-rc4]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc3...v2.0.0-rc4 +[2.0.0-rc3]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc2...v2.0.0-rc3 +[2.0.0-rc2]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc1...v2.0.0-rc2 +[2.0.0-rc1]: https://github.com/cpp-linter/cpp_linter_rs/compare/2e25fec0a447df24d0bcc1b80f6624040bab755e...v2.0.0-rc1 + + diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..3d4a40f --- /dev/null +++ b/cliff.toml @@ -0,0 +1,142 @@ +# git-cliff ~ configuration file +# https://git-cliff.org/docs/configuration + +[changelog] +# template for the changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +\n +""" +# template for the changelog body +# https://keats.github.io/tera/docs/#introduction +body = """ +{%- macro remote_url() -%} + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} +{%- endmacro -%} + +{% if version -%} + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + {%- if message %} + + > {{ message }} + {%- endif %} +{% else -%} + ## [Unreleased] +{% endif -%} + +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits %} + - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ + {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} + {% if commit.remote.pr_number %} in \ + [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) + {%- else %} in \ + [`{{ commit.id | truncate(length=7, end="") }}`]({{ self::remote_url() }}/commit/{{commit.id }}) + {%- endif -%} + {% endfor %} +{% endfor %} + +{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} + ## New Contributors +{%- endif -%} + +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} + * @{{ contributor.username }} made their first contribution + {%- if contributor.pr_number %} in \ + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ + {%- endif %} +{%- endfor %}\n +""" +# template for the changelog footer +footer = """ +{%- macro remote_url() -%} + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} +{%- endmacro -%} + +{% for release in releases -%} + {% if release.version -%} + {% if release.previous.version -%} + [{{ release.version | trim_start_matches(pat="v") }}]: \ + {{ self::remote_url() }}/compare/{{ release.previous.version }}...{{ release.version }} + {% endif -%} + {% else -%} + [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}...HEAD + {% endif -%} +{% endfor -%} +[2.0.0-rc1]: https://github.com/cpp-linter/cpp_linter_rs/compare/2e25fec0a447df24d0bcc1b80f6624040bab755e...v2.0.0-rc1 + + +""" +# remove the leading and trailing whitespace from the templates +trim = true +# The file path for output. This can be overridden with `--output` CLI arg +output = "CHANGELOG.md" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + # remove issue numbers from commits + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, +] +# regex for parsing and grouping commits +commit_parsers = [ + { field = "github.pr_labels", pattern = "breaking", group = " 💥 Breaking changes" }, + { field = "github.pr_labels", pattern = "breaking-change", group = " 💥 Breaking changes" }, + { field = "github.pr_labels", pattern = "feature", group = " 🚀 Added" }, + { field = "github.pr_labels", pattern = "enhancement", group = " 🚀 Added" }, + { field = "github.pr_labels", pattern = "deprecated", group = " 🚫 Deprecated" }, + { field = "github.pr_labels", pattern = "removed", group = " 🗑️ Removed" }, + { field = "github.pr_labels", pattern = "bug", group = " 🛠️ Fixed" }, + { field = "github.pr_labels", pattern = "security", group = " 🔐 Security" }, + { field = "github.pr_labels", pattern = "dependencies", group = " 📦 Dependency updates" }, + { field = "github.pr_labels", pattern = "test", group = "🚦 Tests"}, + { field = "github.pr_labels", pattern = "tests", group = "🚦 Tests"}, + { field = "github.pr_labels", pattern = "documentation", group = " 📝 Documentation" }, + { field = "github.pr_labels", pattern = "refactor", group = " 🗨️ Changed" }, + { field = "github.pr_labels", pattern = "skip-changelog", skip = true }, + { field = "github.pr_labels", pattern = "no-changelog", skip = true }, + { field = "github.pr_labels", pattern = "invalid", skip = true }, + # The order of parsers matters. Put rules for PR labels first to prioritize PR labels. + { message = "^[a|A]dd", group = " 🚀 Added" }, + { message = "^[s|S]upport", group = " 🚀 Added" }, + { message = "^.*: support", group = " 🚀 Added" }, + { message = "^.*: add", group = " 🚀 Added" }, + { message = "^.*: deprecated", group = " 🚫 Deprecated" }, + { message = "[d|D]eprecate", group = " 🚫 Deprecated" }, + { message = "[t|T]ests", group = "🚦 Tests"}, + { message = "[r|R]emove", group = " 🗑️ Removed" }, + { message = "^.*: remove", group = " 🗑️ Removed" }, + { message = "^.*: delete", group = " 🗑️ Removed" }, + { message = "^[t|T]est", group = " 🛠️ Fixed" }, + { message = "^[f|F]ix", group = " 🛠️ Fixed" }, + { message = "^.*: fix", group = " 🛠️ Fixed" }, + { message = "^.*: secure", group = " 🔐 Security" }, + { message = "[s|S]ecure", group = " 🔐 Security" }, + { message = "[s|S]ecurity", group = " 🔐 Security" }, + { message = "^.*: security", group = " 🔐 Security" }, + { message = "doc", group = " 📝 Documentation" }, + { message = "docs", group = " 📝 Documentation" }, + { message = "documentation", group = " 📝 Documentation" }, + { message = "[r|R]efactor", group = " 🗨️ Changed" }, + { field = "github.pr_labels", pattern = ".*", group = " 🗨️ Changed" }, + { message = "^.*", group = " 🗨️ Changed" }, +] +# filter out the commits that are not matched by commit parsers +filter_commits = true +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "newest" + +[remote.github] +owner = "cpp-linter" +repo = "cpp_linter_rs" diff --git a/cspell.config.yml b/cspell.config.yml index d24f7e6..d5a1fc0 100644 --- a/cspell.config.yml +++ b/cspell.config.yml @@ -2,6 +2,7 @@ version: "0.2" language: en words: - binstall + - bndy - Boolish - bugprone - chrono @@ -10,7 +11,10 @@ words: - cppcoreguidelines - cstdio - Doherty + - endfor - endgroup + - endmacro + - endwith - Falsey - gitmodules - iomanip @@ -22,16 +26,19 @@ words: - napi - nonminimal - peekable + - pkgs - posix - preprocess - pybind - pyfunction - pymodule + - pypa - pypi - pyproject - ratelimit - reqwest - revparse + - serde - tempdir - tempfile - vararg diff --git a/docs/src/CHANGELOG.md b/docs/src/CHANGELOG.md new file mode 100644 index 0000000..ce53563 --- /dev/null +++ b/docs/src/CHANGELOG.md @@ -0,0 +1,3 @@ + + +{{#include ../../CHANGELOG.md}} diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index b617df9..c240a27 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -8,3 +8,4 @@ - [Pull Request Review Caveats](./pr-review-caveats.md) - [Python Binding](./python.md) - [Node.js Binding](./node.md) +- [Change Log](./CHANGELOG.md) diff --git a/docs/theme/pagetoc.js b/docs/theme/pagetoc.js index d5fefc5..cb07378 100644 --- a/docs/theme/pagetoc.js +++ b/docs/theme/pagetoc.js @@ -65,8 +65,16 @@ const onLoad = () => { var headers = [...document.getElementsByClassName("header")]; headers.shift(); headers.forEach((header) => { + var text = header.textContent; + if (text === "") { + sibling = header.nextSibling + while (sibling != null) { + text += sibling.textContent; + sibling = sibling.nextSibling + } + } const link = Object.assign(document.createElement("a"), { - textContent: header.text, + textContent: text, href: header.href, className: `pagetoc-${header.parentElement.tagName}`, }); From 6d4e297c80ed2968a3842ac096a6cf5240e77b93 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 15:10:25 -0700 Subject: [PATCH 2/7] update docs/themepagetoc.js per advice from @coderabbitai --- docs/theme/pagetoc.js | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/theme/pagetoc.js b/docs/theme/pagetoc.js index cb07378..a9d7a91 100644 --- a/docs/theme/pagetoc.js +++ b/docs/theme/pagetoc.js @@ -59,20 +59,31 @@ const updateFunction = () => { if (activeLink) activeLink.classList.add("active"); } }; +function getHeaderText(header) { + let text = header.textContent; + if (text === "") { + let sibling = header.nextSibling; + let maxIterations = 100; + while (sibling != null && maxIterations > 0) { + text += sibling.textContent; + sibling = sibling.nextSibling; + maxIterations--; + } + if (maxIterations === 0) { + console.warn( + "Possible circular reference in DOM when extracting header text" + ); + } + } + return text; +} const onLoad = () => { const pagetoc = getPagetoc(); var headers = [...document.getElementsByClassName("header")]; headers.shift(); headers.forEach((header) => { - var text = header.textContent; - if (text === "") { - sibling = header.nextSibling - while (sibling != null) { - text += sibling.textContent; - sibling = sibling.nextSibling - } - } + const text = getHeaderText(header); const link = Object.assign(document.createElement("a"), { textContent: text, href: header.href, From 5d66632da94803a196ea53dc2d588330e552e198 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 15:11:45 -0700 Subject: [PATCH 3/7] update CI triggers per code review --- .github/workflows/binary-builds.yml | 12 ++++++++---- .github/workflows/build-docs.yml | 10 ++++++---- .github/workflows/node-js-packaging.yml | 16 ++++++++++------ .github/workflows/run-dev-tests.yml | 10 ++++++---- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.github/workflows/binary-builds.yml b/.github/workflows/binary-builds.yml index 40c4673..8310839 100644 --- a/.github/workflows/binary-builds.yml +++ b/.github/workflows/binary-builds.yml @@ -7,15 +7,19 @@ on: push: branches: [main] paths: - - cpp-linter/** - - Cargo.{toml,lock} + - cpp-linter/src/** + - cpp-linter/Cargo.toml + - Cargo.toml + - Cargo.lock tags: - v* pull_request: branches: [main] paths: - - cpp-linter/** - - Cargo.{toml,lock} + - cpp-linter/src/** + - cpp-linter/Cargo.toml + - Cargo.toml + - Cargo.lock env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 98b34f4..75f7f0e 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -6,15 +6,17 @@ on: paths: - docs/** - .github/workflows/build-docs.yml - - cpp-linter**.rs - - '**.md' + - cpp-linter/src/** + - '*.md' + - '*/*.md' pull_request: branches: [main] paths: - docs/** - .github/workflows/build-docs.yml - - cpp-linter**.rs - - '**.md' + - cpp-linter/src/** + - '*.md' + - '*/*.md' workflow_dispatch: env: diff --git a/.github/workflows/node-js-packaging.yml b/.github/workflows/node-js-packaging.yml index 1d401e3..2530b23 100644 --- a/.github/workflows/node-js-packaging.yml +++ b/.github/workflows/node-js-packaging.yml @@ -10,10 +10,12 @@ on: push: branches: [main] paths: - - cpp-linter/**.{rs,toml} + - cpp-linter/src/** + - cpp-linter/Cargo.toml + - Cargo.toml + - Cargo.lock - node-binding/** - - Cargo.{toml,lock} - - '**package.json' + - package.json - yarn.lock - .github/workflows/node-js-packaging.yml tags: @@ -21,10 +23,12 @@ on: pull_request: branches: [main] paths: - - cpp-linter/**.{rs,toml} + - cpp-linter/src/** + - cpp-linter/Cargo.toml + - Cargo.toml + - Cargo.lock - node-binding/** - - Cargo.{toml,lock} - - '**package.json' + - package.json - yarn.lock - .github/workflows/node-js-packaging.yml diff --git a/.github/workflows/run-dev-tests.yml b/.github/workflows/run-dev-tests.yml index a9e3f8d..9a0e5ca 100644 --- a/.github/workflows/run-dev-tests.yml +++ b/.github/workflows/run-dev-tests.yml @@ -4,14 +4,16 @@ on: push: branches: [main] paths: - - cpp-linter**.{rs,toml} - - Cargo.{toml,lock}" + - cpp-linter/** + - Cargo.toml + - Cargo.lock - .github/workflows/run-dev-tests.yml pull_request: branches: [main] paths: - - cpp-linter**.{rs,toml} - - Cargo.{toml,lock}" + - cpp-linter/** + - Cargo.toml + - Cargo.lock - .github/workflows/run-dev-tests.yml env: From 8d5d2ff2ec8aff72d1a272e03d546752404a7d50 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 15:14:20 -0700 Subject: [PATCH 4/7] quote bash parameters move comment note to top of file --- .github/workflows/binary-builds.yml | 2 +- .github/workflows/bump-n-release.yml | 5 +++-- .github/workflows/node-js-packaging.yml | 2 +- .github/workflows/python-packaging.yml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/binary-builds.yml b/.github/workflows/binary-builds.yml index 8310839..053c2c8 100644 --- a/.github/workflows/binary-builds.yml +++ b/.github/workflows/binary-builds.yml @@ -160,7 +160,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | files=$(ls dist/cpp-linter*) - gh release upload ${{ github.ref_name }} $files + gh release upload "${{ github.ref_name }}" $files - run: cargo publish -p cpp-linter env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/bump-n-release.yml b/.github/workflows/bump-n-release.yml index 17b3cf8..12c5fd0 100644 --- a/.github/workflows/bump-n-release.yml +++ b/.github/workflows/bump-n-release.yml @@ -1,5 +1,7 @@ name: Bump-n-Release +# NOTE: The change log is only updated in the remote upon release (in `bump-release` job) + on: push: branches: @@ -58,5 +60,4 @@ jobs: OUTPUT: ${{ runner.temp }}/changes.md GITHUB_REPO: ${{ github.repository }} GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }} - - run: cat ${{ runner.temp }}/changes.md >> $GITHUB_STEP_SUMMARY - # NOTE: The change log is updated upon release in `bump-release` job above + - run: cat "${{ runner.temp }}/changes.md" >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/node-js-packaging.yml b/.github/workflows/node-js-packaging.yml index 2530b23..349f5d3 100644 --- a/.github/workflows/node-js-packaging.yml +++ b/.github/workflows/node-js-packaging.yml @@ -234,4 +234,4 @@ jobs: # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # run: # files=$(ls ./npm/**cpp-linter.*.node) - # gh release upload ${{ github.ref_name }} $files + # gh release upload "${{ github.ref_name }}" $files diff --git a/.github/workflows/python-packaging.yml b/.github/workflows/python-packaging.yml index fed00c8..7a501d0 100644 --- a/.github/workflows/python-packaging.yml +++ b/.github/workflows/python-packaging.yml @@ -192,4 +192,4 @@ jobs: # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # run: # files=$(ls ./dist/cpp-linter*.{whl,atr.gz}) - # gh release upload ${{ github.ref_name }} $files + # gh release upload "${{ github.ref_name }}" $files From 665065c62cfb5660c9fab1dedf1868c5478cf408 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 15:16:14 -0700 Subject: [PATCH 5/7] change bump_version.py per advice from @coderabbitai --- .github/workflows/bump_version.py | 43 +++++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/bump_version.py b/.github/workflows/bump_version.py index 0a896cd..d6d98c1 100644 --- a/.github/workflows/bump_version.py +++ b/.github/workflows/bump_version.py @@ -1,15 +1,15 @@ -"""This script automated the release process for all of the packages in this repository. +"""This script automates the release process for all of the packages in this repository. In order, this script does the following: 1. Bump version number in manifest files according to given required arg (see `--help`). This alters the Cargo.toml in repo root and the package.json files in node-binding. - Requires `yarn` (see https://yarnpkg.com) and `napi` (see https://napi.rs) installed - to bump node-binding versions. + Requires `yarn` (see https://yarnpkg.com) and `napi` (see https://napi.rs) to be + installed to bump node-binding versions. 2. Updates the CHANGELOG.md - Requires `git-cliff` installed (see https://git-cliff.org) + Requires `git-cliff` (see https://git-cliff.org) to be installed to regenerate the change logs from git history. NOTE: `git cliff` uses GITHUB_TOKEN env var to access GitHub's REST API for @@ -20,14 +20,14 @@ 4. Creates a GitHub Release and uses the section from the CHANGELOG about the new tag as a release description. - Requires `gh-cli` installed (see https://cli.github.com) to create the release and - push the tag. + Requires `gh-cli` (see https://cli.github.com) to be installed to create the release + and push the tag. NOTE: This step also tags the commit from step 3. When a tag is pushed to the remote, the CI builds are triggered and - release assets are uploaded to the Github Release corresponding to the new tag - - packages are published for npm, pip and cargo + - packages are published for npm, pip, and cargo NOTE: In a CI run, the GH_TOKEN env var to authenticate access. Locally, you can use `gh login` to interactively authenticate the user account. @@ -43,7 +43,7 @@ ) VER_REPLACE = 'version = "%d.%d.%d%s" # auto' COMPONENTS = ("major", "minor", "patch", "rc") -VERSION_LOG = re.compile(rb"^## \[\d+\.\d+\.\d+(?:\-rc)?\d*\]") +VERSION_LOG = re.compile(r"^## \[\d+\.\d+\.\d+(?:\-rc)?\d*\]") class Updater: @@ -77,25 +77,25 @@ def replace(match: re.Match[str]) -> str: def get_release_notes(tag: str = Updater.new_version): - title, buf = ("", b"") + title, buf = "", "" log_file = Path(__file__).parent.parent.parent / "CHANGELOG.md" - tag_buf = f"[{tag}]".encode(encoding="utf-8") - with open(str(log_file), "rb") as log: + tag_pattern = f"[{tag}]" + with open(str(log_file), "r", encoding="utf-8") as logs: found_notes = False - for line in log.readlines(): + for line in logs: matched = VERSION_LOG.match(line) if matched is not None: - if tag_buf in matched.group(0): - title = tag + line[matched.end() :].decode(encoding="utf-8") + if tag_pattern in matched.group(0): + title = tag + line[matched.end() :] found_notes = True else: found_notes = False - elif line.startswith(b"[unreleased]: ") and found_notes: + elif line.startswith("[unreleased]: ") and found_notes: found_notes = False elif found_notes: buf += line - elif line.startswith(tag_buf + b": "): - buf += line.replace(tag_buf, b"Full commit diff", 1) + elif line.startswith(tag_pattern + ": "): + buf += line.replace(tag_pattern, "Full commit diff", 1) return title.rstrip(), buf.strip() @@ -133,8 +133,11 @@ def main(): try: subprocess.run(["git", "push"], check=True) except subprocess.CalledProcessError as exc: - raise RuntimeError("Failed to push commit for version bump") from exc - + raise RuntimeError( + """Failed to push commit for version bump. Please ensure that +- You have the necessary permissions and are authenticated properly. +- All other commits on the branch have ben pushed already.""" + ) from exc title, notes = get_release_notes() print("Pushed commit to 'Bump version to", tag, "'") gh_cmd = [ @@ -145,7 +148,7 @@ def main(): "--title", title, "--notes", - notes.decode("utf-8"), + notes, ] if Updater.component == "rc": gh_cmd.append("--prerelease") From ea7ed7d2b65d1a231a5da7c88ce3d2a2a1e65fa1 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 15:47:45 -0700 Subject: [PATCH 6/7] improve error message in bump_version.py --- .github/workflows/bump_version.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/bump_version.py b/.github/workflows/bump_version.py index d6d98c1..5d937d9 100644 --- a/.github/workflows/bump_version.py +++ b/.github/workflows/bump_version.py @@ -140,20 +140,14 @@ def main(): ) from exc title, notes = get_release_notes() print("Pushed commit to 'Bump version to", tag, "'") - gh_cmd = [ - "gh", - "release", - "create", - tag, - "--title", - title, - "--notes", - notes, - ] + gh_cmd = ["gh", "release", "create", tag, "--title", title, "--notes", notes] if Updater.component == "rc": gh_cmd.append("--prerelease") - subprocess.run(gh_cmd, check=True) - print("Created tag", tag, "and corresponding GitHub Release") + try: + subprocess.run(gh_cmd, check=True) + print("Created tag", tag, "and corresponding GitHub Release") + except subprocess.CalledProcessError as exc: + raise RuntimeError("Failed to create GitHub Release") from exc if __name__ == "__main__": From e426c55089e8a50799fce92aff68a3a15d085276 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 23 Sep 2024 17:59:39 -0700 Subject: [PATCH 7/7] apply other suggestions about git-cliff config --- CHANGELOG.md | 72 +++++++++++++++++++++++++++------------------------- cliff.toml | 9 +++---- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b1929..d5791bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### 🚀 Added + +- Add a change log in [`9bfab31`](https://github.com/cpp-linter/cpp_linter_rs/commit/9bfab318394814d2515f3959f744d60a12d415f1) + ### 🛠️ Fixed - Fix typo in node-binding/README by @2bndy5 in [`7732676`](https://github.com/cpp-linter/cpp_linter_rs/commit/7732676e03941a37a4fb5b474d319c640689985a) @@ -34,15 +38,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 🗨️ Changed -- Bump version to v2.0.0-rc3 by @2bndy5 in [`070c5f7`](https://github.com/cpp-linter/cpp_linter_rs/commit/070c5f75f15d0190ee0204992165673c8f16c47d) - [node] add life cycle script prepublishOnly by @2bndy5 in [`55650ea`](https://github.com/cpp-linter/cpp_linter_rs/commit/55650ea96aac628023acb120525d674bcf17a529) +- Bump version to v2.0.0-rc3 by @2bndy5 in [`070c5f7`](https://github.com/cpp-linter/cpp_linter_rs/commit/070c5f75f15d0190ee0204992165673c8f16c47d) ## [2.0.0-rc2] - 2024-09-21 ### 🚀 Added -- Add `napi version` cmd to `just bump` script by @2bndy5 in [`a6a8bf2`](https://github.com/cpp-linter/cpp_linter_rs/commit/a6a8bf2f8f02c8d1a7b4047dae7bb13b537c370a) - Use napi-rs by @2bndy5 in [#39](https://github.com/cpp-linter/cpp_linter_rs/pull/39) +- Add `napi version` cmd to `just bump` script by @2bndy5 in [`a6a8bf2`](https://github.com/cpp-linter/cpp_linter_rs/commit/a6a8bf2f8f02c8d1a7b4047dae7bb13b537c370a) ### 📦 Dependency updates @@ -50,65 +54,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 🗨️ Changed -- Bump version to v2.0.0-rc2 by @2bndy5 in [`ebcb6c4`](https://github.com/cpp-linter/cpp_linter_rs/commit/ebcb6c4941fbaa8147c768252d6d7d9adcfa3bb3) -- Some cleanup from release trials by @2bndy5 in [`25c3951`](https://github.com/cpp-linter/cpp_linter_rs/commit/25c3951b0ecef9e078ea71932c9401ad8abc2a28) - Update READMEs by @2bndy5 in [`3e9c128`](https://github.com/cpp-linter/cpp_linter_rs/commit/3e9c12846c0eb96f8cdd68fc7435bd8965e7ce6a) +- Some cleanup from release trials by @2bndy5 in [`25c3951`](https://github.com/cpp-linter/cpp_linter_rs/commit/25c3951b0ecef9e078ea71932c9401ad8abc2a28) +- Bump version to v2.0.0-rc2 by @2bndy5 in [`ebcb6c4`](https://github.com/cpp-linter/cpp_linter_rs/commit/ebcb6c4941fbaa8147c768252d6d7d9adcfa3bb3) ## [2.0.0-rc1] - 2024-09-19 ### 🚀 Added -- Resort to paginated requests for changed files by @2bndy5 in [#37](https://github.com/cpp-linter/cpp_linter_rs/pull/37) -- Support glob patterns by @2bndy5 in [#25](https://github.com/cpp-linter/cpp_linter_rs/pull/25) -- Support file paths in CLI positional argument by @2bndy5 in [#16](https://github.com/cpp-linter/cpp_linter_rs/pull/16) - Add more testing and various improvements by @2bndy5 in [#4](https://github.com/cpp-linter/cpp_linter_rs/pull/4) +- Support file paths in CLI positional argument by @2bndy5 in [#16](https://github.com/cpp-linter/cpp_linter_rs/pull/16) +- Support glob patterns by @2bndy5 in [#25](https://github.com/cpp-linter/cpp_linter_rs/pull/25) +- Resort to paginated requests for changed files by @2bndy5 in [#37](https://github.com/cpp-linter/cpp_linter_rs/pull/37) ### 🛠️ Fixed -- Fix metadata and switch to pypa-publish action by @2bndy5 in [`092e0c2`](https://github.com/cpp-linter/cpp_linter_rs/commit/092e0c20cf66747b59bab4bdf60be29f7f02dcc6) -- Fix release CI steps by @2bndy5 in [`23efee5`](https://github.com/cpp-linter/cpp_linter_rs/commit/23efee50413ae6b6d1b51d147dcdc832d213de94) -- Fix release CI by @2bndy5 in [`49b3487`](https://github.com/cpp-linter/cpp_linter_rs/commit/49b3487c6d0804c075c7e8863be921c8ba3fdaea) -- Fix CI workflows for publishing releases by @2bndy5 in [`4f9b912`](https://github.com/cpp-linter/cpp_linter_rs/commit/4f9b91234bf05fd14afc60d7c87768d7ca0d7bb0) -- Fix links to clang-analyzer diagnostic's help site by @2bndy5 in [#36](https://github.com/cpp-linter/cpp_linter_rs/pull/36) -- Fix dependabot config by @2bndy5 in [`3957be2`](https://github.com/cpp-linter/cpp_linter_rs/commit/3957be228662faa3ab0c7241a88ac3b9d3bd09f8) -- Fix typo in README by @2bndy5 in [`afa1312`](https://github.com/cpp-linter/cpp_linter_rs/commit/afa1312af05f3920e9750dd1371fcad09643bc3f) -- Fix GithubApiClient init for non-PR events by @2bndy5 in [`5b60ab8`](https://github.com/cpp-linter/cpp_linter_rs/commit/5b60ab8af020f81fc986cdf86568263b5e5f8e50) -- Fix CI docs workflow by @2bndy5 in [`ae33a6d`](https://github.com/cpp-linter/cpp_linter_rs/commit/ae33a6d81da82d8f6c1b2b438e748dd276e4f61f) - Fix parsing of `--extra-arg` by @2bndy5 in [`03f3de5`](https://github.com/cpp-linter/cpp_linter_rs/commit/03f3de5232e29446d57de00d8ac6deb2fc17d9a5) +- Fix CI docs workflow by @2bndy5 in [`ae33a6d`](https://github.com/cpp-linter/cpp_linter_rs/commit/ae33a6d81da82d8f6c1b2b438e748dd276e4f61f) +- Fix GithubApiClient init for non-PR events by @2bndy5 in [`5b60ab8`](https://github.com/cpp-linter/cpp_linter_rs/commit/5b60ab8af020f81fc986cdf86568263b5e5f8e50) +- Fix typo in README by @2bndy5 in [`afa1312`](https://github.com/cpp-linter/cpp_linter_rs/commit/afa1312af05f3920e9750dd1371fcad09643bc3f) +- Fix dependabot config by @2bndy5 in [`3957be2`](https://github.com/cpp-linter/cpp_linter_rs/commit/3957be228662faa3ab0c7241a88ac3b9d3bd09f8) +- Fix links to clang-analyzer diagnostic's help site by @2bndy5 in [#36](https://github.com/cpp-linter/cpp_linter_rs/pull/36) +- Fix CI workflows for publishing releases by @2bndy5 in [`4f9b912`](https://github.com/cpp-linter/cpp_linter_rs/commit/4f9b91234bf05fd14afc60d7c87768d7ca0d7bb0) +- Fix release CI by @2bndy5 in [`49b3487`](https://github.com/cpp-linter/cpp_linter_rs/commit/49b3487c6d0804c075c7e8863be921c8ba3fdaea) +- Fix release CI steps by @2bndy5 in [`23efee5`](https://github.com/cpp-linter/cpp_linter_rs/commit/23efee50413ae6b6d1b51d147dcdc832d213de94) +- Fix metadata and switch to pypa-publish action by @2bndy5 in [`092e0c2`](https://github.com/cpp-linter/cpp_linter_rs/commit/092e0c20cf66747b59bab4bdf60be29f7f02dcc6) ### 📦 Dependency updates -- Bump the cargo group across 1 directory with 6 updates by @dependabot[bot] in [#34](https://github.com/cpp-linter/cpp_linter_rs/pull/34) -- Bump tempfile from 3.9.0 to 3.12.0 in the cargo group by @dependabot[bot] in [#26](https://github.com/cpp-linter/cpp_linter_rs/pull/26) -- Bump serde from 1.0.208 to 1.0.209 in the cargo group by @dependabot[bot] in [#23](https://github.com/cpp-linter/cpp_linter_rs/pull/23) -- Bump serde_json from 1.0.125 to 1.0.127 in the cargo group by @dependabot[bot] in [#19](https://github.com/cpp-linter/cpp_linter_rs/pull/19) -- Bump the cargo group with 3 updates by @dependabot[bot] in [#15](https://github.com/cpp-linter/cpp_linter_rs/pull/15) -- Bump the cargo group with 5 updates by @dependabot[bot] in [#7](https://github.com/cpp-linter/cpp_linter_rs/pull/7) - Bump openssl from 0.10.62 to 0.10.66 by @dependabot[bot] in [#6](https://github.com/cpp-linter/cpp_linter_rs/pull/6) +- Bump the cargo group with 5 updates by @dependabot[bot] in [#7](https://github.com/cpp-linter/cpp_linter_rs/pull/7) +- Bump the cargo group with 3 updates by @dependabot[bot] in [#15](https://github.com/cpp-linter/cpp_linter_rs/pull/15) +- Bump serde_json from 1.0.125 to 1.0.127 in the cargo group by @dependabot[bot] in [#19](https://github.com/cpp-linter/cpp_linter_rs/pull/19) +- Bump serde from 1.0.208 to 1.0.209 in the cargo group by @dependabot[bot] in [#23](https://github.com/cpp-linter/cpp_linter_rs/pull/23) +- Bump tempfile from 3.9.0 to 3.12.0 in the cargo group by @dependabot[bot] in [#26](https://github.com/cpp-linter/cpp_linter_rs/pull/26) +- Bump the cargo group across 1 directory with 6 updates by @dependabot[bot] in [#34](https://github.com/cpp-linter/cpp_linter_rs/pull/34) ### 🚦 Tests -- PR review suggestions by @2bndy5 in [`bd049d0`](https://github.com/cpp-linter/cpp_linter_rs/commit/bd049d06c48b4dc40da958a478873ac30183ee46) -- Mock REST API calls in tests by @2bndy5 in [#21](https://github.com/cpp-linter/cpp_linter_rs/pull/21) - Refactor line filters; minor metadata updates by @2bndy5 in [`19d5517`](https://github.com/cpp-linter/cpp_linter_rs/commit/19d5517dc1c95c8269c0beb583387df6197b1ec7) +- Mock REST API calls in tests by @2bndy5 in [#21](https://github.com/cpp-linter/cpp_linter_rs/pull/21) +- PR review suggestions by @2bndy5 in [`bd049d0`](https://github.com/cpp-linter/cpp_linter_rs/commit/bd049d06c48b4dc40da958a478873ac30183ee46) ### 📝 Documentation -- Begin documenting permissions by @2bndy5 in [#22](https://github.com/cpp-linter/cpp_linter_rs/pull/22) - Switch to mdbook for docs by @2bndy5 in [#13](https://github.com/cpp-linter/cpp_linter_rs/pull/13) +- Begin documenting permissions by @2bndy5 in [#22](https://github.com/cpp-linter/cpp_linter_rs/pull/22) ### 🗨️ Changed -- Metadata changes by @2bndy5 in [`f4237ae`](https://github.com/cpp-linter/cpp_linter_rs/commit/f4237ae593e468eca0e63169c9360e97bd6e1f26) -- Refactor files by @2bndy5 in [#38](https://github.com/cpp-linter/cpp_linter_rs/pull/38) -- Prepare for v2.0.0-rc1 by @2bndy5 in [`9189e86`](https://github.com/cpp-linter/cpp_linter_rs/commit/9189e86da499606439f6b65b62df5603f57d9da7) -- Update README by @2bndy5 in [`215485c`](https://github.com/cpp-linter/cpp_linter_rs/commit/215485c3f5032b7253e2d13f6726e3bfe70a16d0) -- Use task runner `just` (or VSCode "tasks") by @2bndy5 in [#14](https://github.com/cpp-linter/cpp_linter_rs/pull/14) -- Rename test CI; add badges to README by @2bndy5 in [`b77058f`](https://github.com/cpp-linter/cpp_linter_rs/commit/b77058f166f1062abe8193ab6fc4bc671793a7c8) -- Some updates from py codebase by @2bndy5 in [#5](https://github.com/cpp-linter/cpp_linter_rs/pull/5) -- Update README.md by @2bndy5 in [`ff4a735`](https://github.com/cpp-linter/cpp_linter_rs/commit/ff4a735ec5a74cc9a2e835e58dc76696233ad688) -- Use separate crates for different entry points by @2bndy5 in [#2](https://github.com/cpp-linter/cpp_linter_rs/pull/2) - Init commit by @2bndy5 in [`2e25fec`](https://github.com/cpp-linter/cpp_linter_rs/commit/2e25fec0a447df24d0bcc1b80f6624040bab755e) +- Use separate crates for different entry points by @2bndy5 in [#2](https://github.com/cpp-linter/cpp_linter_rs/pull/2) +- Update README.md by @2bndy5 in [`ff4a735`](https://github.com/cpp-linter/cpp_linter_rs/commit/ff4a735ec5a74cc9a2e835e58dc76696233ad688) +- Some updates from py codebase by @2bndy5 in [#5](https://github.com/cpp-linter/cpp_linter_rs/pull/5) +- Rename test CI; add badges to README by @2bndy5 in [`b77058f`](https://github.com/cpp-linter/cpp_linter_rs/commit/b77058f166f1062abe8193ab6fc4bc671793a7c8) +- Use task runner `just` (or VSCode "tasks") by @2bndy5 in [#14](https://github.com/cpp-linter/cpp_linter_rs/pull/14) +- Update README by @2bndy5 in [`215485c`](https://github.com/cpp-linter/cpp_linter_rs/commit/215485c3f5032b7253e2d13f6726e3bfe70a16d0) +- Prepare for v2.0.0-rc1 by @2bndy5 in [`9189e86`](https://github.com/cpp-linter/cpp_linter_rs/commit/9189e86da499606439f6b65b62df5603f57d9da7) +- Refactor files by @2bndy5 in [#38](https://github.com/cpp-linter/cpp_linter_rs/pull/38) +- Metadata changes by @2bndy5 in [`f4237ae`](https://github.com/cpp-linter/cpp_linter_rs/commit/f4237ae593e468eca0e63169c9360e97bd6e1f26) [unreleased]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc4...HEAD [2.0.0-rc4]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc3...v2.0.0-rc4 diff --git a/cliff.toml b/cliff.toml index 3d4a40f..85eb084 100644 --- a/cliff.toml +++ b/cliff.toml @@ -116,7 +116,6 @@ commit_parsers = [ { message = "[r|R]emove", group = " 🗑️ Removed" }, { message = "^.*: remove", group = " 🗑️ Removed" }, { message = "^.*: delete", group = " 🗑️ Removed" }, - { message = "^[t|T]est", group = " 🛠️ Fixed" }, { message = "^[f|F]ix", group = " 🛠️ Fixed" }, { message = "^.*: fix", group = " 🛠️ Fixed" }, { message = "^.*: secure", group = " 🔐 Security" }, @@ -135,8 +134,8 @@ filter_commits = true # sort the tags topologically topo_order = false # sort the commits inside sections by oldest/newest order -sort_commits = "newest" +sort_commits = "oldest" -[remote.github] -owner = "cpp-linter" -repo = "cpp_linter_rs" +# [remote.github] +# owner = "cpp-linter" +# repo = "cpp_linter_rs"