Change RSpec/ExampleWithoutDescription style to single_line_only
Description of the proposal
For empty test description blocks, use
specifyrather thanit doif the test is self-explanatory.
The RSpec/ExampleWithoutDescription cop is enabled by default. Here we are changing the EnforcedStyle of the cop to single_line_only to match the above quoted testing guidelines.
Examples
# bad
it do
# good
it { is_expected.to be_truthy }
# good
specify do
Impact on gitlab-org/gitlab
bundle exec rubocop $f --only RSpec/ExampleWithoutDescription
39218 files inspected, 1181 offenses detected
Check-list
-
Mention this proposal in the relevant Slack channels (e.g. #development,#backend,#frontend) -
If there is a choice to make between two potential styles, set up an emoji vote in the MR: - CHOICE_A:
🅰 - CHOICE_B:
🅱 - Vote yourself for both choices so that people know these are the choices
- CHOICE_A:
-
The MR doesn't have significant objections, and is getting a majority of 👍 vs👎 (remember that we don't need to reach a consensus) -
(If applicable) One style is getting a majority of vote (compared to the other choice) -
(If applicable) Update the MR with the chosen style -
Follow the review process as usual
Edited by Abdul Wadood