Skip to content

Commit 6f4cd4a

Browse files
authored
Merge pull request #42 from tpryan/master
Adding support for SCSS and Sass files.
2 parents 38d99b7 + e2ec6d0 commit 6f4cd4a

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
@@ -215,7 +215,7 @@ func licenseHeader(path string, tmpl *template.Template, data *copyrightData) ([
215215
return nil, nil
216216
case ".c", ".h", ".gv":
217217
lic, err = prefix(tmpl, data, "/*", " * ", " */")
218-
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".tf", ".ts":
218+
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".tf", ".ts":
219219
lic, err = prefix(tmpl, data, "/**", " * ", " */")
220220
case ".cc", ".cpp", ".cs", ".go", ".hh", ".hpp", ".java", ".m", ".mm", ".proto", ".rs", ".scala", ".swift", ".dart", ".groovy", ".kt", ".kts", ".v", ".sv":
221221
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)