diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 670b22b..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - feature - - bug - - enhancement -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d6ba87..df7b8b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: mkdir -p ui/dist/img touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png - uses: golangci/golangci-lint-action@v3 + with: { version: 'v1.52' } test: name: Test diff --git a/.golangci.yml b/.golangci.yml index c1aab84..af55c11 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -118,4 +118,6 @@ issues: - path: caql linters: [ forcetypeassert ] - text: github.com/go-chi/chi/v5.Router - linters: [ ireturn ] \ No newline at end of file + linters: [ ireturn ] + - path: ui/ui.go + linters: [ typecheck ] diff --git a/auth.go b/auth.go index 2b7e018..0b3b8f8 100644 --- a/auth.go +++ b/auth.go @@ -82,7 +82,7 @@ func (c *catalystResolver) UserByIDAndPassword(ctx context.Context, username str return mapMautUser(user), nil } -func (c *catalystResolver) Role(ctx context.Context, roleID string) (r *maut.Role, err error) { +func (c *catalystResolver) Role(_ context.Context, roleID string) (r *maut.Role, err error) { switch roleID { case "admin": return Admin, nil diff --git a/backup.go b/backup.go index 9126db1..980f98d 100644 --- a/backup.go +++ b/backup.go @@ -33,7 +33,7 @@ type WriterAtBuffer struct { bytes.Buffer } -func (fw WriterAtBuffer) WriteAt(p []byte, offset int64) (n int, err error) { +func (fw WriterAtBuffer) WriteAt(p []byte, _ int64) (n int, err error) { return fw.Write(p) } diff --git a/busservice/docker.go b/busservice/docker.go index 66d50f7..f7c4ec0 100644 --- a/busservice/docker.go +++ b/busservice/docker.go @@ -79,11 +79,7 @@ func copyFile(ctx context.Context, cli *client.Client, path string, contentStrin return err } - if err := cli.CopyToContainer(ctx, id, "/", tarBuf, types.CopyToContainerOptions{}); err != nil { - return err - } - - return nil + return cli.CopyToContainer(ctx, id, "/", tarBuf, types.CopyToContainerOptions{}) } func runDocker(ctx context.Context, jobID, containerID string, db *database.Database) (stdout []byte, stderr []byte, err error) { diff --git a/caql/builder.go b/caql/builder.go index fb91f76..62de3b7 100644 --- a/caql/builder.go +++ b/caql/builder.go @@ -238,7 +238,7 @@ func (s *aqlBuilder) ExitReference(ctx *parser.ReferenceContext) { } // ExitCompound_value is called when production compound_value is exited. -func (s *aqlBuilder) ExitCompound_value(ctx *parser.Compound_valueContext) { +func (s *aqlBuilder) ExitCompound_value(_ *parser.Compound_valueContext) { // pass } diff --git a/caql/interpreter.go b/caql/interpreter.go index 7629d7e..73749c0 100644 --- a/caql/interpreter.go +++ b/caql/interpreter.go @@ -181,7 +181,7 @@ func (s *aqlInterpreter) ExitReference(ctx *parser.ReferenceContext) { } // ExitCompound_value is called when production compound_value is exited. -func (s *aqlInterpreter) ExitCompound_value(ctx *parser.Compound_valueContext) { +func (s *aqlInterpreter) ExitCompound_value(_ *parser.Compound_valueContext) { // pass } diff --git a/caql/parser.go b/caql/parser.go index e4a7d54..a2ec209 100644 --- a/caql/parser.go +++ b/caql/parser.go @@ -104,18 +104,18 @@ type errorListener struct { errs []error } -func (el *errorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol any, line, column int, msg string, e antlr.RecognitionException) { +func (el *errorListener) SyntaxError(_ antlr.Recognizer, _ any, line, column int, msg string, _ antlr.RecognitionException) { el.errs = append(el.errs, fmt.Errorf("line "+strconv.Itoa(line)+":"+strconv.Itoa(column)+" "+msg)) } -func (el *errorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs antlr.ATNConfigSet) { +func (el *errorListener) ReportAmbiguity(_ antlr.Parser, _ *antlr.DFA, _, _ int, _ bool, _ *antlr.BitSet, _ antlr.ATNConfigSet) { el.errs = append(el.errs, errors.New("ReportAmbiguity")) } -func (el *errorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet) { +func (el *errorListener) ReportAttemptingFullContext(_ antlr.Parser, _ *antlr.DFA, _, _ int, _ *antlr.BitSet, _ antlr.ATNConfigSet) { el.errs = append(el.errs, errors.New("ReportAttemptingFullContext")) } -func (el *errorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet) { +func (el *errorListener) ReportContextSensitivity(_ antlr.Parser, _ *antlr.DFA, _, _, _ int, _ antlr.ATNConfigSet) { el.errs = append(el.errs, errors.New("ReportContextSensitivity")) } diff --git a/database/busdb/busdb.go b/database/busdb/busdb.go index df36e59..9dd8a9c 100644 --- a/database/busdb/busdb.go +++ b/database/busdb/busdb.go @@ -82,7 +82,7 @@ func NewCollection[T any](internal driver.Collection, db *BusDatabase) *Collecti return &Collection[T]{internal: internal, db: db} } -func (c *Collection[T]) CreateDocument(ctx, newctx context.Context, key string, document *T) (meta driver.DocumentMeta, err error) { +func (c *Collection[T]) CreateDocument(_, newctx context.Context, key string, document *T) (meta driver.DocumentMeta, err error) { defer func() { err = toHTTPErr(err) }() meta, err = c.internal.CreateDocument(newctx, &Keyed[T]{Key: key, Doc: document}) @@ -95,7 +95,7 @@ func (c *Collection[T]) CreateDocument(ctx, newctx context.Context, key string, return meta, nil } -func (c *Collection[T]) CreateEdge(ctx, newctx context.Context, edge *driver.EdgeDocument) (meta driver.DocumentMeta, err error) { +func (c *Collection[T]) CreateEdge(_, newctx context.Context, edge *driver.EdgeDocument) (meta driver.DocumentMeta, err error) { defer func() { err = toHTTPErr(err) }() meta, err = c.internal.CreateDocument(newctx, edge) diff --git a/test/test.go b/test/test.go index f7913fc..197cf10 100644 --- a/test/test.go +++ b/test/test.go @@ -30,7 +30,7 @@ func Context() context.Context { return maut.UserContext(context.Background(), Bob, nil) // TODO add permissions ? } -func Config(ctx context.Context) (*catalyst.Config, error) { +func Config(_ context.Context) (*catalyst.Config, error) { config := &catalyst.Config{ IndexPath: "index.bleve", Network: "catalyst",