From 29688b45de0a3c9272e3e708f0fd276ef63f88a6 Mon Sep 17 00:00:00 2001 From: DavePearce Date: Thu, 13 Jun 2024 12:36:08 +1200 Subject: [PATCH] Correct linting errors. --- Makefile | 2 +- pkg/air/expr.go | 2 +- pkg/air/gadgets/normalisation.go | 8 ++++---- pkg/table/column.go | 1 + pkg/table/constraints.go | 3 +++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e213aae..ae054f8 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ all: clean lint test build .PHONY: lint lint: @echo ">>> Performing golang code linting.." - golangci-lint run + golangci-lint run --config=.golangci.yml .PHONY: test test: diff --git a/pkg/air/expr.go b/pkg/air/expr.go index 7aaa887..8675f60 100644 --- a/pkg/air/expr.go +++ b/pkg/air/expr.go @@ -83,7 +83,7 @@ func (p *Mul) Equate(other Expr) Expr { return &Sub{Args: []Expr{p, other}} } // Constant represents a constant value within an expression. type Constant struct{ Value *fr.Element } -// NewConstant construct an AIR expression representing a given constant. +// NewConst construct an AIR expression representing a given constant. func NewConst(val *fr.Element) Expr { return &Constant{val} } diff --git a/pkg/air/gadgets/normalisation.go b/pkg/air/gadgets/normalisation.go index 34a909b..038cdbe 100644 --- a/pkg/air/gadgets/normalisation.go +++ b/pkg/air/gadgets/normalisation.go @@ -8,10 +8,10 @@ import ( "github.com/consensys/go-corset/pkg/table" ) -// Norm constructs an expression representing the normalised value of e. That is, -// an expression which is 0 when e is 0, and 1 when e is non-zero. This is done -// by introducing a synthetic column to hold the (pseudo) mutliplicative inverse -// of e. +// Normalise constructs an expression representing the normalised value of e. +// That is, an expression which is 0 when e is 0, and 1 when e is non-zero. +// This is done by introducing a synthetic column to hold the (pseudo) +// mutliplicative inverse of e. func Normalise(e air.Expr, tbl *air.Schema) air.Expr { // Construct pseudo multiplicative inverse of e. ie := ApplyPseudoInverseGadget(e, tbl) diff --git a/pkg/table/column.go b/pkg/table/column.go index d9a0671..03d86c8 100644 --- a/pkg/table/column.go +++ b/pkg/table/column.go @@ -55,6 +55,7 @@ func (c *DataColumn[T]) Accepts(tr Trace) error { return nil } +//nolint:revive func (c *DataColumn[T]) String() string { if c.Type.AsField() != nil { return fmt.Sprintf("(column %s)", c.Name) diff --git a/pkg/table/constraints.go b/pkg/table/constraints.go index db3b4ae..d5877d1 100644 --- a/pkg/table/constraints.go +++ b/pkg/table/constraints.go @@ -54,6 +54,9 @@ func (p ZeroTest[E]) TestAt(row int, tr Trace) bool { return val == nil || val.IsZero() } +// String generates a human-readble string. +// +//nolint:revive func (p ZeroTest[E]) String() string { return fmt.Sprintf("%s", any(p.Expr)) }