Loading
Allow the context prefixes that gitlab-org/gitlab uses
What does this MR do?
Configures RSpec/ContextWording to allow the same context prefixes as gitlab-org/gitlab: when, with, without, for, and, on, in, as and if. Until now it used RuboCop's default of when, with and without.
Closes #89 (closed)
Impact: the cop only gets more lenient, so no project gets new offenses. In gitlab-org/gitlab nothing changes, because it already sets this list.
Details
- Where the list comes from: gitlab-org/gitlab!92980 (merged) picked these as the most common prefixes in gitlab-org/gitlab's specs, when it enabled the cop.
- Why every prefix is quoted: YAML reads an unquoted
onastrue. gitlab-org/gitlab hit this and fixed it in gitlab-org/gitlab@ca0aa747. - Checked with a sample spec inheriting
rubocop-rspec.yml:context 'on homepage'andcontext 'for admins'pass, andcontext 'admins'is still flagged.