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

Update EIP-1: Add License Checker #5379

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,36 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
unchecked: '1,5069'

check-license-lines:
name: Check licenses
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@6c44eb8294bb9c93d6118427f4ff8404b695e1d7

- name: Delete Unmodified Files
run: |
cd $GITHUB_WORKSPACE
mkdir all
shopt -s extglob dotglob
mv !(all) all
shopt -u dotglob
mkdir unchanged
cd all
for FILE in ${{ steps.changed-files.outputs.all_changed_files }}; do
[ -f ${FILE} ] && mkdir -p $(dirname "../unchanged/${FILE}")
[ -f ${FILE} ] && cp ${FILE} ../unchanged/${FILE}
done
cd ..
rm -rf all
cp -r unchanged/* .
cd ..
rm -rf unchanged
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not a hard blocker, I'm not a huge fan of obscure uncommented shell scripts. Is there any way to easily turn this into something that is more readable like a python or TS script (or perhaps a GitHub action for "remove all unchanged files"?

Copy link
Contributor

@MicahZoltu MicahZoltu Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, some comments may help make this block more understandable... at the moment, I'm pretty sure that shopt -u dotglob was a cat walking across your keyboard while you were in the middle of authoring this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I'm planning on making it an action. This is a nice stop-gap.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And no, shopt -u dotglob is not due to an unherded Ethereum cat.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been thinking about this more, and I think I preferred the file ignore-list approach as it was overall simpler than this one, which requires an extra two steps, one of which is an external dependency and one of which is an obscure script. In general, I really like simple solutions as our CI already has enough problems as it is due largely (I suspect) to its complexity. If you were able to create a single action that handled all of this I would be more compelled to keep the pattern as it is, but 4 actions just to check for the presence of first line of files feels like overkill on complexity.


- name: Check License Lines
uses: kt3k/license_checker@d12a6d90c58e30fefed09f2c4d03ba57f4c673a8
3 changes: 3 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"**/*.{sol}": "// SPDX-License-Identifier: CC0-1.0"
}
2 changes: 1 addition & 1 deletion EIPS/eip-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ References to other EIPs should follow the format `EIP-N` where `N` is the EIP n

## Auxiliary Files

Images, diagrams and auxiliary files should be included in a subdirectory of the `assets` folder for that EIP as follows: `assets/eip-N` (where **N** is to be replaced with the EIP number). When linking to an image in the EIP, use relative links such as `../assets/eip-1/image.png`.
Images, diagrams and auxiliary files should be included in a subdirectory of the `assets` folder for that EIP as follows: `assets/eip-N` (where **N** is to be replaced with the EIP number). When linking to an image in the EIP, use relative links such as `../assets/eip-1/image.png`. These files must be in the public domain (`CC0`). Solidity files must use the SPDX Identifier `CC0-1.0`.
Pandapip1 marked this conversation as resolved.
Show resolved Hide resolved

## Transferring EIP Ownership

Expand Down