Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace addlicense with find and grep (#2018)
addlicense is not maintained and is not extensible. find and grep are sufficient for our use case. Note that what the new script is doing is basically equivalent to addlicense: - Find files that may need licenses: https://github.com/google/addlicense/blob/4caba19b7ed7818bb86bc4cd20411a246aa4a524/main.go#L197 - Look for a license: https://github.com/google/addlicense/blob/4caba19b7ed7818bb86bc4cd20411a246aa4a524/main.go#L372 Unfortunately, addlicense only handles files with extensions it knows about, and there is no way to specify additional extensions: https://github.com/google/addlicense/blob/4caba19b7ed7818bb86bc4cd20411a246aa4a524/main.go#L163 I believe the reason for this is that addlicense can also add licenses to files automatically, which requires knowing e.g. what is the comment syntax for each given file. However, in our case we add new files rarely enough that doing so manually should not be too painful. If it does turn out to be painful, I can update this script to provide an autofix mode. See this thread for additional context: #2016 (comment)
- Loading branch information