Skip to content

rubocop is broken: inherited NREL rubocop_v3.yml style file is incompatible with pinned rubocop 1.50 #866

Description

@brianlball

Problem

cd server && bundle exec rubocop (the documented lint command) dies during config validation and never lints a single file:

Error: The `Lint/HandleExceptions` cop has been renamed to `Lint/SuppressedException`.
(obsolete configuration found in .rubocop-http---s3-amazonaws-com-openstudio-resources-styles-rubocop-v3-yml, please update it)

Plus warnings for Metrics/LineLength (now Layout/LineLength) and Performance/* cops (extracted to the rubocop-performance gem, which is not in the Gemfile).

Root cause

Config chain: server/.rubocop.yml → root .rubocop.ymlinherit_from:

  • http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v3.yml
  • http://s3.amazonaws.com/openstudio-resources/styles/rubocop-rails.yml

rubocop_v3.yml targets rubocop 0.x (~2017). server/Gemfile pins rubocop ~> 1.50.0 (2023). Rubocop 1.x treats removed/renamed cop names in config as a fatal error.

Why nobody noticed

CI never runs rubocop (neither workflow in .github/workflows/ mentions it), so the breakage is invisible. It has likely been broken for years.

Suggested fix

The S3 bucket already hosts newer style files — rubocop_v4.yml, rubocop_v5.yml, rubocop_v6.yml all return 200. Newer NREL repos use those.

  1. Point root .rubocop.yml at rubocop_v6.yml (or v4); check rubocop-rails.yml for the same staleness.
  2. Run rubocop and triage the offense backlog (expect a large count after years unlinted; --autocorrect should handle most style cops).
  3. Optionally add a rubocop job to CI so it cannot silently rot again.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions