Rubocop yml: what's needed?

I’ve begun using rubocop but I ran into an issue with too many bugs. So, I created a rubocop.yml that excludes some checks. Running via PowerShell.

Can anyone advise on the following:

  • Is too much being disabled to give useful feedback? If so, what else might be appropriate?
Here's what I've got:
require: rubocop-sketchup

AllCops:
  DisabledByDefault: true
  DisplayStyleGuide: true
  TargetRubyVersion: 2.7

  SketchUp:
    SourcePath: .
    EncryptedExtension: false
    TargetSketchUpVersion: 2025

SketchupDeprecations:
  Enabled: true

SketchupPerformance:
  Enabled: true

SketchupRequirements:
  Enabled: true

SketchupSuggestions:
  Enabled: true

SketchupBugs:
  Enabled: false

# Disable unstable cops
SketchupBugs/MaterialName:
  Enabled: false
SketchupBugs/RenderMode:
  Enabled: false
SketchupBugs/UniformScaling:
  Enabled: false

# Disable stricter structural cops
SketchupRequirements/FileStructure:
  Enabled: false
SketchupRequirements/SketchupExtension:
  Enabled: false
SketchupSuggestions/Compatibility:
  Enabled: false

Is this, ‘good enough’,… move on? Or does this need to be improved?

I have zero experience with Rubocop. I don’t know if it matters… but SU2025 (and 2024) uses Ruby version 3.2.2, not 2.7. (SU2021-2023 uses 2.7.x)

My attempt was to use Rubocop for SU 2025+ (not strictly required, but there have been some ‘transitional’ versions of SU and I trying to keep it simple)… without ‘breaking’ Rubocop.

So if I change that line to:

TargetRubyVersion: 3.2

I get this:

Error: RuboCop found unknown Ruby version 3.2 in `TargetRubyVersion` parameter (in .rubocop.yml).
Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0

With it as is, same files, I do catch an offence (so it’s working).

I think this means something like ‘I’m checking V25 like it uses 2.7’. Not a great description, I know.

I’m going to mess with this again now…

Long story short: I was not using the correct RuboCop version for SU 25 Ruby 3.2.

Correction is:

gem install rubocop -v 1.57.2
1 Like