Skip to content

rubocop --unsafe-autocorrect changes#1156

Open
apiology wants to merge 1370 commits intocastwide:v0.59from
apiology:rubocop_dash_capital_A
Open

rubocop --unsafe-autocorrect changes#1156
apiology wants to merge 1370 commits intocastwide:v0.59from
apiology:rubocop_dash_capital_A

Conversation

@apiology
Copy link
Contributor

@apiology apiology commented Jan 14, 2026

Builds upon:

Takes the rubocop todo file down further - cumulative reduction is:

image

There are 363 lines left in that file.

This PR was generated by this script - rerun to autogenerate (the PR will collect conflicts pretty regularly until it's merged):

First, reset the branch to be the same as rubocop_a:

  1. Update rubocop -a #1053 if needed
  2. Reset the branch to be the same as rubocop_a:
# Error out instead of continuing
set -e
git checkout rubocop_dash_capital_A
git fetch -a
git reset --hard 2026-01-27
  1. Apply the autocorrect:
# Tell RuboCop not to prepend unused arguments with `_`, leaving Solargraph params unlinked
gsed -i 's/^  AllowUnusedKeywordArguments: true/  Enabled: false/g' .rubocop.yml
# Tell RuboCop not to use syntax that Solargraph doesn't understand yet
yq eval '.["Style/ArgumentsForwarding"].Enabled = false' -i .rubocop.yml
yq eval '.["Style/SuperArguments"].Enabled = false' -i .rubocop.yml
# Run autocorrect and push up changes:
rm .rubocop_todo.yml
touch .rubocop_todo.yml
bundle exec rubocop -A -c .rubocop.yml || true
git checkout .rubocop.yml # revert rule change
git checkout spec/fixtures # leave these alone
git checkout parallel_rspec spec/source/chain_spec.rb  # import a nil debugging bug in specs
git checkout 2026-01-27 lib/solargraph/language_server/message/extended/document_gems.rb lib/solargraph/language_server/message/extended/check_gem_version.rb lib/solargraph/source/chain/literal.rb lib/solargraph/convention/struct_definition* spec/source/cursor_spec.rb


# overaggressive - work to reduce down


bundle exec rubocop --auto-gen-config --exclude-limit 5 --no-offense-counts --no-auto-gen-timestamp
git commit --no-verify -a -m "rubocop -A"
  1. Push up and replace previous commits:
git push -f
  1. Manually fix typechecking errors reported in CI

  2. Check in fixes if they pass

make spec && git commit -a -m "manual test fixes"
bundle exec solargraph typecheck --level=strong && git commit -a -m "manual typechecking fixes"

The solargraph overcommit errors are limitations in our strong typechecking, mostly if not all addressed by other open PRs.

After this PR is merged, other PRs will need to do the 'Apply the autocorrect' step before merging master in to make that merge happen smoothly.

…:apiology/solargraph into fix_directive_combination_issue
Use our generated RBS signature from parameters as a key to combine
method signatures from RBS/YARD pins.

This is closer to what RBS does than the current technique of using
the arity alone, and fixes a key degenerate case in Integer#+ revealed
by updated definitions used by recently released RBS gems
@apiology apiology force-pushed the rubocop_dash_capital_A branch from 6bab1bd to 7a71eed Compare January 31, 2026 20:32
@apiology apiology marked this pull request as ready for review January 31, 2026 21:09
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.

3 participants