Skip to content

fix(script): keep llvm-cov/profdata/symbolizer/scan-deps in generated formulae#8

Merged
shenxianpeng merged 2 commits into
mainfrom
claude/cpp-linter-org-gaps-z9fuep
Jul 4, 2026
Merged

fix(script): keep llvm-cov/profdata/symbolizer/scan-deps in generated formulae#8
shenxianpeng merged 2 commits into
mainfrom
claude/cpp-linter-org-gaps-z9fuep

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

Problem

scripts/update-formula.py only knew about five tools — clang-format, clang-tidy, clang-query, clang-apply-replacements, and clang-include-cleaner. The llvm-cov, llvm-profdata, llvm-symbolizer, and clang-scan-deps tools were added to the Formula/*.rb files by hand and were never taught to the generator.

As a result, every automated regeneration drops those four tools from the bundle formulae — exactly what the automated PR #7 did (+10 / -230, stripping all four tools from clang-tools.rb and clang-tools@{18,19,20,21}.rb). PR #7 is destructive and is being closed in favor of this fix; main already carries the correct release with all nine tools.

Fix

Teach the generator about the four extra tools so a regeneration reproduces the current hand-maintained formulae exactly instead of deleting tools:

  • Add a TOOLS_EXTRA = ["llvm-cov", "llvm-profdata", "llvm-symbolizer", "clang-scan-deps"] list, fetched into the checksum map for every version.
  • Emit them as bundle resource blocks (ARM + Intel), in the same order as the existing files, via a shared bundle_resource_tools() helper.
  • Include them in the bundle's desc, the %w[...] install list, and the test do smoke checks.
  • Add INDIVIDUAL_TOOLS entries (LlvmCov, LlvmProfdata, LlvmSymbolizer, ClangScanDeps) so their individual Formula/*.rb are regenerated and kept in sync too (previously they would silently go stale after an update).

The ARM/Intel bodies were also de-duplicated into a single loop since they only differ by platform.

README

Aligns the tap with the other cpp-linter repos: adds the shared cpp-linter hub badge plus Test Formulae / Update Formula CI badges in a centered header. Tool content is unchanged.

Verification

  • Regenerating against the current release (2026.07.02-e6fa8f6a) should produce no diff against main (the script now matches the hand-maintained files). The Test Formulae CI installs and brew tests the bundle plus all four extra tools on Intel + Apple Silicon.

Notes / follow-up

This repo has no LICENSE (sibling repos do — e.g. asdf, docker). I left it out of this PR since the license choice is yours to make; happy to add one in a follow-up once you confirm which (the org profile uses MIT).


Generated by Claude Code

… formulae

The update-formula generator only knew about clang-format, clang-tidy,
clang-query, clang-apply-replacements and clang-include-cleaner. The
llvm-cov, llvm-profdata, llvm-symbolizer and clang-scan-deps tools were
added to the formulae by hand, so every automated regeneration dropped
them again from the bundle formulae (see the auto-update PR that removed
230 lines).

Teach the generator about all four extra tools so they are emitted as
bundle resources (arm + intel), included in the install list, the `desc`
and the test block, and generated as individual formulae — matching the
current hand-maintained Formula/*.rb exactly. Regenerating now reproduces
main instead of deleting tools.

Also align the README with the other cpp-linter repos: add the shared
"cpp-linter hub" badge plus Test Formulae / Update Formula CI badges in a
centered header.
…rsion

Collapse TOOLS_ALL / TOOLS_IC / TOOLS_EXTRA and the parallel
INDIVIDUAL_TOOLS dict into one ordered TOOLS list. Version availability
(clang-include-cleaner is LLVM 18+) is now a per-tool `min_version`
attribute instead of a separate list, and the individual-formula class
names are derived from the tool name (Homebrew's own convention) rather
than duplicated.

Behaviour is unchanged: the smoke-test set is now defined as "tools with
no min_version" (always present on every version), which reproduces the
existing test blocks, and generating against the current release still
yields no diff against the hand-maintained Formula/*.rb.
@shenxianpeng shenxianpeng merged commit c5a236d into main Jul 4, 2026
@shenxianpeng shenxianpeng deleted the claude/cpp-linter-org-gaps-z9fuep branch July 4, 2026 09:24
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