Skip to content

chore: require rubocop-minitest 0.39#407

Merged
koic merged 1 commit into
modelcontextprotocol:mainfrom
atesgoral:rubocop-cleanup-existing-offenses
Jun 15, 2026
Merged

chore: require rubocop-minitest 0.39#407
koic merged 1 commit into
modelcontextprotocol:mainfrom
atesgoral:rubocop-cleanup-existing-offenses

Conversation

@atesgoral

@atesgoral atesgoral commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Require rubocop-minitest 0.39.0 or newer so Minitest/AssertEmptyLiteral uses its newer default disabled state.

Context

Clean main reported 35 Minitest/AssertEmptyLiteral offenses with rubocop-minitest 0.38.2. That cop was disabled by default in rubocop-minitest 0.39.0 because assert_empty can hide whether the intended expected literal was [] or {}.

Changes

  • Add a minimum rubocop-minitest version of 0.39.0 in the Gemfile.
  • Leave the existing assertions unchanged.

Tophatting

  • GEM_HOME="$PWD/.gem-test" GEM_PATH="$PWD/.gem-test:/nix/store/jh918yiwd5cs4pjg005ac32m2q7ckw3l-ruby-4.0.5/lib/ruby/gems/4.0.0" bundle exec rake rubocop
  • GEM_HOME="$PWD/.gem-test" GEM_PATH="$PWD/.gem-test:/nix/store/jh918yiwd5cs4pjg005ac32m2q7ckw3l-ruby-4.0.5/lib/ruby/gems/4.0.0" bundle exec rake test
  • git diff --check

@koic

koic commented Jun 14, 2026

Copy link
Copy Markdown
Member

Minitest/AssertEmptyLiteral is disabled by default because replacing [] and {} can make it harder to see which literal is being asserted, which may reduce readability.
rubocop/rubocop-minitest#346

I believe this case is no longer flagged. Is that still the case?

Require rubocop-minitest 0.39.0 or newer so Minitest/AssertEmptyLiteral uses its newer default disabled state.
@atesgoral atesgoral force-pushed the rubocop-cleanup-existing-offenses branch from 0e694e3 to 460adaf Compare June 14, 2026 15:46
@atesgoral atesgoral changed the title test: fix existing RuboCop offenses chore: require rubocop-minitest 0.39 Jun 14, 2026
@atesgoral atesgoral marked this pull request as ready for review June 14, 2026 15:48
@atesgoral

Copy link
Copy Markdown
Contributor Author

@koic After upgrading rubocop-minitest, these assertions are no longer flagged.

@koic koic merged commit 2f24cdf into modelcontextprotocol:main Jun 15, 2026
21 checks passed
@atesgoral atesgoral deleted the rubocop-cleanup-existing-offenses branch June 15, 2026 06:56
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