standard icon indicating copy to clipboard operation
standard copied to clipboard

Proposal: Update rubocop and handles a new cop

Open tk0miya opened this issue 1 year ago • 2 comments

Since v1.67.0, the AllowRBSInlineAnnotation config option has been added to the Layout/LeadingCommentSpace cop. It is necessary to annotate types in Ruby code via RBS::Inline. RBS::Inline is a pilot project of ruby/rbs and is planned to be merged into ruby/rbs.

Could you update rubocop to v1.67.0 and enable the AllowRBSInlineAnnotation option, please?

tk0miya avatar Oct 29 '24 16:10 tk0miya

I also see problems with the current 1.66 Rubocop version.

This is because of the latest update of psych.

Resulting in errors like An error occurred while Layout/FirstArgumentIndentation cop was inspecting

See: https://github.com/rubocop/rubocop/pull/11060#issuecomment-2467457040

This should be fixed when upgrading to 1.68.0 as this PR has made in to that version already: https://github.com/rubocop/rubocop/pull/13379

I added a PR updating to 1.68 already: https://github.com/standardrb/standard/pull/659

nicowenterodt avatar Nov 11 '24 18:11 nicowenterodt

Another option is AllowSteepAnnotation, which also needs to be enabled. With Steep 1.9, empty arrays will trigger a warning like:

lib/meta_tags/text_normalizer.rb:195:102: [warning] Empty array doesn't have type annotation
│ Diagnostic ID: Ruby::UnannotatedEmptyCollection
│
â””         title = (title_limited_length > 0) ? truncate_array(title, title_limited_length, separator) : []

Standard will complain with

  lib/meta_tags/text_normalizer.rb:162:19: Layout/LeadingCommentSpace: Missing space after `#`.

Looks like current option is to either ditch (somewhat) Standard, or Steep. https://github.com/kpumuk/meta-tags/pull/323

kpumuk avatar Dec 15 '24 19:12 kpumuk

fixed by https://github.com/standardrb/standard/pull/709

jasonkarns avatar Jun 13 '25 16:06 jasonkarns