Skip to content

Releases

v1.9.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 21:41

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

v1.8.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 22:02

What's Changed

  • Bump the cargo group across 1 directory with 6 updates by @dependabot[bot] in #5

New Contributors

Full Changelog: v1.7.0...v1.8.0

v1.7.0

Choose a tag to compare

@github-actions github-actions released this 27 Nov 11:26

Full Changelog: v1.6.0...v1.7.0

v1.6.0

Choose a tag to compare

@github-actions github-actions released this 26 Nov 18:20

Full Changelog: v1.5.0...v1.6.0

v1.5.0

Choose a tag to compare

@github-actions github-actions released this 23 Nov 13:19

Full Changelog: v1.4.0...v1.5.0

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 22:08

Full Changelog: v1.3.0...v1.4.0

v1.3.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 12:07

Full Changelog: v1.2.0...v1.3.0

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 17:11

New

  • rustocop --format json prints the report in the schema of RuboCop's --format json, so an editor plugin written for RuboCop (nvim-lint, ALE) runs rustocop when it is named as the executable. rustocop also accepts the --force-exclusion and --server options that those plugins pass, and ignores them. Each offense location is the one character at its start: rustocop does not record where an offense ends.
  • Nine Metrics cops accept max in rustocop.toml, as Max in RuboCop: AbcSize, BlockLength, BlockNesting, ClassLength, CyclomaticComplexity, MethodLength, ModuleLength, ParameterLists and PerceivedComplexity. The Metrics cops are off by default, and a max for one of them switches it on.
  • rustocop --import-rubocop-config carries the Max of these cops over.

Binaries

Linux x86_64 and aarch64 (glibc 2.35 or newer), macOS Intel and Apple silicon. Each archive holds the rustocop executable.

Full Changelog: v1.1.0...v1.2.0

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 15:47

New

  • rustocop --import-rubocop-config writes a rustocop.toml from the .rubocop.yml in the current directory and the local files it names in inherit_from. It carries over AllCops: Exclude, a TargetRubyVersion of 3.4 or 4.0, Enabled of a cop or department, Exclude of a cop, and Max of Layout/LineLength, and lists every setting that it does not carry over.
  • rustocop --write-baseline now adds to an existing rustocop.toml, where it stopped with an error before. A cop that has a table there is changed in that table, any other cop gets a new table at the end, and the rest of the file stays as it is. Run it after the import to silence what rustocop still reports.

Fixed

  • rustocop | head no longer ends with a panic when the reader closes the pipe.

Binaries

Linux x86_64 and aarch64 (glibc 2.35 or newer), macOS Intel and Apple silicon. Each archive holds the rustocop executable.

Full Changelog: v1.0.0...v1.1.0

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 11:48