exclude spec/ and features/ from `Style/PredicateName` cop

This commit is contained in:
Maxim Rydkin 2017-08-29 11:51:15 +03:00
parent e637f80243
commit 380dff622f
4 changed files with 23 additions and 21 deletions

View File

@ -606,6 +606,18 @@ Style/YodaCondition:
Style/Proc:
Enabled: true
# Use `spam?` instead of `is_spam?`
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Enabled: true
NamePrefixBlacklist: is_
Exclude:
- 'spec/**/*'
- 'features/**/*'
# Metrics #####################################################################
# A calculated magnitude based on number of assignments,

View File

@ -237,16 +237,6 @@ Style/PercentLiteralDelimiters:
Style/PerlBackrefs:
Enabled: false
# Offense count: 105
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Enabled: true
NamePrefixBlacklist: is_
NameWhitelist: have_visible_content
# Offense count: 58
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.

View File

@ -9,15 +9,15 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
end
step "The project has 0 stars" do
has_n_stars?(0)
has_n_stars(0)
end
step "The project has 1 star" do
has_n_stars?(1)
has_n_stars(1)
end
step "The project has 2 stars" do
has_n_stars?(2)
has_n_stars(2)
end
# Requires @javascript
@ -31,7 +31,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
protected
def has_n_stars?(n)
def has_n_stars(n)
expect(page).to have_css(".star-count", text: n, visible: true)
end
end

View File

@ -2,27 +2,27 @@ module SharedGroup
include Spinach::DSL
step 'current user is developer of group "Owned"' do
member_of?(current_user.name, "Owned", Gitlab::Access::DEVELOPER)
is_member_of(current_user.name, "Owned", Gitlab::Access::DEVELOPER)
end
step '"John Doe" is owner of group "Owned"' do
member_of?("John Doe", "Owned", Gitlab::Access::OWNER)
is_member_of("John Doe", "Owned", Gitlab::Access::OWNER)
end
step '"John Doe" is guest of group "Guest"' do
member_of?("John Doe", "Guest", Gitlab::Access::GUEST)
is_member_of("John Doe", "Guest", Gitlab::Access::GUEST)
end
step '"Mary Jane" is owner of group "Owned"' do
member_of?("Mary Jane", "Owned", Gitlab::Access::OWNER)
is_member_of("Mary Jane", "Owned", Gitlab::Access::OWNER)
end
step '"Mary Jane" is guest of group "Owned"' do
member_of?("Mary Jane", "Owned", Gitlab::Access::GUEST)
is_member_of("Mary Jane", "Owned", Gitlab::Access::GUEST)
end
step '"Mary Jane" is guest of group "Guest"' do
member_of?("Mary Jane", "Guest", Gitlab::Access::GUEST)
is_member_of("Mary Jane", "Guest", Gitlab::Access::GUEST)
end
step 'I should see group "TestGroup"' do
@ -35,7 +35,7 @@ module SharedGroup
protected
def member_of?(username, groupname, role)
def is_member_of(username, groupname, role)
@project_count ||= 0
user = User.find_by(name: username) || create(:user, name: username)
group = Group.find_by(name: groupname) || create(:group, name: groupname)