Skip to content

Commit

Permalink
PR #3063 from Arun-Prasad-V: Updated pr_check.sh script to not verify…
Browse files Browse the repository at this point in the history
… the year
  • Loading branch information
Nir-Az authored May 7, 2024
2 parents 20ec87c + 2dac617 commit bb039b5
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit bb039b5

Please sign in to comment.