Skip to content

Increase number of lines used in Danger feature_category scan

What does this MR do and why?

Danger bot currently checks for the presence of a feature_category in the top level RSpec.describe in a spec file. The bot checks the line containing the top level RSpec.describe and the next line. This check can incorrectly flag a change as 'feature_category missing' if the RSpec.describe declaration spans more than 2 lines. See !112888 (comment 1290921671) for an example.

# OK
RSpec.describe SomeClass, :js,
  feature_category: 'category' do

# Feature category missing
RSpec.describe SomeClass,
  :js,
  feature_category: 'category' do

This change checks the top level RSpec.describe line and up to the next 5 lines for the feature_category.

Screenshots or screen recordings

Screenshot_from_2023-03-03_14-00-57

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 Michael Kozono

Merge request reports