Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new style empty_lines_special to module and class body #3624

Merged
merged 1 commit into from
Nov 6, 2016
Merged

Add new style empty_lines_special to module and class body #3624

merged 1 commit into from
Nov 6, 2016

Conversation

legendetm
Copy link
Contributor

@legendetm legendetm commented Oct 14, 2016

Adds new style empty_lines_special to Style/EmptyLinesAroundClassBody and Style/EmptyLinesAroundModuleBody. It is related to #3452.

It works like empty_lines_except_namespace in #3560, except if the first line is not a method definition, it

  • does NOT require an empty line at the beginning of a class/module, but
  • requires an empty line before the first method definition.

I'm not sure, whether I should check the empty line before the first method definition in this cop or somewhere else, so currently I made 2 separate commits. If that's fine, I will squash the commits and then this PR fixes #3452.

module Providers
  class ProviderA
    class Xml
      include Provides::Xml

      def to_xml
        ...
      end

    end
  end
end

Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Used the same coding conventions as the rest of the project.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • All tests are passing.
  • The new code doesn't generate RuboCop offenses.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

Copy link
Collaborator

@jonas054 jonas054 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. The only thing I found to comment is that we spell offense with an 's' within the project.

Copy link
Collaborator

@jonas054 jonas054 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM. Needs rebase now.

@bbatsov bbatsov merged commit a536c3b into rubocop:master Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty lines around method definition.
3 participants