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

Updated pr_check.sh script to not verify the year #3063

Merged
merged 1 commit into from
May 7, 2024
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
7 changes: 5 additions & 2 deletions scripts/pr_check.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2023 Intel Corporation. All Rights Reserved.
# Copyright 2024 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,6 +29,8 @@ fixed=0

license_file=$PWD/../LICENSE

year_format="[[:digit:]][[:digit:]][[:digit:]][[:digit:]]"

function check_folder {
for filename in $(find $1 -type f \( -iname \*.cpp -o -iname \*.h -o -iname \*.hpp -o -iname \*.js -o -iname \*.bat -o -iname \*.sh -o -iname \*.txt -o -iname \*.py \)); do

Expand All @@ -43,7 +45,8 @@ function check_folder {
if [[ ! $filename == *"usbhost"* ]]; then
# Only check files that are not .gitignore-d
if [[ $(git check-ignore $filename | wc -l) -eq 0 ]]; then
if [[ $(grep -oP "Copyright 2023 Intel Corporation. All Rights Reserved" $filename | wc -l) -eq 0 ||
if [[ $(grep -oP "Copyright $year_format Intel Corporation. All Rights Reserved" $filename | wc -l) -eq 0 &&
$(grep -oP "Copyright $year_format-$year_format Intel Corporation. All Rights Reserved" $filename | wc -l) -eq 0 ||
$(grep -oP "Licensed under the Apache License, Version 2.0" $filename | wc -l) -eq 0
]]; then
echo "[ERROR] $filename is missing the copyright/license notice"
Expand Down
Loading