NatLabRockies / NatLabRockies/OpenStudio-server

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

Open
#866 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
58
Forks
27
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with root .rubocop.yml and server/Gemfile, then run cd server && bundle exec rubocop to reproduce the configuration failure. Compare the inherited rubocop_v4/v5/v6 style files and inspect rubocop-rails.yml for the same staleness. Done means the documented command completes, the offense backlog is triaged, and the relevant CI workflows cover linting if that option is taken.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.