Make the rubocop CI job blocking again, automate rubocop-todo - #1260
Open
apiology wants to merge 3 commits into
Open
Make the rubocop CI job blocking again, automate rubocop-todo#1260apiology wants to merge 3 commits into
apiology wants to merge 3 commits into
Conversation
- Bump dev-dependency RuboCop from 1.80.0 to 1.89.0: 1.80.0 had a bug
where per-file AllCops:Exclude entries didn't remove files from the
scan target list, so spec/fixtures/invalid_{byte,utf8,node_comment}.rb
(fixtures with intentionally invalid encoding, used to test
Solargraph's own error handling) always failed Lint/Syntax regardless
of Exclude config. 1.89.0 fixes this.
- Consolidate the three fixture exclude entries into one glob.
- Fix the todo-sync step: rubocop --auto-gen-config's exit code
reflects the total offense count, not just new offenses, so under
GitHub Actions' default bash -e it aborted before reaching the
git-diff check that's meant to be the actual pass/fail signal.
- Remove continue-on-error from both rubocop_todo steps and
regenerate .rubocop_todo.yml against 1.89.0.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018s7rWmpEoZpj4o3To7F286
The previously committed version was missing --no-offense-counts (78 stray "# Offense count: N" comment lines), causing the todo-sync check to fail: CI's fresh `bundle install` regeneration diverged from the committed file even with identical gem versions installed.
When rubocop is clean (the "Run RuboCop" step already passed), any diff from regenerating .rubocop_todo.yml can only be a shrink -- offenses that got fixed without removing their todo entry -- never a new offense. On push to master, commit and push that cleanup automatically instead of asking someone to do it by hand. This can't apply to PRs: GITHUB_TOKEN can't push to a fork's branch, and most PRs on this repo come from forks. PRs keep the existing fail-with-diff behavior.
apiology
marked this pull request as ready for review
August 17, 2026 21:28
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
AllCops:Excludeentries didn't remove files from the scan target list, sospec/fixtures/invalid_{byte,utf8,node_comment}.rb(fixtures with intentionally invalid encoding, used byspec/source_spec.rbandspec/source_map/mapper_spec.rbto test Solargraph's own error handling) always failedLint/Syntaxregardless of Exclude config — confirmed this doesn't reproduce on 1.89.0, and no config-based fix exists (RuboCop refuses any config forLint/Syntaxat all)..rubocop.ymlinto one glob..github/workflows/linting.yml:rubocop --auto-gen-config's exit code reflects the total offense count, not just newly-introduced offenses, so under GitHub Actions' defaultbash -eit aborted before ever reaching the git-diff check that's meant to be the actual pass/fail signal.continue-on-error: truefrom bothrubocop_todojob steps (marked@todo Temporary, expect to revert in 0.60— already at 0.60.2) and regenerate.rubocop_todo.ymlagainst 1.89.0.masteronly: if RuboCop is clean, auto-regenerate.rubocop_todo.ymland push the result if it shrank (i.e. someone fixed a todo'd offense without removing its entry), so that cleanup no longer has to be done by hand. This can't extend to PRs —GITHUB_TOKENcan't push to a fork's branch, and most PRs on this repo come from forks — so PRs keep the existing fail-with-diff behavior asking the contributor to regenerate and push it themselves.Test plan
bundle exec rubocop -c .rubocop.yml— 386 files inspected, no offenses detectedbundle exec rspec— 1623 examples, 0 failures (60 pre-existing pending).rubocop_todo.yml,rubocop,overcommitall pass)🤖 Generated with Claude Code
https://claude.ai/code/session_018s7rWmpEoZpj4o3To7F286