-
Notifications
You must be signed in to change notification settings - Fork 0
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
TEST: Copyright pre-commit #34
Conversation
Ping @s-boardman - I think you might be interested in this. |
That's absurdly clever Carwyn! |
copyright_check
Outdated
echo "Adding missing Copyright to '${filepath}'" | ||
tmp_file="${filepath}.tmp" | ||
rm -f ${tmp_file} 2&> /dev/null | ||
touch ${tmp_file} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can replace the "rm" and "touch" lines with a single line:
echo -n > ${tmp_file}
copyright_check
Outdated
echo -e ${copyright_header} >> ${tmp_file} | ||
tail -n +2 ${filepath} >> ${tmp_file} | ||
else | ||
echo -e ${copyright_header} >> ${tmp_file} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change this to >
rather than >>
you can do away with removing the ${tmp_file}
above because then the if
and the else
will both create the file afresh anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments on the bash, but looks good.
de34c34
to
b542015
Compare
Thanks @mo-robert-purvis Tidied up based on feedback. Additionally improved by adding:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Added copyright pre-commit check.
Copyright check acts to check for the presence of and verify the validity of the copyright header of python files. Additionally, the role of the script is to automatically add this copyright notice (thus eliminating the need to deal with copyright headers yourself).
Issues
Note
Just to raise awareness as the first dagrunner PR under review - since this branch makes changes that impact the reference documentation, an auto reference documentation build commit will be pushed accordingly thanks to the dagrunner action workflow.