Skip to content

v1.9.0

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 21:41
· 20 commits to master since this release

Defaults are now RuboCop's

Without a config, rustocop now reports what RuboCop 1.92 reports with its own defaults. If you relied on rustocop's previous defaults, check your results after upgrading:

  • String quotes: Style/StringLiterals, Style/StringLiteralsInInterpolation and Style/QuotedSymbols default to single quotes. --fix on a project without a config now rewrites double-quoted strings.
  • Cops now on by default: the Metrics cops, Style/Documentation and Style/FrozenStringLiteralComment.
  • Pending cops: cops that RuboCop marks pending run only with new_cops = "enable" (RuboCop's AllCops: NewCops: enable).
  • Setting a maximum no longer switches a cop on.

To keep the old behaviour, set those cops in rustocop.toml or .rubocop.yml.

.rubocop.yml is read as RuboCop reads it

  • Inheritance and defaults: a .rubocop.yml is laid over RuboCop's real config/default.yml, with its inheritance rules and its obsolete-configuration errors and warnings.
  • Path matching: Include and Exclude follow RuboCop's path matching, including Ruby's fnmatch.
  • File discovery: files are picked as RuboCop's TargetFinder picks them, and a folder with its own .rubocop.yml runs with it.
  • Gemspec target Ruby: the target Ruby version comes from a gemspec as RuboCop's TargetRuby takes it.
  • Departments: they enable and disable their cops as in RuboCop.

rubocop-performance

  • Loading: a config that loads the plugin gets its defaults and its cops. It can use plugins: or require: in .rubocop.yml, or the new plugins = ["rubocop-performance"] in rustocop.toml. The gem doesn't need to be installed.
  • Ported cops: Performance/BindCall, Caller, CompareWithBlock, Count, DeletePrefix, DeleteSuffix, Detect, DoubleStartEndWith and EndWith. More will follow.
  • Testing: each ported cop runs the plugin's own spec examples in CI.
  • Directives: may name the cops of any extension a config loads, as in RuboCop.

Also

  • Output paths: file paths are shown relative to the current directory, as RuboCop shows them.
  • Faster binaries: release binaries are built with fat LTO and one codegen unit.
  • Cop fixes: many cop-level fixes. Cops that read another cop's settings now follow them, as in RuboCop. Percent-array words are escaped and encoded exactly as RuboCop does.

Full Changelog: v1.8.0...v1.9.0