Skip to content

Upstream empty line after shared example cop

Doug Stull requested to merge upstream-shared-example-cop into master
  • for use in other projects like the version application

Enforces furthering newlines rules after shared example blocks as seen below

        # bad
        RSpec.describe Foo do
          it_behaves_like 'do this first'
          it_behaves_like 'does this' do
          end
          it_behaves_like 'does that' do
          end
          it_behaves_like 'do some more'
        end

        # good
        RSpec.describe Foo do
          it_behaves_like 'do this first'
          it_behaves_like 'does this' do
          end

          it_behaves_like 'does that' do
          end

          it_behaves_like 'do some more'
        end

        # fair - it's ok to have non-separated without blocks
        RSpec.describe Foo do
          it_behaves_like 'do this first'
          it_behaves_like 'does this'
        end

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/217642

Edited by Doug Stull

Merge request reports