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

fix(ci): sort .license.ignore locally before diff #4106

Merged
merged 2 commits into from
May 17, 2022
Merged
Changes from all 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
9 changes: 6 additions & 3 deletions scripts/file_license_check.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/bash
# run from the repo root
# Must be run from the repo root

rg -i "Copyright.*The Tari Project" --files-without-match \
-g '!*.{Dockerfile,asc,bat,config,config.js,css,csv,drawio,gitkeep,hbs,html,iss,json,lock,md,min.js,ps1,py,rc,scss,sh,sql,svg,toml,txt,yml,vue}' . \
| sort >/tmp/rgtemp
| sort > /tmp/rgtemp

DIFFS=$(diff -u .license.ignore /tmp/rgtemp)
# sort the .license.ignore file as sorting seems to behave differently on different platforms
cat .license.ignore | sort > /tmp/.license.ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cat .license.ignore | sort > /tmp/.license.ignore
sort .license.ignore > /tmp/.license.ignore


DIFFS=$(diff -u /tmp/.license.ignore /tmp/rgtemp)

if [ -n "$DIFFS" ]; then
echo "New files detected that either need copyright/license identifiers added, or they need to be added to .license.ignore"
Expand Down