File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
test-data/hardhat-sample/contracts Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ impl<'a> FlatteningResult<'a> {
161161 let mut result = String :: new ( ) ;
162162
163163 if let Some ( license) = & self . license {
164- result. push_str ( & format ! ( "{license}\n " ) ) ;
164+ result. push_str ( & format ! ( "// {license}\n " ) ) ;
165165 }
166166 for pragma in & self . pragmas {
167167 result. push_str ( & format ! ( "{pragma}\n " ) ) ;
@@ -757,7 +757,9 @@ impl Flattener {
757757
758758 for loc in & self . collect_licenses ( ) {
759759 if loc. path == self . target {
760- target_license = Some ( self . read_location ( loc) ) ;
760+ let license_line = self . read_location ( loc) ;
761+ let license_start = license_line. find ( "SPDX-License-Identifier:" ) . unwrap ( ) ;
762+ target_license = Some ( license_line[ license_start..] . trim ( ) ) ;
761763 }
762764 updates. entry ( loc. path . clone ( ) ) . or_default ( ) . insert ( (
763765 loc. start ,
Original file line number Diff line number Diff line change 1- //SPDX-License-Identifier: Unlicense
1+ // SPDX-License-Identifier: Unlicense
22pragma solidity >= 0.6.0 ;
33
44import "hardhat/console.sol " ;
You can’t perform that action at this time.
0 commit comments