Skip to content

Commit e2ec6d0

Browse files
committed
Adding support for SCSS and Sass files.
1 parent df58aca commit e2ec6d0

File tree

5 files changed

+57
-1
lines changed

5 files changed

+57
-1
lines changed

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func licenseHeader(path string, tmpl *template.Template, data *copyrightData) ([
207207
return nil, nil
208208
case ".c", ".h":
209209
lic, err = prefix(tmpl, data, "/*", " * ", " */")
210-
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".tf", ".ts":
210+
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".tf", ".ts":
211211
lic, err = prefix(tmpl, data, "/**", " * ", " */")
212212
case ".cc", ".cpp", ".cs", ".go", ".hh", ".hpp", ".java", ".m", ".mm", ".proto", ".rs", ".scala", ".swift", ".dart", ".groovy", ".kt", ".kts":
213213
lic, err = prefix(tmpl, data, "", "// ", "")

testdata/expected/file.sass

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright 2018 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
$font-stack: Helvetica, sans-serif
18+
$primary-color: #333
19+
20+
body
21+
font: 100% $font-stack
22+
color: $primary-color

testdata/expected/file.scss

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright 2018 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
.div {
18+
color: red;
19+
.child{
20+
color: green;
21+
}
22+
}

testdata/initial/file.sass

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$font-stack: Helvetica, sans-serif
2+
$primary-color: #333
3+
4+
body
5+
font: 100% $font-stack
6+
color: $primary-color

testdata/initial/file.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.div {
2+
color: red;
3+
.child{
4+
color: green;
5+
}
6+
}

0 commit comments

Comments
 (0)