diff --git a/go/.golangci.yaml b/go/.golangci.yaml new file mode 100644 index 0000000..08bcb8f --- /dev/null +++ b/go/.golangci.yaml @@ -0,0 +1,76 @@ +linters-settings: + errcheck: + check-type-assertions: true + govet: + enable-all: true + +linters: + disable-all: true + enable: + # enabled by default + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + # disabled by default + - asasalint + - asciicheck + - bidichk + - bodyclose + - canonicalheader + - copyloopvar + - durationcheck + - errname + - errorlint + - exhaustive + - exptostd + - fatcontext + - gocheckcompilerdirectives + - gochecknoinits + - gochecksumtype + - goconst + - gocyclo + - godot + - goimports + - gomoddirectives + - goprintffuncname + - gosec + - iface + - intrange + - loggercheck + - makezero + - mirror + - musttag + - nakedret + - nestif + - nilerr + - nilnesserr + - nilnil + - noctx + - nolintlint + - nonamedreturns + - nosprintfhostport + - perfsprint + - predeclared + - promlinter + - protogetter + - reassign + - recvcheck + - revive + - sloglint + - spancheck + - sqlclosecheck + - stylecheck + - tenv + - testableexamples + - testifylint + - testpackage + - tparallel + - unconvert + - unparam + - usestdlibvars + - usetesting + - wastedassign + - whitespace diff --git a/go/cmd/snekcheck/errors.go b/go/cmd/snekcheck/errors.go index d277a8e..b6207da 100644 --- a/go/cmd/snekcheck/errors.go +++ b/go/cmd/snekcheck/errors.go @@ -2,15 +2,15 @@ package main // Common errors. var ( - invalidFileNamesErr = Error{Code: 1, Message: "invalid filenames found"} - noPathsProvidedErr = Error{Code: 2, Message: "no paths provided"} - failedToBuildFileTreeErr = Error{Code: 3, Message: "failed to build file tree"} + errInvalidFileNames = Error{Code: 1, Message: "invalid filenames found"} + errNoPathsProvided = Error{Code: 2, Message: "no paths provided"} + errFailedToBuildFileTree = Error{Code: 3, Message: "failed to build file tree"} ) // A command-line error. type Error struct { - Code uint8 Message string + Code uint8 } // Returns the error's status code. diff --git a/go/cmd/snekcheck/errors_test.go b/go/cmd/snekcheck/errors_test.go index f8ec1e9..ca9d9f4 100644 --- a/go/cmd/snekcheck/errors_test.go +++ b/go/cmd/snekcheck/errors_test.go @@ -12,7 +12,9 @@ import ( func TestError(t *testing.T) { t.Parallel() t.Run("Error()", func(t *testing.T) { + t.Parallel() t.Run("returns the correct error message", func(t *testing.T) { + t.Parallel() testCases := []string{ "an error occurred", "yikes!", @@ -23,6 +25,7 @@ func TestError(t *testing.T) { } }) t.Run("formats correctly as an error", func(t *testing.T) { + t.Parallel() testCases := []string{ "an error occurred", "yikes!", @@ -33,6 +36,7 @@ func TestError(t *testing.T) { } }) t.Run("can be wrapped and unwrapped", func(t *testing.T) { + t.Parallel() testCases := []string{ "an error occurred", "yikes!", @@ -45,7 +49,9 @@ func TestError(t *testing.T) { }) }) t.Run("ExitCode()", func(t *testing.T) { + t.Parallel() t.Run("produces the correct exit code", func(t *testing.T) { + t.Parallel() testCases := []uint8{ 0, 1, diff --git a/go/cmd/snekcheck/run.go b/go/cmd/snekcheck/run.go index d93f652..9b46c36 100644 --- a/go/cmd/snekcheck/run.go +++ b/go/cmd/snekcheck/run.go @@ -28,7 +28,7 @@ func Run(config Config) cli.Error { panic("invalid filesystem") } if len(config.Paths) == 0 { - return noPathsProvidedErr + return errNoPathsProvided } // Build file tree. @@ -38,7 +38,7 @@ func Run(config Config) cli.Error { }) for _, path := range config.Paths { if addPathWithChildren(fileTree, config.Fs, path, config.Depth) != nil { - return failedToBuildFileTreeErr + return errFailedToBuildFileTree } } @@ -124,7 +124,7 @@ func Run(config Config) cli.Error { // Terminate. if len(invalidPaths) != 0 { - return invalidFileNamesErr + return errInvalidFileNames } return nil } @@ -178,7 +178,7 @@ func addPathWithChildren(fileTree tree.UniqueNode[string], fs billy.Filesystem, return recurse(path, 0) } -// Parses gitignore patterns in a single directory +// Parses gitignore patterns in a single directory. func parseGitIgnorePatterns(fs billy.Filesystem, path files.Path) files.GitIgnore { patterns, ignoreErr := files.ParseGitIgnore(fs, path) if ignoreErr != nil { diff --git a/go/cmd/snekcheck/run_test.go b/go/cmd/snekcheck/run_test.go index 164f4b2..70f3450 100644 --- a/go/cmd/snekcheck/run_test.go +++ b/go/cmd/snekcheck/run_test.go @@ -9,8 +9,6 @@ import ( "github.com/go-git/go-billy/v5" "github.com/go-git/go-billy/v5/memfs" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) @@ -33,57 +31,57 @@ func (suite *RunTestSuite) SetupSubTest() { func (suite *RunTestSuite) TestRun() { suite.Run("Run()", func() { suite.Run("panics given an invalid file system", func() { - assert.Panics(suite.T(), func() { _ = main.Run(main.Config{Fs: nil}) }) + suite.Panics(func() { _ = main.Run(main.Config{Fs: nil}) }) }) suite.Run("returns an error when given no paths", func() { - assert.NotNil(suite.T(), main.Run(main.Config{Fs: memfs.New(), Paths: nil})) + suite.NotNil(main.Run(main.Config{Fs: memfs.New(), Paths: nil})) }) suite.Run("check", func() { suite.Run("succeeds with an empty directory", func() { config := main.Config{Depth: math.MaxUint, Fs: suite.Fs, Fix: false, Paths: []files.Path{suite.Root}, Verbose: false} - assert.Nil(suite.T(), main.Run(config)) + suite.Nil(main.Run(config)) }) suite.Run("succeeds with a single valid file", func() { validFilename := append(suite.Root, "valid") - require.True(suite.T(), main.IsValid(validFilename.Base())) + suite.Require().True(main.IsValid(validFilename.Base())) _, createErr := suite.Fs.Create(validFilename.String()) - require.Nil(suite.T(), createErr) + suite.Require().NoError(createErr) config := main.Config{Depth: math.MaxUint, Fs: suite.Fs, Fix: false, Paths: []files.Path{suite.Root}, Verbose: false} - assert.Nil(suite.T(), main.Run(config)) + suite.Nil(main.Run(config)) }) suite.Run("fails with a single invalid file", func() { invalidFilename := append(suite.Root, "InVaLiD") - require.False(suite.T(), main.IsValid(invalidFilename.Base())) + suite.Require().False(main.IsValid(invalidFilename.Base())) _, createErr := suite.Fs.Create(invalidFilename.String()) - require.Nil(suite.T(), createErr) + suite.Require().NoError(createErr) config := main.Config{Depth: math.MaxUint, Fs: suite.Fs, Fix: false, Paths: []files.Path{suite.Root}, Verbose: false} - assert.NotNil(suite.T(), main.Run(config)) + suite.NotNil(main.Run(config)) }) }) suite.Run("fix", func() { suite.Run("succeeds with an empty directory", func() { config := main.Config{Depth: math.MaxUint, Fs: suite.Fs, Fix: true, Paths: []files.Path{suite.Root}, Verbose: false} - assert.Nil(suite.T(), main.Run(config)) + suite.Nil(main.Run(config)) }) suite.Run("succeeds with a single valid file", func() { validFilename := append(suite.Root, "valid") - require.True(suite.T(), main.IsValid(validFilename.Base())) + suite.Require().True(main.IsValid(validFilename.Base())) _, createErr := suite.Fs.Create(validFilename.String()) - require.Nil(suite.T(), createErr) + suite.Require().NoError(createErr) config := main.Config{Depth: math.MaxUint, Fs: suite.Fs, Fix: true, Paths: []files.Path{suite.Root}, Verbose: false} - assert.Nil(suite.T(), main.Run(config)) + suite.Nil(main.Run(config)) }) suite.Run("succeeds with a single invalid file", func() { invalidFilename := append(suite.Root, "InVaLiD") - require.False(suite.T(), main.IsValid(invalidFilename.Base())) + suite.Require().False(main.IsValid(invalidFilename.Base())) _, createErr := suite.Fs.Create(invalidFilename.String()) - require.Nil(suite.T(), createErr) + suite.Require().NoError(createErr) config := main.Config{Depth: math.MaxUint, Fs: suite.Fs, Fix: true, Paths: []files.Path{suite.Root}, Verbose: false} - assert.Nil(suite.T(), main.Run(config)) + suite.Nil(main.Run(config)) }) }) }) diff --git a/go/cmd/snekcheck/validator_test.go b/go/cmd/snekcheck/validator_test.go index ff89642..593375e 100644 --- a/go/cmd/snekcheck/validator_test.go +++ b/go/cmd/snekcheck/validator_test.go @@ -10,6 +10,7 @@ import ( func TestIsValid(t *testing.T) { t.Parallel() t.Run("identifies valid file names", func(t *testing.T) { + t.Parallel() testCases := []string{ "main.go", "flake.nix", @@ -23,6 +24,7 @@ func TestIsValid(t *testing.T) { } }) t.Run("identifies invalid file names", func(t *testing.T) { + t.Parallel() testCases := []string{ "Snake", "snake case 123", diff --git a/go/internal/files/path_test.go b/go/internal/files/path_test.go index 7fd55f2..ba2204a 100644 --- a/go/internal/files/path_test.go +++ b/go/internal/files/path_test.go @@ -14,7 +14,9 @@ import ( func TestPath(t *testing.T) { t.Parallel() t.Run("NewPath()", func(t *testing.T) { + t.Parallel() t.Run("creates a path", func(t *testing.T) { + t.Parallel() testCases := []string{ "", "longstring", @@ -27,7 +29,9 @@ func TestPath(t *testing.T) { }) }) t.Run("Base()", func(t *testing.T) { + t.Parallel() t.Run("returns the last element", func(t *testing.T) { + t.Parallel() testCases := []files.Path{ {"dir", "dir", "file.txt"}, {"longstring"}, @@ -38,11 +42,14 @@ func TestPath(t *testing.T) { } }) t.Run("panics if the path is empty", func(t *testing.T) { + t.Parallel() assert.Panics(t, func() { files.Path{}.Base() }) }) }) t.Run("Parent()", func(t *testing.T) { + t.Parallel() t.Run("returns every element except the last element", func(t *testing.T) { + t.Parallel() testCases := []files.Path{ {"dir", "dir", "file.txt"}, {"longstring"}, @@ -53,11 +60,14 @@ func TestPath(t *testing.T) { } }) t.Run("panics if the path is empty", func(t *testing.T) { + t.Parallel() assert.Panics(t, func() { files.Path{}.Parent() }) }) }) t.Run("String()", func(t *testing.T) { + t.Parallel() t.Run("returns the full path", func(t *testing.T) { + t.Parallel() testCases := []files.Path{ {"dir", "dir", "file.txt"}, {"longstring"}, @@ -68,6 +78,7 @@ func TestPath(t *testing.T) { } }) t.Run("formats correctly as a string", func(t *testing.T) { + t.Parallel() testCases := []files.Path{ {"dir", "dir", "file.txt"}, {"longstring"}, diff --git a/go/internal/patterns/posix_test.go b/go/internal/patterns/posix_test.go index da33d7c..18e623d 100644 --- a/go/internal/patterns/posix_test.go +++ b/go/internal/patterns/posix_test.go @@ -10,12 +10,12 @@ import ( func BenchmarkPosix(b *testing.B) { b.Run("IsPosixFileName()", func(b *testing.B) { - for i := 0; i < b.N; i++ { + for range b.N { patterns.IsPosixFileName("Bench mark") } }) b.Run("ToPosixFileName()", func(b *testing.B) { - for i := 0; i < b.N; i++ { + for range b.N { patterns.ToPosixFileName("Bench mark") } }) @@ -34,7 +34,9 @@ func FuzzPosix(f *testing.F) { func TestPosix(t *testing.T) { t.Parallel() t.Run("IsPosixFileName()", func(t *testing.T) { + t.Parallel() t.Run("identifies valid POSIX filenames", func(t *testing.T) { + t.Parallel() testCases := []string{ "posix", "POSIX_FILE", @@ -47,6 +49,7 @@ func TestPosix(t *testing.T) { } }) t.Run("identifies invalid POSIX filenames", func(t *testing.T) { + t.Parallel() testCases := []string{ "-TEST", "lol@email", @@ -59,7 +62,9 @@ func TestPosix(t *testing.T) { }) }) t.Run("ToPosixFileName()", func(t *testing.T) { + t.Parallel() t.Run("does not change valid POSIX filenames", func(t *testing.T) { + t.Parallel() testCases := []string{ "POSIX", ".POSIX_123_.md", @@ -71,6 +76,7 @@ func TestPosix(t *testing.T) { } }) t.Run("converts invalid POSIX filenames to valid POSIX filenames", func(t *testing.T) { + t.Parallel() testCases := []struct { input string output string diff --git a/go/internal/patterns/screaming_snake_test.go b/go/internal/patterns/screaming_snake_test.go index 52e5647..9f0b958 100644 --- a/go/internal/patterns/screaming_snake_test.go +++ b/go/internal/patterns/screaming_snake_test.go @@ -10,12 +10,12 @@ import ( func BenchmarkScreamingSnakeCase(b *testing.B) { b.Run("IsScreamingSnakeCase()", func(b *testing.B) { - for i := 0; i < b.N; i++ { + for range b.N { patterns.IsScreamingSnakeCase("Bench mark") } }) b.Run("ToScreamingSnakeCase()", func(b *testing.B) { - for i := 0; i < b.N; i++ { + for range b.N { patterns.ToScreamingSnakeCase("Bench mark") } }) @@ -34,7 +34,9 @@ func FuzzScreamingSnakeCase(f *testing.F) { func TestScreamingSnakeCase(t *testing.T) { t.Parallel() t.Run("IsScreamingSnakeCase()", func(t *testing.T) { + t.Parallel() t.Run("identifies valid screaming snake case", func(t *testing.T) { + t.Parallel() testCases := []string{ "", "__", @@ -48,6 +50,7 @@ func TestScreamingSnakeCase(t *testing.T) { } }) t.Run("identifies invalid screaming snake case", func(t *testing.T) { + t.Parallel() testCases := []string{ "Snake", "snake case 123", @@ -60,7 +63,9 @@ func TestScreamingSnakeCase(t *testing.T) { }) }) t.Run("ToScreamingSnakeCase()", func(t *testing.T) { + t.Parallel() t.Run("does not change valid screaming snake case", func(t *testing.T) { + t.Parallel() testCases := []string{ "", "__", @@ -74,6 +79,7 @@ func TestScreamingSnakeCase(t *testing.T) { } }) t.Run("converts invalid screaming snake case to valid screaming snake case", func(t *testing.T) { + t.Parallel() testCases := []struct { input string output string diff --git a/go/internal/patterns/snake_test.go b/go/internal/patterns/snake_test.go index c153b6b..39ba36f 100644 --- a/go/internal/patterns/snake_test.go +++ b/go/internal/patterns/snake_test.go @@ -10,12 +10,12 @@ import ( func BenchmarkSnakeCase(b *testing.B) { b.Run("IsSnakeCase()", func(b *testing.B) { - for i := 0; i < b.N; i++ { + for range b.N { patterns.IsSnakeCase("Bench mark") } }) b.Run("ToSnakeCase()", func(b *testing.B) { - for i := 0; i < b.N; i++ { + for range b.N { patterns.ToSnakeCase("Bench mark") } }) @@ -34,7 +34,9 @@ func FuzzSnakeCase(f *testing.F) { func TestSnakeCase(t *testing.T) { t.Parallel() t.Run("IsSnakeCase()", func(t *testing.T) { + t.Parallel() t.Run("identifies valid snake case", func(t *testing.T) { + t.Parallel() testCases := []string{ "", "__", @@ -48,6 +50,7 @@ func TestSnakeCase(t *testing.T) { } }) t.Run("identifies invalid snake case", func(t *testing.T) { + t.Parallel() testCases := []string{ "Snake", "snake case 123", @@ -60,7 +63,9 @@ func TestSnakeCase(t *testing.T) { }) }) t.Run("ToSnakeCase()", func(t *testing.T) { + t.Parallel() t.Run("does not change valid snake case", func(t *testing.T) { + t.Parallel() testCases := []string{ "", "__", @@ -74,6 +79,7 @@ func TestSnakeCase(t *testing.T) { } }) t.Run("converts invalid snake case to valid snake case", func(t *testing.T) { + t.Parallel() testCases := []struct { input string output string diff --git a/go/internal/tree/unique_test.go b/go/internal/tree/unique_test.go index fe4b47d..4dcb70b 100644 --- a/go/internal/tree/unique_test.go +++ b/go/internal/tree/unique_test.go @@ -11,12 +11,16 @@ import ( func TestUniqueTree(t *testing.T) { t.Parallel() t.Run("NewUniqueTree()", func(t *testing.T) { + t.Parallel() t.Run("creates a tree", func(t *testing.T) { + t.Parallel() assert.NotNil(t, tree.NewUniqueTree[string]()) }) }) t.Run("AddPath()", func(t *testing.T) { + t.Parallel() t.Run("creates a full path of nodes", func(t *testing.T) { + t.Parallel() testCases := [][]string{ {"a"}, {"a", "b", "c"}, @@ -37,7 +41,9 @@ func TestUniqueTree(t *testing.T) { }) }) t.Run("FindByPath()", func(t *testing.T) { + t.Parallel() t.Run("finds the node at the end of a path", func(t *testing.T) { + t.Parallel() testCases := [][]string{ {"a"}, {"a", "b", "c"}, @@ -53,6 +59,7 @@ func TestUniqueTree(t *testing.T) { } }) t.Run("returns nil for an invalid path", func(t *testing.T) { + t.Parallel() testCases := [][]string{ {"a"}, {"a", "b", "c"}, @@ -67,7 +74,9 @@ func TestUniqueTree(t *testing.T) { }) }) t.Run("IterPreOrder()", func(t *testing.T) { + t.Parallel() t.Run("yields every node", func(t *testing.T) { + t.Parallel() testCases := [][]string{ {"a", "b", "c"}, {"a", "d", "e"}, @@ -90,6 +99,7 @@ func TestUniqueTree(t *testing.T) { } }) t.Run("yields parent nodes before their children", func(t *testing.T) { + t.Parallel() testCases := [][]string{ {"a", "b", "c"}, {"a", "d", "e"}, @@ -115,6 +125,7 @@ func TestUniqueTree(t *testing.T) { } }) t.Run("can break out of iteration", func(t *testing.T) { + t.Parallel() testCases := [][]string{ {"a", "b", "c"}, {"a", "d", "e"}, diff --git a/nix/default.nix b/nix/default.nix index 59882d6..e1389b8 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,8 +1,10 @@ {inputs, ...}: { imports = [ ./devenv.nix - ./formatter.nix ./package.nix ]; + perSystem = {pkgs, ...}: { + formatter = pkgs.alejandra; + }; systems = inputs.nixpkgs.lib.systems.flakeExposed; } diff --git a/nix/devenv.nix b/nix/devenv.nix index 6f9b356..03181f8 100644 --- a/nix/devenv.nix +++ b/nix/devenv.nix @@ -21,15 +21,22 @@ buildInputs = config.packages.snekcheck.nativeBuildInputs; goPkg = lib.findFirst (pkg: builtins.match "go" pkg.pname != null) pkgs.go buildInputs; in { - enterShell = '' - printf " ▄▄▄▄▄ ▄ ▄███▄ █ █▀ ▄█▄ ▄ █ ▄███▄ ▄█▄ █ █▀ - █ ▀▄ █ █▀ ▀ █▄█ █▀ ▀▄ █ █ █▀ ▀ █▀ ▀▄ █▄█ - ▄ ▀▀▀▀▄ ██ █ ██▄▄ █▀▄ █ ▀ ██▀▀█ ██▄▄ █ ▀ █▀▄ - ▀▄▄▄▄▀ █ █ █ █▄ ▄▀ █ █ █▄ ▄▀ █ █ █▄ ▄▀ █▄ ▄▀ █ █ - █ █ █ ▀███▀ █ ▀███▀ █ ▀███▀ ▀███▀ █ - █ ██ ▀ ▀ ▀\n" | ${pkgs.lolcat}/bin/lolcat - printf "\033[0;1;36mDEVSHELL ACTIVATED\033[0m\n" - ''; + enterShell = "${pkgs.writeShellApplication { + name = "splashScreen"; + runtimeInputs = [ + pkgs.lolcat + pkgs.uutils-coreutils-noprefix + ]; + text = '' + printf " ▄▄▄▄▄ ▄ ▄███▄ █ █▀ ▄█▄ ▄ █ ▄███▄ ▄█▄ █ █▀ + █ ▀▄ █ █▀ ▀ █▄█ █▀ ▀▄ █ █ █▀ ▀ █▀ ▀▄ █▄█ + ▄ ▀▀▀▀▄ ██ █ ██▄▄ █▀▄ █ ▀ ██▀▀█ ██▄▄ █ ▀ █▀▄ + ▀▄▄▄▄▀ █ █ █ █▄ ▄▀ █ █ █▄ ▄▀ █ █ █▄ ▄▀ █▄ ▄▀ █ █ + █ █ █ ▀███▀ █ ▀███▀ █ ▀███▀ ▀███▀ █ + █ ██ ▀ ▀ ▀\n" | lolcat + printf "\033[0;1;36mDEVSHELL ACTIVATED\033[0m\n" + ''; + }}/bin/splashScreen"; env = let PROJECT_ROOT = config.devenv.shells.default.env.DEVENV_ROOT; @@ -53,7 +60,6 @@ default_stages = ["pre-push"]; hooks = { actionlint.enable = true; - alejandra.enable = true; check-added-large-files = { enable = true; stages = ["pre-commit"]; @@ -83,11 +89,6 @@ enable = true; stages = ["pre-commit"]; }; - snekcheck = { - enable = true; - entry = "${self.packages.${system}.snekcheck}/bin/snekcheck"; - name = "snekcheck"; - }; statix.enable = true; }; }; @@ -102,12 +103,17 @@ }; build = { description = "Builds the project binary."; - exec = '' - (cd "$GO_ROOT" && \ - ${goPkg}/bin/go mod tidy && \ - ${inputs.gomod2nix.legacyPackages.${system}.gomod2nix}/bin/gomod2nix) && \ - nix build "$PROJECT_ROOT"#snekcheck - ''; + exec = "${pkgs.writeShellApplication { + name = "build"; + runtimeInputs = [ + goPkg + inputs.gomod2nix.legacyPackages.${system}.gomod2nix + ]; + text = '' + (cd "$GO_ROOT" && go mod tidy && gomod2nix) && \ + nix build "$PROJECT_ROOT"#snekcheck + ''; + }}/bin/build"; }; demo = { description = "Generates a demo GIF."; @@ -133,20 +139,27 @@ }; lint = { description = "Lints the project."; - exec = '' - ${self.packages.${system}.snekcheck}/bin/snekcheck --fix "$PROJECT_ROOT" && \ - nix fmt "$PROJECT_ROOT" -- --quiet && \ - (cd "$GO_ROOT" && \ - ${goPkg}/bin/go mod tidy && \ - ${goPkg}/bin/go fmt ./... && \ - ${goPkg}/bin/go vet ./... && \ - ${pkgs.golangci-lint}/bin/golangci-lint run ./...) - ''; + exec = "${pkgs.writeShellApplication { + name = "lint"; + runtimeInputs = [ + goPkg + pkgs.golangci-lint + self.packages.${system}.snekcheck + ]; + text = '' + snekcheck --fix "$PROJECT_ROOT" && \ + nix fmt "$PROJECT_ROOT" -- --quiet && \ + (cd "$GO_ROOT" && go mod tidy && go fmt ./... && go vet ./... && \ + golangci-lint run ./...) + ''; + }}/bin/lint"; }; run = { description = "Runs the project."; exec = '' - ${inputs.gomod2nix.legacyPackages.${system}.gomod2nix}/bin/gomod2nix && \ + (cd "$GO_ROOT" && \ + ${goPkg}/bin/go mod tidy && \ + ${inputs.gomod2nix.legacyPackages.${system}.gomod2nix}/bin/gomod2nix) && \ nix run "$PROJECT_ROOT"#snekcheck -- "$@" ''; }; diff --git a/nix/formatter.nix b/nix/formatter.nix deleted file mode 100644 index 84c51af..0000000 --- a/nix/formatter.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - perSystem = {pkgs, ...}: { - formatter = pkgs.alejandra; - }; -} diff --git a/nix/package.nix b/nix/package.nix index e13a3aa..6803e41 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -7,9 +7,7 @@ version = "0.0"; }; in { - apps.snekcheck = { - program = "${pkg}/bin/snekcheck"; - }; + apps.snekcheck.program = "${pkg}/bin/snekcheck"; packages.snekcheck = pkg; }; }