chore: release 0.4.0 — hooks 2.x, repository move, C++ test gate fix - #11
Merged
Conversation
Raise the pub score from 140/160 to 150/160 and clear the remaining publishing gaps. - Bump `hooks` ^1.0.2 -> ^2.1.0 and `code_assets` ^1.0.0 -> ^1.2.1. The 1.x bound was pinning code_assets to 1.0.0 and holding native_toolchain_c and record_use at 1.x-era versions. The build hook API is unchanged across the major bump, so hook/build.dart needed no edits; both packages still require only sdk >=3.10.0, so the declared environment constraint is unaffected. - Point `repository` and `issue_tracker` at github.com/flatpak-minimal/appstream_dart. pana verifies the URL by cloning it and comparing the pubspec on the default branch, so this clears its check only once pushed there. - Fix scripts/test.sh passing -DBUILD_TESTING=ON, a flag the build ignores; the gate has been -DAPPSTREAM_BUILD_TESTS=ON since 0.2.2. The C++ suite was never configured or rebuilt, so ctest ran a stale binary that still linked against a removed gtest 1.15.2 and reported 149 spurious failures. With the correct flag the suite builds against system gtest 1.17.0 and passes 149/149. - Apply clang-tidy fixes in AppStreamParser and XmlScanner: explicit parentheses in mixed */+ accumulator arithmetic, contains() in place of a find() != npos membership test, and consistent braces across the provides if/else chain. All are semantics-preserving; clang-tidy now reports no warnings across src/. Verified: dart analyze clean, dart format clean, clang-tidy clean, clang-format applied last, 149/149 C++ tests and 45/45 Dart tests pass.
0.3.0 is already published on pub.dev and its versions are immutable, so this work ships as a new release rather than a re-publish. 0.4.0 rather than 0.3.1: raising `hooks` to ^2.1.0 is resolution-breaking for any consumer pinned to 1.x, and in 0.x semver a breaking change bumps the minor. The public Dart API is unchanged. Move the entries added for this work into a 0.4.0 section and restore the 0.3.0 section to what was actually published.
Both CI format jobs failed on toolchain version drift, not on logic.
clang-format: CI installs Ubuntu's clang-format 18, but the local run used
clang-format 22, which rewrites `struct stat sb {}` to `sb{}`. Version 22
then reports that same line as a violation under --dry-run --Werror, so it
cannot be satisfied by its own -i output. Version 18 accepts only the
original spacing, which is what CI enforces and what was green on main, so
line 79 is restored. The clang-tidy brace changes elsewhere in the file are
accepted by both versions.
dart format: CI's setup-dart resolves to Dart 3.13.0 while the local SDK is
3.12.2, and 3.13 collapses the `test(...)` call in
appstream_parse_fallback_test.dart differently. Formatted with 3.13 to match
the gate. Note that 3.12.2 disagrees and will want to revert this, so local
formatting needs a 3.13 SDK until CI pins a version.
Verified against CI's exact toolchain (clang-format 18.1.8, Dart 3.13.0):
both format gates clean, dart analyze --fatal-infos clean, 149/149 C++ and
45/45 Dart tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raises the pub.dev score from 140/160 to 160/160 and ships the result as 0.4.0.
0.3.0 is already published on pub.dev and pub versions are immutable, so this cannot be a re-publish. It is 0.4.0 rather than 0.3.1 because raising
hooksto ^2.1.0 is resolution-breaking for any consumer pinned to 1.x, and in 0.x semver a breaking change bumps the minor. The public Dart API is unchanged.Dependencies
Bumps
hooks^1.0.2 → ^2.1.0 andcode_assets^1.0.0 → ^1.2.1. The 1.x bound was pinningcode_assetsto 1.0.0 and holdingnative_toolchain_candrecord_useat 1.x-era versions, costing 10 points on pana's "dependencies supported in the latest version" check.The build hook API is unchanged across the major bump, so
hook/build.dartneeded no edits. Both packages still require onlysdk >=3.10.0, so the declared environment constraint is unaffected, and pana's lower-bound (pub downgrade) check still passes 20/20.Repository move
Points
repositoryandissue_trackeratgithub.com/flatpak-minimal/appstream_dart. pana verifies this by cloning the URL and comparing the pubspec on the default branch, so the last 10 points only land once this merges tomain. The currently published 0.3.0 still advertisesmeta-flutter/appstreamon pub.dev; publishing 0.4.0 corrects it.Bug fix: the C++ suite was never being built locally
scripts/test.shpassed-DBUILD_TESTING=ON, but the gate has been-DAPPSTREAM_BUILD_TESTS=ONsince 0.2.2. CMake was warningManually-specified variables were not used by the project: BUILD_TESTINGand the cache confirmedAPPSTREAM_BUILD_TESTS:BOOL=OFF.The consequence: the C++ suite was never configured or rebuilt, and
ctestsilently ran whatever stale binary was left in the build directory. Locally that binary still linked against a since-removed gtest 1.15.2, producing 149 spurious failures. With the correct flag the suite builds against system gtest 1.17.0 and passes 149/149..github/workflows/ci.ymlalready passes the correct flag (line 114), so CI was unaffected — this was a local-runner-only bug.clang-tidy cleanups
No
bugprone-*,cert-*,clang-analyzer-*, orperformance-*findings — nothing security- or performance-relevant. 13 readability fixes applied inAppStreamParserandXmlScanner, all semantics-preserving:*/+accumulator arithmeticcontains()in place of afind() != nposmembership testprovidesif/else chainclang-tidy now reports zero warnings across
src/. clang-format was run last, after clang-tidy, and repaired the misindented closing brace the brace fix left behind.Verification
dart analyzecleandart formatclean (0 of 23 files changed)dart pub publish --dry-runreports 0 warningsmain