Expand existing tool format detection - #154
Conversation
There was a problem hiding this comment.
Pull request overview
Expands Brief’s knowledge-base detection to recognize additional “marker” files for existing tools (and resolve Bazel/Pants ambiguity), while updating the generated README tools introduction to avoid stale numeric totals.
Changes:
- Added new detection markers for Gradle, NuGet, Helm, Yarn, pnpm, Ansible Galaxy, and Bazel (including
exclude_filessupport and Pants marker tightening). - Updated detection engine and KB schema to support
exclude_files, plus added regression tests for newly supported markers and the Bazel/Pants collision. - Refactored README tools-block generation to output a count-free introduction and added a unit test for it.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates generated tools intro line to a count-free sentence. |
| knowledge/python/pants.toml | Makes pants.toml the sole Pants detection marker (drops BUILD). |
| knowledge/node/yarn.toml | Adds .pnp.cjs as a Yarn detection marker. |
| knowledge/node/pnpm.toml | Adds shrinkwrap.yaml as a legacy pnpm lockfile marker. |
| knowledge/java/gradle.toml | Adds gradle/libs.versions.toml version-catalog marker. |
| knowledge/csharp/nuget.toml | Adds central package management markers (Directory.*.props). |
| knowledge/_shared/helm.toml | Adds Chart.lock + legacy requirements markers. |
| knowledge/_shared/bazel.toml | Adds plain BUILD and introduces exclude_files to avoid Pants collision. |
| knowledge/_shared/ansible.toml | Adds Ansible Galaxy requirements + metadata markers. |
| kb/kb.go | Adds exclude_files field to KB detection schema. |
| detect/detect.go | Implements exclude_files handling in tool matching. |
| detect/detect_test.go | Adds focused regression tests for new markers + Bazel/Pants collision; adds assertToolNotDetected. |
| cmd/brief/main.go | Refactors README tools output into writeToolsReadme(io.Writer, ...). |
| cmd/brief/list_test.go | Adds unit test ensuring README tools intro omits numeric totals. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
andrew
left a comment
There was a problem hiding this comment.
Two changes are needed:
knowledge/_shared/ansible.toml:13: Detection misses valid root-level- name:and- include:Galaxy role requirements shown in the Ansible documentation. Add coverage for these forms while retaining the Helm collision checks.detect/detect.go:476:exclude_filesaffects detection, butdetect/filter.go:293omits it from changed-file matching. Removingpants.tomlfrom a repository containingBUILDmakes Bazel detectable, yetbrief difffilters Bazel out. Include exclusion patterns in the filter and test this removal case.
|
Thanks, fixed both items. Ansible requirements now cover the documented |
c33a4a9 to
379cd9c
Compare
|
Rebased this branch onto current |
|
Thanks, I pulled in the follow-up commits and fixed the Windows failure by normalizing CRLF line endings before parsing the README markers. |
andrew
left a comment
There was a problem hiding this comment.
The Helm and Ansible requirements collision is resolved with production-path regression coverage, and the README drift check now handles Windows line endings.
Closes #144
Summary
gradle/libs.versions.tomlDirectory.Packages.propsandDirectory.Build.propsChart.lock,requirements.yamlandrequirements.lock.pnp.cjsshrinkwrap.yamlBUILDdetection for Bazelexclude_filesdetection support to distinguish Bazel projects from Pants projectspants.tomlthe authoritative Pants project markerTesting
gofmtgo build ./...go test -race ./...go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run ./...go run ./cmd/brief list -readme toolsgit diff --check