Repository navigation
Releases
Releases · visualitypl/rustocop
v1.9.0
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/StringLiteralsInInterpolationandStyle/QuotedSymbolsdefault to single quotes.--fixon a project without a config now rewrites double-quoted strings. - Cops now on by default: the Metrics cops,
Style/DocumentationandStyle/FrozenStringLiteralComment. - Pending cops: cops that RuboCop marks pending run only with
new_cops = "enable"(RuboCop'sAllCops: 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.ymlis laid over RuboCop's realconfig/default.yml, with its inheritance rules and its obsolete-configuration errors and warnings. - Path matching:
IncludeandExcludefollow RuboCop's path matching, including Ruby'sfnmatch. - File discovery: files are picked as RuboCop's
TargetFinderpicks them, and a folder with its own.rubocop.ymlruns with it. - Gemspec target Ruby: the target Ruby version comes from a gemspec as RuboCop's
TargetRubytakes 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:orrequire:in.rubocop.yml, or the newplugins = ["rubocop-performance"]inrustocop.toml. The gem doesn't need to be installed. - Ported cops:
Performance/BindCall,Caller,CompareWithBlock,Count,DeletePrefix,DeleteSuffix,Detect,DoubleStartEndWithandEndWith. 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
What's Changed
- Bump the cargo group across 1 directory with 6 updates by @dependabot[bot] in #5
New Contributors
- @dependabot[bot] made their first contribution in #5
Full Changelog: v1.7.0...v1.8.0
v1.7.0
v1.6.0
v1.5.0
v1.4.0
v1.3.0
v1.2.0
New
rustocop --format jsonprints 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-exclusionand--serveroptions 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
maxinrustocop.toml, asMaxin RuboCop:AbcSize,BlockLength,BlockNesting,ClassLength,CyclomaticComplexity,MethodLength,ModuleLength,ParameterListsandPerceivedComplexity. The Metrics cops are off by default, and amaxfor one of them switches it on. rustocop --import-rubocop-configcarries theMaxof 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
New
rustocop --import-rubocop-configwrites arustocop.tomlfrom the.rubocop.ymlin the current directory and the local files it names ininherit_from. It carries overAllCops: Exclude, aTargetRubyVersionof 3.4 or 4.0,Enabledof a cop or department,Excludeof a cop, andMaxofLayout/LineLength, and lists every setting that it does not carry over.rustocop --write-baselinenow adds to an existingrustocop.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 | headno 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
Full Changelog: https://github.com/visualitypl/rustocop/commits/v1.0.0