Skip to content

Commit cc101a6

Browse files
committed
Fix SpaceAfterComment to not report file-level annotations
Fixes #922
1 parent a3586f3 commit cc101a6

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

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

89
## 0.55.0
910

lib/scss_lint/linter/space_after_comment.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def check_for_space(node_or_line, spaces)
5858
def whitespace_after_comment(source, offset)
5959
whitespace = 0
6060

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

6464
while [' ', "\t"].include? source[offset]
6565
whitespace += 1

spec/scss_lint/linter/space_after_comment_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
it { should_not report_lint }
4747
end
4848

49+
context 'when silent four-slash comment' do
50+
let(:scss) { <<-SCSS }
51+
//// File-level annotations
52+
SCSS
53+
54+
it { should_not report_lint }
55+
end
56+
4957
context 'when inline silent comment and no space' do
5058
let(:scss) { <<-SCSS }
5159
p {

0 commit comments

Comments
 (0)