-
Notifications
You must be signed in to change notification settings - Fork 712
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 copyright linter #4221
Fix copyright linter #4221
Conversation
22ebf6a
to
6fcad11
Compare
Thanks for the submission; I have concerns about the long list of regex's; let me review our requirements and dig into it. |
6fcad11
to
bcede03
Compare
On my own curious accord, I decided to just simplify the Makefiles regex: The linter reported 100+ Makefiles missing https://github.com/aws/s2n-tls/blob/main/tests/cbmc/proofs/s2n_stuffer_resize/Makefile ...and a huge bulk more. Simplifying this regex collapses ~30 patterns in to a single pattern, correctly detected more files (which I originally thought were intentionally lacking copyright headers). I'll wait for you to get back before anymore steps in the dark; I'm guessing this still is not in sync with, and in optimal agreement of, the requirements (which are beyond just making the list of patterns shorter). |
Thanks, this is useful data. We're looking for more clarity on what's required here. |
Linter now has a complete list of files that were once missing. More files can easily be added with a regex pattern. -scan flag allows finding new files that have not been registered.
bcede03
to
d47563d
Compare
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Previous increment had chances of failing on Linux systems. This increment is more robust and covers older machines like macos10.
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Resolved issues:
Resolves #2298. Resolves #4078.
Description of changes:
Currently, the linter misses 200+ files that have copyright headers and are not being checked. This commit contains a complete linter that is:
-scan
flag that checks every file in the project that has not been registered or unregistered with the linter, in order to find new copyright headers. This solves the problem of the linter becoming outdated and needing a file list overhaul every year or so...The effectiveness of the new copyright linter is easily seen as it detects 9 files that are missing copyright headers including Rust files that were expressed in #4078,
.yml
files which have siblings in a directory all of which are copyrighted yet these ones are not, and finds an empty python file. All the files reported seem concerning and should be looked in to.s2n-tls-copyright-lint.mp4
Feel free to try out the
-scan
feature by removing a registered pattern; the linter will complain about those files and report them to be added when run with the-scan
flag. Currently no new files are found using-scan
as the current registered files list is complete.Call-outs:
Files copyrighted by Galois are also detected/complained/scanned. This is because the pattern (adopted from the previous linter) is to search for the single word
Copyright
in the first 3 lines.Testing:
No tests have been added.
Is this a refactor change? If so, how have you proved that the intended behavior hasn't changed?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.