Skip to content

Draft: Add RuboCop rule RSpec/SpecHelperTag

Peter Leitzen requested to merge pl-rubocop-rspec-helper-tag into master

What does this MR do and why?

This rule tags spec with helper: :fast_spec if a spec require fast_spec_helper. Otherwise it will remove this tag.

This might be useful to group specs with knapsack.

Refs #350700 (comment 1067272389)

Example

$ be rubocop --only RSpec/SpecHelperTag spec/haml_lint/linter/no_plain_nodes_spec.rb
Inspecting 1 file
C

Offenses:

spec/haml_lint/linter/no_plain_nodes_spec.rb:9:1: C: RSpec/SpecHelperTag: Add spec tag helper: :fast_spec.
RSpec.describe HamlLint::Linter::NoPlainNodes do ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected, 1 offense auto-correctable

Draft?

How to set up and validate locally

bin/rake rubocop:todo:generate[RSpec/SpecHelperTag]

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports

Loading