Skip to content

Enforce blank line after let blocks

Doug Stull requested to merge enforce-let-block-spaces into master
  • for use in our projects like the Versions, GitLab, Customers, etc

Enforces furthering newlines rules after let blocks as seen below.

            # bad
            RSpec.describe Foo do
              let(:something) { 'something' }
              let(:another_thing) do
              end
              let(:something_else) do
              end
              let(:last_thing) { 'last thing' }
            end

            # good
            RSpec.describe Foo do
              let(:something) { 'something' }
              let(:another_thing) do
              end

              let(:something_else) do
              end

              let(:last_thing) { 'last thing' }
            end

            # good - it's ok to have non-separated without do/end blocks
            RSpec.describe Foo do
              let(:something) { 'something' }
              let(:last_thing) { 'last thing' }
            end

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

Edited by Doug Stull

Merge request reports