Skip to content

Commit 8345a46

Browse files
geniouShane da Silva
authored and
Shane da Silva
committed
Use next instead of if at end of iteration
There is a new cop coming called `Next` that will look for this case. Change-Id: I35ac6acd33065aa4a0b7b7ce6caea711a80b6670 Reviewed-on: http://gerrit.causes.com/37614 Tested-by: jenkins <jenkins@causes.com> Reviewed-by: Shane da Silva <shane@causes.com>
1 parent 0fa1e76 commit 8345a46

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lib/scss_lint/config.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,10 @@ def merge_wildcard_linter_options(options)
128128

129129
LinterRegistry.linters.each do |linter_class|
130130
name = linter_name(linter_class)
131+
next unless name.match(class_name_regex)
131132

132-
if name.match(class_name_regex)
133-
old_options = options['linters'].fetch(name, {})
134-
options['linters'][name] = smart_merge(old_options, wildcard_options)
135-
end
133+
old_options = options['linters'].fetch(name, {})
134+
options['linters'][name] = smart_merge(old_options, wildcard_options)
136135
end
137136
end
138137

lib/scss_lint/linter/space_after_comma.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ def check_commas_after_args(args, arg_type)
9090
spaces += 1
9191
offset += 1
9292
end
93+
next if spaces == EXPECTED_SPACES_AFTER_COMMA
9394

94-
if spaces != EXPECTED_SPACES_AFTER_COMMA
95-
add_lint arg, "Commas in #{arg_type} should be followed by a single space"
96-
end
95+
add_lint arg, "Commas in #{arg_type} should be followed by a single space"
9796
end
9897
end
9998
end

0 commit comments

Comments
 (0)