File tree Expand file tree Collapse file tree 6 files changed +88
-2
lines changed Expand file tree Collapse file tree 6 files changed +88
-2
lines changed Original file line number Diff line number Diff line change
1
+ use flake
Original file line number Diff line number Diff line change
1
+ tailwind-merge /
2
+ playground
3
+ .idea
4
+ .direnv
5
+ * .cov
6
+ * .out
Original file line number Diff line number Diff line change
1
+ assets/
2
+ *.md
3
+ docs/
Original file line number Diff line number Diff line change 1
-
1
+ test-watch :
2
+ @gotestsum --format=short-verbose --watch
2
3
3
4
test :
4
- go test -v -cover ./pkg/twmerge...
5
+ @gotestsum --format=short-verbose
6
+
7
+ test-cover :
8
+ @CGO_ENABLED=1 gotestsum -- -race -covermode=atomic -coverprofile=" profile.cov" ./... && go tool cover -func=profile.cov | grep -v " 100.0%"
9
+
10
+ lint :
11
+ @go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
Original file line number Diff line number Diff line change
1
+ {
2
+ description = "A Nix-flake-based Go 1.21 development environment" ;
3
+
4
+ inputs . nixpkgs . url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz" ;
5
+
6
+ outputs = { self , nixpkgs } :
7
+ let
8
+ goVersion = 21 ; # Change this to update the whole stack
9
+
10
+ supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ] ;
11
+ forEachSupportedSystem = f : nixpkgs . lib . genAttrs supportedSystems ( system : f {
12
+ pkgs = import nixpkgs {
13
+ inherit system ;
14
+ overlays = [ self . overlays . default ] ;
15
+ } ;
16
+ } ) ;
17
+ in
18
+ {
19
+ overlays . default = final : prev : {
20
+ go = final . "go_1_${ toString goVersion } " ;
21
+ } ;
22
+
23
+ devShells = forEachSupportedSystem ( { pkgs } : {
24
+ default = pkgs . mkShell {
25
+ packages = with pkgs ; [
26
+ # go (version is specified by overlay)
27
+ go
28
+
29
+ # goimports, godoc, etc.
30
+ gotools
31
+
32
+ # https://github.com/golangci/golangci-lint
33
+ golangci-lint
34
+
35
+ # Tests summaries
36
+ gotestsum
37
+ ] ;
38
+ shellHook = ''
39
+ export CGO_ENABLED="0" # disables cgo. Not sure why this fixes debugger on tests in vscode
40
+ '' ;
41
+ } ;
42
+ } ) ;
43
+ } ;
44
+ }
You can’t perform that action at this time.
0 commit comments