Skip to content

Commit

Permalink
Fix NameFormat to report variables in function args
Browse files Browse the repository at this point in the history
  • Loading branch information
sds committed Jan 19, 2016
1 parent 4ea7ed1 commit f8a92f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
`::-webkit-search-results-decoration` pseudo elements to `PseudoElement`
* Add `backdrop-filter` to list of known properties
* Fix `PropertySortOrder` to properly handle duplicated properties
* Fix `NameFormat` to report incorrectly-named variables passed as function
arguments

## 0.43.2

Expand Down
1 change: 1 addition & 0 deletions lib/scss_lint/linter/name_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def visit_mixindef(node)

def visit_script_funcall(node)
check_name(node, 'function') unless FUNCTION_WHITELIST.include?(node.name)
yield # Continue linting any arguments of this function call
end

def visit_script_variable(node)
Expand Down
10 changes: 10 additions & 0 deletions spec/scss_lint/linter/name_format_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
it { should report_lint line: 1 }
end

context 'when a function contains variables with capital letters' do
let(:scss) { <<-SCSS }
p {
content: good-function($badVariable);
}
SCSS

it { should report_lint line: 2 }
end

context 'when a mixin is declared with a capital letter' do
let(:scss) { <<-SCSS }
@mixin badMixin() {
Expand Down

0 comments on commit f8a92f9

Please sign in to comment.