bbatsov/rubocop — pull request #931 by fshowalter (2014-03-30 02:03:59+00:00)
Title: add useless access modifier lint cop

I often see code like this:

```ruby
class Foo
def self.public_class_method
end

private

def self.would_be_private_class_method
end
end
```

The `private` modifier is, of course, useless above since it's only valid for instance methods. This lint Cop checks for instances of `private` or `protected` with no later instance methods. Incidentally, this also tripped a cli_spec test, where this was passed in to test:

```ruby
class Dsl

private

A = %w(git path)
end
```

As the A constant isn't private and the access modifier is useless.

__Note__: This implementation restricts itself to classes. I'd like to get that right before extending it to modules as well.