Skip to content

Commit

Permalink
Merge pull request #439 from onflow/auto-update-onflow-cadence-v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent authored Oct 22, 2024
2 parents 8296eb6 + 4b03949 commit e126414
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 41 deletions.
6 changes: 3 additions & 3 deletions lint/analyzers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"

"github.com/onflow/cadence-tools/lint"
Expand Down Expand Up @@ -87,7 +87,7 @@ func testAnalyzersAdvanced(

var diagnostics []analysis.Diagnostic

programs[testLocation].Run(
programs.Get(testLocation).Run(
analyzers,
func(diagnostic analysis.Diagnostic) {
diagnostics = append(diagnostics, diagnostic)
Expand Down
6 changes: 3 additions & 3 deletions lint/cadence_v1_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package lint

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
8 changes: 4 additions & 4 deletions lint/cadence_v1_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"

"github.com/onflow/cadence-tools/lint"
Expand Down
2 changes: 1 addition & 1 deletion lint/deprecated_member_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"regexp"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
2 changes: 1 addition & 1 deletion lint/deprecated_member_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package lint_test
import (
"testing"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/tools/analysis"
"github.com/stretchr/testify/require"

Expand Down
4 changes: 2 additions & 2 deletions lint/diagnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package lint

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
6 changes: 3 additions & 3 deletions lint/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ toolchain go1.22.3

require (
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/onflow/cadence v1.0.0
github.com/onflow/flow-go-sdk v1.0.0
github.com/onflow/cadence v1.2.1
github.com/onflow/flow-go-sdk v1.2.2
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.63.2
)
Expand All @@ -29,7 +29,7 @@ require (
github.com/logrusorgru/aurora/v4 v4.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/onflow/atree v0.8.0-rc.6 // indirect
github.com/onflow/atree v0.8.0 // indirect
github.com/onflow/crypto v0.25.1 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.7 // indirect
github.com/onflow/go-ethereum v1.13.4 // indirect
Expand Down
12 changes: 6 additions & 6 deletions lint/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA=
github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo=
github.com/onflow/cadence v1.0.0 h1:bvT75F2LZJvDCBmmajAv7QLISK6Qp30FAKcSwqNNH+o=
github.com/onflow/cadence v1.0.0/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/atree v0.8.0 h1:qg5c6J1gVDNObughpEeWm8oxqhPGdEyGrda121GM4u0=
github.com/onflow/atree v0.8.0/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo=
github.com/onflow/cadence v1.2.1 h1:hmSsgX3rTsp2E5qTSl1JXINt8qepdRrHTwDSYqN5Nxs=
github.com/onflow/cadence v1.2.1/go.mod h1:fJxxOAp1wnWDfOHT8GOc1ypsU0RR5E3z51AhG8Yf5jg=
github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A=
github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/flow-go-sdk v1.0.0 h1:Ha4fQm1MMKsyaqMkQLCN3rA/yaQKG6DGwiIfx06j40c=
github.com/onflow/flow-go-sdk v1.0.0/go.mod h1:iZkW2IWieVUZKK06mQCxpjJzPDgS0VtGpTaP/rKu6J4=
github.com/onflow/flow-go-sdk v1.2.2 h1:F78Sq/VaExgtaQv739k06gnx2aIyLF5wVE0XwxFpmsc=
github.com/onflow/flow-go-sdk v1.2.2/go.mod h1:yhQ5+Sp2xWoCQ1fuRDswawTDQ0ng0z5nTkFVH82xL7E=
github.com/onflow/flow/protobuf/go/flow v0.4.7 h1:iP6DFx4wZ3ETORsyeqzHu7neFT3d1CXF6wdK+AOOjmc=
github.com/onflow/flow/protobuf/go/flow v0.4.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
github.com/onflow/go-ethereum v1.13.4 h1:iNO86fm8RbBbhZ87ZulblInqCdHnAQVY8okBrNsTevc=
Expand Down
11 changes: 7 additions & 4 deletions lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/pretty"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/pretty"
"github.com/onflow/cadence/tools/analysis"
"github.com/onflow/flow-go-sdk"
grpcAccess "github.com/onflow/flow-go-sdk/access/grpc"
Expand Down Expand Up @@ -285,7 +285,10 @@ func (l *Linter) analyze(
config *analysis.Config,
locations []common.Location,
) {
programs := make(analysis.Programs, len(locations))
programs := analysis.Programs{
Programs: make(map[common.Location]*analysis.Program, len(locations)),
// TODO: crypto contract elaboration
}

log.Println("Loading ...")

Expand Down Expand Up @@ -320,7 +323,7 @@ func (l *Linter) analyze(
analyzers := l.Config.Analyzers
if len(analyzers) > 0 {
for _, location := range locations {
program := programs[location]
program := programs.Get(location)
if program == nil {
continue
}
Expand Down
6 changes: 3 additions & 3 deletions lint/number_function_argument_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package lint

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
2 changes: 1 addition & 1 deletion lint/number_function_argument_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package lint_test
import (
"testing"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/tools/analysis"
"github.com/stretchr/testify/require"

Expand Down
6 changes: 3 additions & 3 deletions lint/redundant_cast_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ package lint
import (
"fmt"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
2 changes: 1 addition & 1 deletion lint/redundant_cast_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package lint_test
import (
"testing"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/tools/analysis"
"github.com/stretchr/testify/require"

Expand Down
4 changes: 2 additions & 2 deletions lint/unnecessary_force_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package lint

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
2 changes: 1 addition & 1 deletion lint/unnecessary_force_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/tools/analysis"

"github.com/onflow/cadence-tools/lint"
Expand Down
4 changes: 2 additions & 2 deletions lint/unused_result_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package lint

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"
)

Expand Down
2 changes: 1 addition & 1 deletion lint/unused_result_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/tools/analysis"

"github.com/onflow/cadence-tools/lint"
Expand Down

0 comments on commit e126414

Please sign in to comment.