diff --git a/tools/golangci-lint/main.go b/tools/golangci-lint/main.go index 2ed8bff5c7..7338157478 100644 --- a/tools/golangci-lint/main.go +++ b/tools/golangci-lint/main.go @@ -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" ) - diff --git a/tools/maprangecheck/analyzer.go b/tools/maprangecheck/analyzer.go index 21444b61db..6df7946042 100644 --- a/tools/maprangecheck/analyzer.go +++ b/tools/maprangecheck/analyzer.go @@ -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 ( diff --git a/tools/maprangecheck/analyzer_test.go b/tools/maprangecheck/analyzer_test.go index 003a76f9b4..40f80930f8 100644 --- a/tools/maprangecheck/analyzer_test.go +++ b/tools/maprangecheck/analyzer_test.go @@ -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 ( diff --git a/tools/maprangecheck/main.go b/tools/maprangecheck/main.go index e42b6fc7fd..638da6c7ed 100644 --- a/tools/maprangecheck/main.go +++ b/tools/maprangecheck/main.go @@ -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 ( diff --git a/tools/maprangecheck/testdata/test.go b/tools/maprangecheck/testdata/test.go index dc53fdbd82..e79bc0cec1 100644 --- a/tools/maprangecheck/testdata/test.go +++ b/tools/maprangecheck/testdata/test.go @@ -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" } -