Skip to content

Conversation

@dyoung522
Copy link
Contributor

Summary

Replaced StandardRB with RuboCop using a sensible configuration that prefers double-quoted strings and includes reasonable thresholds for Rails applications.

Changes

  • Removed StandardRB gem and added rubocop gem
  • Created .rubocop.yml with:
    • Double-quoted strings enforced (EnforcedStyle: double_quotes)
    • Relaxed RSpec cops for integration/request specs (Max 5 expectations, Max 10 lines)
    • Disabled RSpec/IndexedLet (variables like mod1, mod2 are clear in test context)
    • Reasonable metrics thresholds for Rails apps (AbcSize: 35, MethodLength: 20, etc.)
    • Disabled ActiveRecord-specific cops since we use Firestore (Rails/FindEach, Rails/RedundantActiveRecordAllMethod)
  • Updated bin/audit to run rubocop --parallel instead of standardrb
  • Removed .standard.yml and .standard_rubocop_extensions.yml
  • Auto-corrected 1049+ style violations across 63 files
  • Renamed spec/helpers/mods_helper_spec.rbspec/helpers/mod_helper_spec.rb to match helper name
  • Fixed test failures caused by RuboCop's ActiveRecord-specific optimizations

Verification

All audits and tests passing:

  • bundle-audit: No gem vulnerabilities found
  • brakeman: No security warnings (0 warnings)
  • rubocop: 63 files inspected, no offenses detected
  • rspec: 222 examples, 0 failures

Why This Change?

StandardRB is intentionally opinionated and doesn't allow customization of cop thresholds, which made it incompatible with our testing patterns (integration tests naturally have multiple expectations) and string literal preferences (double quotes). RuboCop provides the flexibility we need while maintaining code quality standards.

🤖 Generated with Claude Code

- Remove standard gem and add rubocop gem to Gemfile
- Create comprehensive .rubocop.yml configuration with:
  - Double-quoted strings (EnforcedStyle: double_quotes)
  - Relaxed RSpec cops for integration tests (Max 5 expectations, 10 lines)
  - Disabled IndexedLet cop (mod1, mod2 are clear in test context)
  - Reasonable metrics thresholds (AbcSize: 35, MethodLength: 20)
  - Disabled ActiveRecord-specific cops (we use Firestore)
- Update bin/audit to use 'rubocop --parallel' instead of standardrb
- Remove .standard.yml and .standard_rubocop_extensions.yml
- Auto-correct 1049+ style violations across 63 files
- Rename spec/helpers/mods_helper_spec.rb → mod_helper_spec.rb
- Fix test failures from RuboCop's ActiveRecord optimizations

All audits passing:
- bundle-audit: No vulnerabilities
- brakeman: No security warnings
- rubocop: 63 files inspected, no offenses detected
- rspec: 222 examples, 0 failures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 12, 2026 05:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces StandardRB with RuboCop to allow for customized linting rules and double-quoted string preference. The configuration is comprehensive and appropriate for a Rails application using Firestore instead of ActiveRecord.

Changes:

  • Removed StandardRB gem and configuration files, added RuboCop with plugins for Rails, RSpec, and performance
  • Created .rubocop.yml with sensible defaults including double-quoted strings, relaxed RSpec cops, and disabled ActiveRecord-specific cops
  • Auto-corrected 1049+ style violations across spec files and application code including frozen string literals, block syntax, hash spacing, and indentation

Reviewed changes

Copilot reviewed 26 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.rubocop.yml New RuboCop configuration with Rails and RSpec-friendly settings
Gemfile Removed standard gem, added rubocop and related plugins
Gemfile.lock Updated dependencies, including rubocop-rspec v2→v3 upgrade
bin/audit Updated to run rubocop --parallel instead of standardrb
.standard.yml, .standard_rubocop_extensions.yml Removed StandardRB config files
.claude/settings.local.json Added Claude Code permissions (contains outdated standardrb reference)
Rakefile, Guardfile Added frozen_string_literal comments
Gemfile Added frozen_string_literal comment
spec/**/* Auto-corrected: frozen_string_literal, block syntax (do/end), hash spacing, expect blocks
app/models/*.rb Auto-corrected: line breaking for long constants, rescue clause formatting
app/controllers/*.rb Auto-corrected: hash spacing, line breaking, empty method syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"Bash(then bin/spring stop)",
"Bash(else echo \"No Spring\")",
"Bash(fi)",
"Bash(bundle exec standardrb:*)",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This permissions entry still references StandardRB, which has been replaced with RuboCop in this PR. Since StandardRB is no longer used, this permission should be removed to keep the configuration consistent.

Suggested change
"Bash(bundle exec standardrb:*)",

Copilot uses AI. Check for mistakes.
The .claude/ directory contains user-specific Claude Code settings
(permission allowlists, etc.) and should not be version controlled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 32 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dyoung522 dyoung522 merged commit 5834a39 into main Jan 12, 2026
8 checks passed
@dyoung522 dyoung522 deleted the replace-standardrb-with-rubocop branch January 12, 2026 06:17
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.

2 participants