Skip to content

Commit

Permalink
add license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Feb 22, 2021
1 parent a0406dd commit 5c792c3
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 7 deletions.
19 changes: 18 additions & 1 deletion tools/golangci-lint/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2021 Dapper Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package lint

import (
_ "github.com/golangci/golangci-lint/pkg/lint"
)

18 changes: 18 additions & 0 deletions tools/maprangecheck/analyzer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2021 Dapper Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package main

import (
Expand Down
18 changes: 18 additions & 0 deletions tools/maprangecheck/analyzer_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2021 Dapper Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package main

import (
Expand Down
18 changes: 18 additions & 0 deletions tools/maprangecheck/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2021 Dapper Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package main

import (
Expand Down
32 changes: 26 additions & 6 deletions tools/maprangecheck/testdata/test.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2021 Dapper Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package testdata

func testVariable() {
var m map[string]int

for range m {} // want "range statement over map: map\\[string\\]int"
for range m {
} // want "range statement over map: map\\[string\\]int"
}


func returnMap() map[int]string {
return nil
}

func testFunc() {
for range returnMap() {} // want "range statement over map: map\\[int\\]string"
for range returnMap() {
} // want "range statement over map: map\\[int\\]string"
}

func testTypeDef() {
type M map[string]int
var m M
for range m {} // want "range statement over map: map\\[string\\]int"
for range m {
} // want "range statement over map: map\\[string\\]int"
}

func testTypeAlias() {
type M = map[string]int
var m M
for range m {} // want "range statement over map: map\\[string\\]int"
for range m {
} // want "range statement over map: map\\[string\\]int"
}

0 comments on commit 5c792c3

Please sign in to comment.