From cd5a0fcfe9b810ee87deed5f8fb9f08617eddda0 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 | 6 ++++++ 5 files changed, 13 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..1fdde33 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)) } @@ -130,6 +133,9 @@ func HoldsLocally[T Testable](k int, handle string, constraint T, tr Trace) erro return nil } +// String generates a human-readble string. +// +//nolint:revive func (p *RowConstraint[T]) String() string { if p.Domain == nil { return fmt.Sprintf("(vanish %s %s)", p.Handle, any(p.Constraint))