Skip to content

Commit

Permalink
Fix SpaceAfterComment to not report file-level annotations
Browse files Browse the repository at this point in the history
Fixes sds#922
  • Loading branch information
sds committed Nov 5, 2017
1 parent a3586f3 commit cc101a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Add support for Sass 3.5. [Custom properties are not yet supported](https://github.com/brigade/scss-lint/pull/927).
* Modify all output formats to include a linter even for syntax or encoding errors
* Fix `SpaceAfterComment` to not report lints for [file-level annotation comments](http://sassdoc.com/file-level-annotations/)

## 0.55.0

Expand Down
4 changes: 2 additions & 2 deletions lib/scss_lint/linter/space_after_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def check_for_space(node_or_line, spaces)
def whitespace_after_comment(source, offset)
whitespace = 0

# Allow for comments that start with `/// `.
offset += 1 if source[offset] == '/'
offset += 1 if source[offset] == '/' # Allow for triple-slash comments
offset += 1 if source[offset] == '/' # Allow for quadruple-slash comments

while [' ', "\t"].include? source[offset]
whitespace += 1
Expand Down
8 changes: 8 additions & 0 deletions spec/scss_lint/linter/space_after_comment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
it { should_not report_lint }
end

context 'when silent four-slash comment' do
let(:scss) { <<-SCSS }
//// File-level annotations
SCSS

it { should_not report_lint }
end

context 'when inline silent comment and no space' do
let(:scss) { <<-SCSS }
p {
Expand Down

0 comments on commit cc101a6

Please sign in to comment.