Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add new `Style/MixinUsage` cop #4840
Using these at the top level affects the behavior of
% cat app/models/example.rb # frozen_string_literal: true include M class Example < ApplicationRecord end
% bundle exec rubocop app/models/example.rb Inspecting 1 file C Offenses: app/models/example.rb:3:1: C: Rails/TopLevelInclude: include is used at the top level. Use inside class or module. include M ^^^^^^^^^ 1 file inspected, 1 offense detected
Since it is difficult to automatically determine the position of
Before submitting the PR make sure the following are checked:
Yes. Outside of Rails, programmers may want to use
I think that's right. A use case I encountered this time was a Rails application, but I think there is a possibility that it can be applied to applications without Rails.
That makes sense. This looks good to me.
@bbatsov First This PR will target
3 times, most recently
Oct 10, 2017
Indeed. I considered the name