Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPDX-License-Identifier moved to second line #21

Open
0xalfalfa opened this issue Apr 21, 2022 · 1 comment
Open

SPDX-License-Identifier moved to second line #21

0xalfalfa opened this issue Apr 21, 2022 · 1 comment

Comments

@0xalfalfa
Copy link

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
Copy link

ddnexus commented Sep 12, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants