Skip to content

Commit b039cf1

Browse files
committed
Run gofumpt -l -w ., remove vet and lint check in GitHub action
1 parent ecf3c70 commit b039cf1

File tree

7 files changed

+11
-25
lines changed

7 files changed

+11
-25
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ jobs:
3333
if: matrix.os != 'windows-latest'
3434
run: "diff <(gofmt -d .) <(printf '')"
3535
shell: bash
36-
- name: Vet
37-
run: go vet ./...
3836
- name: Staticcheck
3937
run: staticcheck ./...
40-
- name: Lint
41-
run: golint ./...
4238
- name: Test
4339
run: go test -race ./libsass -coverprofile=coverage.txt -covermode=atomic
4440
- name: Upload coverage

gen/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ func main() {
5959
if err := ioutil.WriteFile(target, []byte(fmt.Sprintf(`#ifndef USE_LIBSASS_SRC
6060
#include "../../libsass_src/src/%s"
6161
#endif
62-
`, fi.Name())), 0644); err != nil {
62+
`, fi.Name())), 0o644); err != nil {
6363
log.Fatal(err)
6464
}
6565
}
66-
6766
}

internal/libsass/a__cgo_dev.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
55
//
6+
//go:build dev
67
// +build dev
78

89
package libsass

internal/libsass/a__importer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package libsass
1919
// return BridgeImport(currPath, prev_path, ci);
2020
// }
2121
import "C"
22+
2223
import (
2324
"sync"
2425
"unsafe"
@@ -37,7 +38,7 @@ var importsStore = &idMap{
3738
func AddImportResolver(opts SassOptions, resolver ImportResolver) int {
3839
i := importsStore.Set(resolver)
3940
// This looks unsafe, but LibSass is using void* to store an int.
40-
// TODO(bep) this prevents us from "fail on go vet errors" in Travis.
41+
// TODO(bep) this prevents us from "fail on go vet errors" in GitHub action.
4142
id := unsafe.Pointer(uintptr(i))
4243

4344
importers := C.sass_make_importer_list(1)

internal/libsass/a__libsass.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package libsass
99
// #include "sass/context.h"
1010
// #include "sass2scss.h"
1111
import "C"
12+
1213
import (
1314
"reflect"
1415
"unsafe"
@@ -85,7 +86,6 @@ func SassContextGetSourceMapString(ctx SassContext) string {
8586
// SassDataContextGetContext function as declared in sass/context.h:61
8687
func SassDataContextGetContext(ctx SassDataContext) SassContext {
8788
return (SassContext)(C.sass_data_context_get_context(ctx))
88-
8989
}
9090

9191
// SassDataContextGetOptions function as declared in sass/context.h:66
@@ -172,7 +172,6 @@ func SassOptionSetPrecision(o SassOptions, i int) {
172172
// SassOptionSetSourceComments function as declared in sass/context.h:93
173173
func SassOptionSetSourceComments(o SassOptions, b bool) {
174174
C.sass_option_set_source_comments(o, C.bool(b))
175-
176175
}
177176

178177
// SassOptionSetSourceMapContents function as declared in sass/context.h:95
@@ -192,7 +191,6 @@ func SassOptionSetSourceMapFile(o SassOptions, s string) {
192191
// SassOptionSetSourceMapRoot function as declared in sass/context.h:106
193192
func SassOptionSetSourceMapRoot(o SassOptions, s string) {
194193
C.sass_option_set_source_map_root(o, C.CString(s))
195-
196194
}
197195

198196
// SassToScss converts Sass to Scss using sass2scss.
@@ -206,5 +204,4 @@ func SassToScss(src string) string {
206204
)
207205

208206
return C.GoString(chars)
209-
210207
}

libsass/example_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ body {
2727
color: $primary-color;
2828
}
2929
`)
30-
3130
if err != nil {
3231
log.Fatal(err)
3332
}

libsass/transpiler_test.go

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func TestTranspiler(t *testing.T) {
7373
c.Assert(err, qt.IsNil)
7474
c.Assert(result.CSS, qt.Equals, test.expect)
7575
}
76-
7776
})
7877

7978
}
@@ -94,7 +93,6 @@ func TestError(t *testing.T) {
9493
}
9594

9695
func TestSourceMapSettings(t *testing.T) {
97-
9896
c := qt.New(t)
9997
src := `div { p { color: blue; } }`
10098

@@ -132,11 +130,11 @@ func TestIncludePaths(t *testing.T) {
132130

133131
ioutil.WriteFile(colors, []byte(`
134132
$moo: #f442d1 !default;
135-
`), 0644)
133+
`), 0o644)
136134

137135
ioutil.WriteFile(content, []byte(`
138136
content { color: #ccc; }
139-
`), 0644)
137+
`), 0o644)
140138

141139
c := qt.New(t)
142140
src := `
@@ -157,11 +155,9 @@ div { p { color: $moo; } }`
157155
result, err := transpiler.Execute(src)
158156
c.Assert(err, qt.IsNil)
159157
c.Assert(result.CSS, qt.Equals, "content{color:#ccc}div p{color:#f442d1}\n")
160-
161158
}
162159

163160
func TestConcurrentTranspile(t *testing.T) {
164-
165161
c := qt.New(t)
166162

167163
importResolver := func(url string, prev string) (string, string, bool) {
@@ -170,7 +166,8 @@ func TestConcurrentTranspile(t *testing.T) {
170166

171167
transpiler, err := New(Options{
172168
OutputStyle: CompressedStyle,
173-
ImportResolver: importResolver})
169+
ImportResolver: importResolver,
170+
})
174171

175172
c.Assert(err, qt.IsNil)
176173

@@ -216,7 +213,8 @@ func TestImportResolverConcurrent(t *testing.T) {
216213
for j := 0; j < 100; j++ {
217214
transpiler, err := New(Options{
218215
OutputStyle: CompressedStyle,
219-
ImportResolver: createImportResolver(j)})
216+
ImportResolver: createImportResolver(j),
217+
})
220218
c.Check(err, qt.IsNil)
221219

222220
src := `
@@ -236,7 +234,6 @@ div { p { width: $width; } }`
236234
}()
237235
}
238236
wg.Wait()
239-
240237
}
241238

242239
func BenchmarkTranspile(b *testing.B) {
@@ -275,7 +272,6 @@ func BenchmarkTranspile(b *testing.B) {
275272
t.src = sassSample
276273
t.expect = sassSampleTranspiled
277274
runBench(b, t)
278-
279275
})
280276

281277
b.Run("SCSS Parallel", func(b *testing.B) {
@@ -306,9 +302,7 @@ $color: #333;
306302

307303
t.expect = ".content-navigation{border-color:#333}\n"
308304
runBench(b, t)
309-
310305
})
311-
312306
}
313307

314308
func TestParseOutputStyle(t *testing.T) {
@@ -319,5 +313,4 @@ func TestParseOutputStyle(t *testing.T) {
319313
c.Assert(ParseOutputStyle("compressed"), qt.Equals, CompressedStyle)
320314
c.Assert(ParseOutputStyle("EXPANDED"), qt.Equals, ExpandedStyle)
321315
c.Assert(ParseOutputStyle("foo"), qt.Equals, NestedStyle)
322-
323316
}

0 commit comments

Comments
 (0)