Skip to content

[AI-generated] chore: replace Hound with RuboCop#148

Merged
sabman merged 1 commit into
decision-labs:masterfrom
OLIOEX:replace-hound-with-rubocop
May 1, 2026
Merged

[AI-generated] chore: replace Hound with RuboCop#148
sabman merged 1 commit into
decision-labs:masterfrom
OLIOEX:replace-hound-with-rubocop

Conversation

@erimicel

@erimicel erimicel commented May 1, 2026

Copy link
Copy Markdown
Contributor

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.yml or .rubocop.yml in the repo, contributors can't:

  • See the rules being applied
  • Run them locally before pushing
  • Tune them when project style intentionally diverges from defaults

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 .should syntax).
  • Gemfile — adds rubocop and rubocop-rspec to the dev dependencies.
  • .github/workflows/ci.yml — adds a lint job that runs bundle exec rubocop --parallel on Ruby 3.3.
  • .hound.yml — sets rubocop: enabled: false so 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.yml is a safe interim step.
  • Auto-corrected existing offences — frozen string literals, double-quote strings, guard clauses, symbol-shortcut hashes, removal of deprecated 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.
  • Predicate-style names (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.
  • CI runs both tests (existing matrix) and the new lint job.

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>
@erimicel erimicel changed the title chore: replace Hound with RuboCop [AI-generated] chore: replace Hound with RuboCop May 1, 2026
@erimicel

erimicel commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

@sabman If you don't prefer rubocop linter over Hound reviews, we can close this PR without reviewing it :D

@sabman

sabman commented May 1, 2026

Copy link
Copy Markdown
Member

No preference. Happy to merge.

@sabman sabman merged commit caf54f7 into decision-labs:master May 1, 2026
6 checks passed
@erimicel erimicel deleted the replace-hound-with-rubocop branch May 14, 2026 20:04
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.

2 participants