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

chore(integrationv2): add license header #4732

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Conversation

jmayclin
Copy link
Contributor

Description of changes:

Change the header_mistake_scanner.sh to catch errors with the integv2 files, and fix the mistakes.

Call-outs:

This change was autogenerated by modifying header_mistake_scanner

diff --git a/codebuild/bin/header_mistake_scanner.sh b/codebuild/bin/header_mistake_scanner.sh
index d6d7cd2c6..6a72fb1ca 100755
--- a/codebuild/bin/header_mistake_scanner.sh
+++ b/codebuild/bin/header_mistake_scanner.sh
@@ -27,6 +27,10 @@ S2N_FILES+=$(find "$PWD" -type f -name "*.rs" | grep -v target)
 
 FAILED=0
 
+LICENSE_HEADER="# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: Apache-2.0
+"
+
 for file in $S2N_FILES; do
     # The word "Copyright" should appear at least once in the first 4 lines of every file
     COUNT=`head -4 $file | grep "Copyright" | wc -l`;
@@ -44,6 +48,10 @@ for file in $S2N_FILES; do
     then
         FAILED=1;
         echo "License Check Failed: $file";
+
+        # Insert the license header at the top of the file
+        echo "$LICENSE_HEADER$(cat $file)" > $file;
+        echo "License added to: $file";
     fi
 done

Testing:

The header mistake scanner now passes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jmayclin jmayclin marked this pull request as ready for review August 24, 2024 00:38
@jmayclin jmayclin requested a review from dougch as a code owner August 24, 2024 00:38
@github-actions github-actions bot added the s2n-core team label Aug 24, 2024
@jmayclin jmayclin enabled auto-merge (squash) August 28, 2024 21:49
@jmayclin jmayclin merged commit c292d09 into aws:main Aug 28, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants