feat: bring lint-herb up to full linter pattern - #85
Conversation
- Add herb hook to .pre-commit-hooks.yaml (files: pattern, pass_filenames: false) - Add lint-herb step to lint-shared.yml - Add herb to setup-runtimes Ruby condition - Update README table (herb now a first-class key, remove orphan note) - Add herb to .pre-commit-config.yaml.example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62e731098f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| contains(inputs.linters, 'rubocop') || | ||
| contains(inputs.linters, 'erb-lint') | ||
| contains(inputs.linters, 'erb-lint') || | ||
| contains(inputs.linters, 'herb') |
There was a problem hiding this comment.
Install Herb before enabling it in lint-shared
🤖 [rubykatzen/baseline]: When a consumer enables linters: herb, this new condition only runs ruby/setup-ruby with Bundler cache; it never installs the herb executable, and rubykatzen-baseline does not declare a Herb dependency in baseline.gemspec. The newly wired lint-herb action then invokes hooks/herb.sh, which runs bundle exec herb analyze . whenever the consuming repo has a Gemfile, so the advertised first-class herb path fails unless every consumer adds its own Herb gem. Please package/install Herb here before advertising it through lint-shared.yml.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Makes herb a first-class linter in baseline’s standard pattern so consuming repos can enable it via the shared workflow and pre-commit configuration like the other linters.
Changes:
- Add a
herbpre-commit hook definition and include it in the example pre-commit config. - Add
herbas a supportedlinters:key and runlint-herbfromlint-shared.ymlwhen selected. - Ensure Ruby runtime setup runs when
herbis selected.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents herb as a supported linters: key and adds it to the linter table. |
| .pre-commit-hooks.yaml | Adds the herb hook definition (with file matching + pass_filenames: false). |
| .pre-commit-config.yaml.example | Adds - id: herb to the example baseline hook list. |
| .github/workflows/lint-shared.yml | Runs lint-herb when contains(inputs.linters, 'herb'). |
| .github/actions/setup-runtimes/action.yml | Installs Ruby (bundler-cache) when herb is selected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add herb ~> 0.10 to baseline.gemspec so bundle exec herb works for consumers that install rubykatzen-baseline - Remove redundant html\.herb from .pre-commit-hooks.yaml files regex (already matched by the herb alternative) - Expand README Lints column to match what herb.sh actually scans Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53568a7bce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uses: rubykatzen/baseline/.github/workflows/lint-shared.yml@VERSION | ||
| with: | ||
| linters: yamllint, pymarkdown, ruff, shellcheck, actionlint, rubocop, erb-lint, pre-commit | ||
| linters: yamllint, pymarkdown, ruff, shellcheck, actionlint, rubocop, erb-lint, herb, pre-commit |
There was a problem hiding this comment.
Keep the quick-start workflow and hooks in sync
🤖 [rubykatzen/baseline]: This quick-start workflow now includes both herb and pre-commit, but the pre-commit config block immediately below still lists hooks only through erb-lint. Copying the two README snippets as shown makes check-precommit-sync fail because it compares workflow linters, minus pre-commit, to the configured baseline hooks and sees herb missing; add the Herb hook to the README hook snippet or leave Herb out of the all-in-one workflow example.
Useful? React with 👍 / 👎.
| if: contains(inputs.linters, 'rubocop') | ||
| - uses: rubykatzen/baseline/.github/actions/lint-erb-lint@v0.7 | ||
| if: contains(inputs.linters, 'erb-lint') | ||
| - uses: rubykatzen/baseline/.github/actions/lint-herb@v0.7 |
There was a problem hiding this comment.
Run Herb through a Herb-aware setup action
🤖 [rubykatzen/baseline]: Fresh evidence after the earlier thread: the Herb gem dependency is now present, but this new lint step is still preceded by setup-runtimes@v0.7 in this workflow. For a release where v0.7 is not moved to this commit, such as a new minor release, a consumer that opts into only linters: herb executes the old setup action that does not enter the Ruby/Bundler setup path for Herb, then lint-herb@v0.7 runs bundle exec herb analyze ./herb analyze . without installing the gem, so the newly advertised linter can fail before analyzing templates.
Useful? React with 👍 / 👎.
Summary
lint-herbhad an action and a hook script but was missing from the standard linter pattern:herbhook to.pre-commit-hooks.yaml(files regex,pass_filenames: false)lint-herbstep tolint-shared.ymlgated oncontains(inputs.linters, 'herb')herbtosetup-runtimesRuby conditionlinters:keyherbto.pre-commit-config.yaml.example