[AI-generated] chore: replace Hound with RuboCop#148
Merged
Conversation
Hound is currently configured at the GitHub-App level for this repo and flags violations on PRs without a config file in the codebase. This replaces it with RuboCop, owned in-repo, so contributors can: - Run the same checks locally before pushing (`bundle exec rubocop`) - See the rules and tune them via `.rubocop.yml` - Have the linter pinned to a known version (rubocop ~> 1.86 + rubocop-rspec ~> 3.9, matching what we use elsewhere) Changes: - Add `.rubocop.yml` configured for this small gem (TargetRubyVersion 2.7, Metrics cops disabled, RSpec cops loosened where the existing spec style intentionally uses long describes, `let`-heavy contexts, and `.should` syntax) - Add `rubocop` and `rubocop-rspec` to the dev Gemfile - Add a `lint` job to the CI workflow that runs `rubocop --parallel` - Add `.hound.yml` with `rubocop: enabled: false` so Hound stops duplicating the new in-repo lint job. Once this lands, the Hound app itself can be removed from the repository's GitHub Apps. - Auto-correct existing offences (frozen string literals, double quotes, guard clauses, symbol-shortcut hashes, deprecated `s.test_files`). Specs (29) still pass — none of the auto-corrections change behaviour. Notes / things deliberately not touched here: - `s.required_ruby_version = ">= 2.4.0"` left as-is. Bumping it is a semver-relevant change for gem consumers and belongs in a separate PR. - `s.metadata["rubygems_mfa_required"]` not added. Enabling MFA is a publishing-policy decision for the maintainer, not a lint fix. - `is_not_registered?` / `has_canonical_id?` predicate names left as-is (renaming would change the (admittedly internal) Ruby surface area). Prompt: "can we propse to upstream drop hound and add rubocop and add to CI with open PR ?" Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@sabman If you don't prefer rubocop linter over Hound reviews, we can close this PR without reviewing it :D |
sabman
approved these changes
May 1, 2026
Member
|
No preference. Happy to merge. |
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.
Summary
This PR replaces the GitHub-App-level Hound integration with an in-repo RuboCop setup. Same checks (Hound runs RuboCop under the hood for Ruby anyway), but with the rules owned in the codebase and runnable locally.
Why
Hound is currently flagging style issues on PRs (e.g. 18 violations on #145, 1 on #146) but with no
.hound.ymlor.rubocop.ymlin the repo, contributors can't:Moving to in-repo RuboCop fixes all three.
Changes
.rubocop.yml— RuboCop config tuned for this gem (TargetRubyVersion: 2.7; Metrics cops disabled; RSpec cops loosened where the existing spec style intentionally uses long describes,let-heavy contexts, and.shouldsyntax).rubocopandrubocop-rspecto the dev dependencies..github/workflows/ci.yml— adds alintjob that runsbundle exec rubocop --parallelon Ruby 3.3..hound.yml— setsrubocop: enabled: falseso Hound stops duplicating the in-repo lint job. Once this PR lands, the Hound app itself can be removed from the repository's GitHub Apps settings — the.hound.ymlis a safe interim step.s.test_files. None of these auto-corrections change behaviour, and all 29 specs still pass.Things deliberately not touched
These would each be reasonable follow-ups but felt out-of-scope for a lint PR:
s.required_ruby_version = ">= 2.4.0"left as-is. Bumping it is a semver-relevant change for gem consumers.s.metadata["rubygems_mfa_required"]not added. Enabling MFA is a publishing-policy decision for the maintainer.is_not_registered?,has_canonical_id?) left as-is. Renaming would change the Ruby surface area.Test plan
bundle exec rubocop— 0 offences on 6 inspected files.bundle exec rspec— 29/29 pass after auto-corrections.tests(existing matrix) and the newlintjob.