SPDX-License-Identifier moved to second line
0xalfalfa opened this issue · 1 comments
0xalfalfa commented
If I have
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
...
in my input file, the output file will start with
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
...
and the solidity compiler will warn:
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
The "SPDX-License-Identifier" line, and probably any comment lines, should stay at the top of the source code.
ddnexus commented
This also causes problems to solidity-coverage.
Weirdly enough, you will get 4 extra empty lines at the top of the source, and all its inline indicators of coverage offsetted by -4 lines, making it almost impossible to understand.