fleetlint Policy for a fleet of repositories
v0.10
Getting started

lint/strict/ruby

RuboCop enables new cops

Implements lint/strict for ruby.

Severitywarning
Tiers1, 2
Stacksruby
Scopeeach
Kindexpr
Sourcelibrary v0.7.0
Selected byfleetlint-recommended@v0.7.0

Requirement

The nearest .rubocop.yml, or a file it inherits from, sets AllCops: NewCops: enable (or the configuration inherits Standard), so cops added by RuboCop upgrades run instead of waiting as pending.

Why

RuboCop adds most new checks as pending; without NewCops enable a project keeps the rule set of the version it started with.

Applies when

["", "../", "../../", "../../../"].exists(d, file(d + ".rubocop.yml"))

Check

[["", "../", "../../", "../../../"].filter(d, file(d + ".rubocop.yml"))] .exists(l, [l[0]].exists(d, [yaml(d + ".rubocop.yml")].exists(y, y != null && (
  (has(y.AllCops) && y.AllCops != null && "NewCops" in y.AllCops && y.AllCops.NewCops == "enable")
  || (has(y.inherit_gem) && y.inherit_gem != null && "standard" in y.inherit_gem)
  || (has(y.inherit_from) && (type(y.inherit_from) == list ? y.inherit_from : dyn([y.inherit_from]))
    .exists(p, file(d + p) && [yaml(d + p)].exists(z, z != null && has(z.AllCops) && z.AllCops != null
      && "NewCops" in z.AllCops && z.AllCops.NewCops == "enable")))))))

Fix

Set NewCops: enable under AllCops in .rubocop.yml.

Agent instruction: Set NewCops: enable under AllCops in .rubocop.yml and fix or ratchet (.rubocop_todo.yml) what the new cops report.

A finding of this rule points at .rubocop.yml.

Sources


Generated by fleetlint docs from catalog v0.7.0.