Repository navigation
Fix Rubocop offenses from the new cops in the Ruby upgrade - #77
Merged
Merged
Conversation
Upgrading Ruby bumped rubocop-rspec from 3.0.4 to 3.10.2, whose new RSpec/Output cop (enabled by NewCops) flags the puts in spec/support/spec_summary.rb. That script prints the a11y test summary to the CI log on purpose, so exclude it from the cop. The linter checks every file, so this failed every PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pancakereport
added a commit
that referenced
this pull request
Oct 28, 2026
Reverts "Let spec_summary.rb print the a11y summary", which is now #77, so this PR only changes the sections page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit only excluded spec_summary.rb, but upgrading rubocop to 1.92.1 and rubocop-rspec to 3.10.2 brought more new cops (enabled by NewCops), so the check still failed: - RSpec/Output: exclude all of spec/support, whose helpers report on the site build and the a11y results in the CI log, and allow the two lines in accessibility_spec.rb that list the pages being tested. - RSpec/LeakyLocalVariable: make the a11y standards, skipped rules and excluded elements constants, like ALL_PAGES beside them. - Style/OneClassPerFile: define ConfigValidationError inside the Jekyll module, next to the ConfigValidator that raises it. - Bundler/OrderedGems: sort jekyll-target-blank into place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Rubocop lint check fails on every PR, for example #76, because of files those PRs don't touch.
The "upgrade ruby" commit (6ee7100) also upgraded rubocop from 1.65.1 to 1.92.1 and rubocop-rspec from 3.0.4 to 3.10.2. Those versions add cops that
NewCops: enablein.rubocop.ymlturns on. The lint workflow runs withfilter_mode: nofilter, so it checks every file, and every PR fails on the existing code.This fixes each offense:
RSpec/Output:spec/support/is excluded, since its helpers print the site build progress and the a11y results summary to the CI log on purpose. The two lines inspec/accessibility_spec.rbthat list the pages being tested get an inline exception. Rubocop's unsafe autocorrect for this cop deletes the output instead, so it isn't used.RSpec/LeakyLocalVariable: the a11y standards, skipped rules and excluded elements inspec/accessibility_spec.rbbecome frozen constants, likeALL_PAGESbeside them.Style/OneClassPerFile:ConfigValidationErroris now defined inside theJekyllmodule in_plugins/config_validator.rb, next to theConfigValidatorthat raises it. Nothing else refers to it.Bundler/OrderedGems:jekyll-target-blankis sorted into place inGemfile.Gemfile.lockis unchanged.Testing
bundle exec rubocoppasses locally, using the repo's Ruby 3.3.13 and the locked gem versions.bundle exec jekyll buildsucceeds, andJekyll::ConfigValidationErrorstill raises with the same message.bundle exec rspec) weren't run locally; they need a headless browser.Rubocop still warns that rubocop-rspec and rubocop-capybara should be loaded with
plugins:rather thanrequire:in.rubocop.yml. That's a warning, not a failure, so it's left for later.🤖 Generated with Claude Code