Skip to content

chore: update Standardrb, configure Rubocop to use Standard rules#51

Open
Envek wants to merge 4 commits intorubyatscale:mainfrom
Envek:chore/standardrb
Open

chore: update Standardrb, configure Rubocop to use Standard rules#51
Envek wants to merge 4 commits intorubyatscale:mainfrom
Envek:chore/standardrb

Conversation

@Envek
Copy link
Contributor

@Envek Envek commented Feb 25, 2026

As Standardrb is based on Rubocop and default Rubocop configuration is dramatically different from Standardrb opinions, my editor detected .rubocop.yml and became mad and tried to autocorrect everything to Rubocop default style.

So I decided to make Rubocop to obey Standardrb rules so they are in sync (see Running Standard's rules via RuboCop)

Updated gems and github actions along the way

@github-project-automation github-project-automation bot moved this to Triage in Modularity Feb 25, 2026
@dduugg dduugg requested a review from a team March 5, 2026 17:52
Copy link
Contributor

@dduugg dduugg left a comment

Choose a reason for hiding this comment

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

PR Review: "chore: update Standardrb, configure Rubocop to use Standard rules"

Goal

Two things: (1) configure RuboCop to inherit Standard's rules so that editor RuboCop integrations stop fighting with Standard, and (2) update Standard and related gems to their latest versions. The GitHub Actions workflow is also modernized along the way.


What's Already on main

PR #59 (just merged) already added permissions: checks: write / contents: read to standardrb.yaml, so there will be a minor merge conflict there. Everything else in this PR is new.


Implementation

  • .rubocop.yml: Adds require and inherit_gem directives so RuboCop loads Standard's rule set directly. This makes editor RuboCop plugins agree with standardrb on style.
  • .standard.yml: Removes extend_config: - .rubocop.yml — that directive was pointing Standard at RuboCop config, but the relationship is now inverted (RuboCop inherits from Standard). Keeping it would cause a circular reference.
  • .github/workflows/standardrb.yaml:
    • Renames job buildstandardrb (clearer name).
    • Removes the separate actions/checkout@v1 step — standard-ruby-action@v1 handles checkout itself.
    • Upgrades action from v0.0.5v1.
    • Adds permissions: checks: write / contents: write.
  • Gemfile.lock: Bumps standard 1.35.11.54.0, rubocop 1.62.11.84.2, and transitive deps.
  • lib/singed.rb / lib/singed/cli.rb: Removes two unused require "pathname" lines (likely surfaced by the updated linter).

Risk Assessment

Low risk overall. This is tooling/config only — no production code changes beyond removing two unused require lines.

1. contents: write is broader than necessary

PR #59 landed with contents: read. This PR uses contents: write. The StandardRB action only needs to read code and post check results — contents: write grants it push access to the repo, which is more than required. Recommend keeping contents: read from #59.

2. Minor merge conflict with PR #59

The standardrb.yaml diff will conflict with what #59 already merged (permissions block, job still named build). The resolution is straightforward: keep contents: read from #59 and apply the remaining changes (rename job, upgrade action version, remove checkout step) from this PR.

3. TargetRubyVersion: 2.7 in .rubocop.yml may be outdated

The existing .rubocop.yml targets Ruby 2.7. The CI matrix (from build.yml) tests against 3.2, 3.3, 3.4, and 4. Worth bumping TargetRubyVersion to at least 3.2 to get accurate cop behavior — though this is a pre-existing issue, not introduced by this PR.


Summary

Good housekeeping PR. The .rubocop.yml + .standard.yml change is the main substance and is correct. Main items before merging:

  • Resolve the minor merge conflict with #59 in standardrb.yaml; keep contents: read rather than contents: write
  • Optionally bump TargetRubyVersion to match the minimum supported Ruby (pre-existing issue, but good to fix while touching the file)

@Envek
Copy link
Contributor Author

Envek commented Mar 6, 2026

  1. contents: write is broader than necessary

That allow standardrb action to automatically fix pushed code in a follow-up commit. See autofix option (enabled by default): https://github.com/standardrb/standard-ruby-action#:~:text=autofix

If it is not desired we can rollback this change.

  1. Minor merge conflict with PR Fix StandardRB check failing on Dependabot PRs #59

Resolved

  1. TargetRubyVersion: 2.7 in .rubocop.yml may be outdated

It was in sync with gemspec before #55, updated to 3.2 accordingly

@Envek Envek requested a review from dduugg March 6, 2026 11:21
Copy link
Contributor

@dduugg dduugg left a comment

Choose a reason for hiding this comment

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

Thanks @Envek! The permission is intentional — we want the autofix behavior. All three review points are addressed. Merging.

dduugg
dduugg approved these changes Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants