diff --git a/acceptance-tests/tests/contracts/CrossContractReader.sol b/acceptance-tests/tests/contracts/CrossContractReader.sol index e54e4c712eb..f43ce8b621e 100644 --- a/acceptance-tests/tests/contracts/CrossContractReader.sol +++ b/acceptance-tests/tests/contracts/CrossContractReader.sol @@ -59,4 +59,4 @@ contract CrossContractReader { CrossContractReader cross = CrossContractReader(crossAddress); cross.destroy(); } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/contracts/EventEmitter.sol b/acceptance-tests/tests/contracts/EventEmitter.sol index 22afa7a0868..2e6e29e59d6 100644 --- a/acceptance-tests/tests/contracts/EventEmitter.sol +++ b/acceptance-tests/tests/contracts/EventEmitter.sol @@ -41,4 +41,4 @@ contract EventEmitter { function sender() view public returns (address) { return _sender; } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/contracts/RemoteSimpleStorage.sol b/acceptance-tests/tests/contracts/RemoteSimpleStorage.sol index 072948e035b..03c95dc2bd1 100644 --- a/acceptance-tests/tests/contracts/RemoteSimpleStorage.sol +++ b/acceptance-tests/tests/contracts/RemoteSimpleStorage.sol @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * 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 @@ -34,4 +34,4 @@ contract RemoteSimpleStorage { function get() public view returns (uint) { return simpleStorage.get(); } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/contracts/RevertReason.sol b/acceptance-tests/tests/contracts/RevertReason.sol index d632910662c..b1270fe4ccd 100644 --- a/acceptance-tests/tests/contracts/RevertReason.sol +++ b/acceptance-tests/tests/contracts/RevertReason.sol @@ -27,4 +27,4 @@ contract RevertReason { function revertWithoutRevertReason() public pure returns (bool) { revert(); } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/contracts/SimpleStorage.sol b/acceptance-tests/tests/contracts/SimpleStorage.sol index 0b4838f1c26..9303def9e05 100644 --- a/acceptance-tests/tests/contracts/SimpleStorage.sol +++ b/acceptance-tests/tests/contracts/SimpleStorage.sol @@ -28,4 +28,4 @@ contract SimpleStorage { function get() public view returns (uint) { return data; } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/contracts/TestDepth.sol b/acceptance-tests/tests/contracts/TestDepth.sol index ec49a1ad8bf..3b4e17904c3 100644 --- a/acceptance-tests/tests/contracts/TestDepth.sol +++ b/acceptance-tests/tests/contracts/TestDepth.sol @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * 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 @@ -29,4 +29,4 @@ contract TestDepth { x = gasleft(); } } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/Migrations.sol b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/Migrations.sol index f47e9cea31c..e0e4dd0959d 100644 --- a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/Migrations.sol +++ b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/Migrations.sol @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - pragma solidity ^0.5.0; contract Migrations { diff --git a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleAccountPermissioning.sol b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleAccountPermissioning.sol index 04542a50551..72215b4a9cd 100644 --- a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleAccountPermissioning.sol +++ b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleAccountPermissioning.sol @@ -1,3 +1,17 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + */ pragma solidity >=0.4.0 <0.6.0; // THIS CONTRACT IS FOR TESTING PURPOSES ONLY // DO NOT USE THIS CONTRACT IN PRODUCTION APPLICATIONS @@ -43,4 +57,4 @@ contract SimpleAccountPermissioning { function getSize() public view returns(uint256) { return size; } -} \ No newline at end of file +} diff --git a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioning.sol b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioning.sol index 334cf959c50..57c72370b82 100644 --- a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioning.sol +++ b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioning.sol @@ -1,3 +1,17 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + */ pragma solidity >=0.4.0 <0.6.0; // THIS CONTRACT IS FOR TESTING PURPOSES ONLY // DO NOT USE THIS CONTRACT IN PRODUCTION APPLICATIONS diff --git a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioningV2.sol b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioningV2.sol index 9458f0619bf..a3b7ffa47b5 100644 --- a/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioningV2.sol +++ b/acceptance-tests/tests/simple-permissioning-smart-contract/contracts/SimpleNodePermissioningV2.sol @@ -1,3 +1,17 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + */ pragma solidity >=0.4.0 <0.6.0; // THIS CONTRACT IS FOR TESTING PURPOSES ONLY // DO NOT USE THIS CONTRACT IN PRODUCTION APPLICATIONS diff --git a/build.gradle b/build.gradle index d69c273da0b..5ebb7d5af92 100644 --- a/build.gradle +++ b/build.gradle @@ -220,7 +220,16 @@ allprojects { } // Below this line are currently only license header tasks format 'bash', { target '**/*.sh' } - format 'sol', { target '**/*.sol' } + format 'Solidity', { + target '**/*.sol' + targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**' + trimTrailingWhitespace() + endWithNewline() + + licenseHeaderFile("${rootDir}/gradle/spotless/java.former.license","^pragma solidity.+?").named("former").onlyIfContentMatches("^/\\*\\r?\\n.*Copyright ConsenSys AG\\.") + licenseHeaderFile("${rootDir}/gradle/spotless/java.former.date.license","^pragma solidity.+?").named("former.date").onlyIfContentMatches("^/\\*\\r?\\n.* Copyright \\d{4} ConsenSys AG\\.") + licenseHeaderFile("${rootDir}/gradle/spotless/java.current.license","^pragma solidity.+?").named("current").onlyIfContentMatches("^(?!/\\*\\r?\\n \\*.*ConsenSys AG\\.)") + } } tasks.withType(JavaCompile).configureEach { diff --git a/consensus/qbft/src/integration-test/resources/validator_contract.sol b/consensus/qbft/src/integration-test/resources/validator_contract.sol index 977c2aac22c..7d9ef984dbc 100644 --- a/consensus/qbft/src/integration-test/resources/validator_contract.sol +++ b/consensus/qbft/src/integration-test/resources/validator_contract.sol @@ -23,4 +23,4 @@ contract Validators { return validators; } -} \ No newline at end of file +}