Skip to content

chore: release 0.4.0 — hooks 2.x, repository move, C++ test gate fix - #11

Merged
jwinarske merged 3 commits into
mainfrom
jw/pub-score
Aug 14, 2026
Merged

chore: release 0.4.0 — hooks 2.x, repository move, C++ test gate fix#11
jwinarske merged 3 commits into
mainfrom
jw/pub-score

Conversation

@jwinarske

@jwinarske jwinarske commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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 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.

Dependencies

Bumps 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, 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.dart needed no edits. Both packages still require only sdk >=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 repository and issue_tracker at github.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 to main. The currently published 0.3.0 still advertises meta-flutter/appstream on pub.dev; publishing 0.4.0 corrects it.

Bug fix: the C++ suite was never being built locally

scripts/test.sh passed -DBUILD_TESTING=ON, but the gate has been -DAPPSTREAM_BUILD_TESTS=ON since 0.2.2. CMake was warning Manually-specified variables were not used by the project: BUILD_TESTING and the cache confirmed APPSTREAM_BUILD_TESTS:BOOL=OFF.

The consequence: the C++ suite was never configured or rebuilt, and ctest silently 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.yml already 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-*, or performance-* findings — nothing security- or performance-relevant. 13 readability fixes applied in AppStreamParser and XmlScanner, all semantics-preserving:

  • explicit parentheses in mixed */+ accumulator arithmetic
  • contains() in place of a find() != npos membership test
  • consistent braces across the provides if/else chain

clang-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 analyze clean
  • dart format clean (0 of 23 files changed)
  • clang-tidy clean, clang-format applied last
  • 149/149 C++ tests pass
  • 45/45 Dart tests pass
  • dart pub publish --dry-run reports 0 warnings
  • pana 150/160; the final 10 points unlock when this merges to main

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.
@jwinarske jwinarske changed the title chore: bump hooks to 2.x, move repository, fix C++ test gate chore: release 0.4.0 — hooks 2.x, repository move, C++ test gate fix Aug 14, 2026
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.
@jwinarske
jwinarske merged commit e77b8e7 into main Aug 14, 2026
12 checks passed
@jwinarske
jwinarske deleted the jw/pub-score branch August 14, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant