Skip to content

Commit

Permalink
Update automatic check
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Nov 29, 2022
1 parent fdadafe commit e13514e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LICENSE_FILE_HEADER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// the U.S. Government retains certain rights in this software.
//
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
//
// See https://kokkos.org/LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//@HEADER
2 changes: 1 addition & 1 deletion scripts/apply-clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ find ${TRACKED_FILES} \
xargs -n 1 -P 10 -I {} bash -c "sed -i -e 's/\s\+$//g' {} && rm -f '{}-e'"

# Check that we do not introduce any file with the old copyright
./scripts/update-copyright
./scripts/check-copyright
13 changes: 13 additions & 0 deletions scripts/check-copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
files=`find . -path './tpls' -prune -o -name '*.cpp' -o -name '*.pc.in' -o -name '*.hpp' -o -name '*.cc'`
echo "" &> scripts/diff_files
tmp=`cat LICENSE_FILE_HEADER | wc -l`
NNEW=$(($tmp))
for file in $files; do
head -n +$NNEW $file &> header
diff header LICENSE_FILE_HEADER &> header_diff
count=`cat header_diff | wc -l`
#echo $file " " COUNT " " $count >> diff_headers
if [ "$count" -ne "0" ]; then
echo $file >> scripts/diff_files
fi
done
3 changes: 3 additions & 0 deletions scripts/diff_files
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

./tpls
./core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics.hpp
15 changes: 10 additions & 5 deletions scripts/update-copyright
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ files=`find . -path './tpls' -prune -o -name '*.cpp' -o -name '*.pc.in' -o -name
echo "" &> diff_files
echo "" &> clean_files
echo "" &> updated_files
tmp=`cat scripts/new_header | wc -l`
NNEW=$(($tmp))
tmp=`cat scripts/old_header | wc -l`
NOLD=$(($tmp))
NOLD1=$(($NOLD+1))
for file in $files; do
head -n +43 $file &> header
diff header ${HOME}/Kokkos/kokkos/scripts/old_header &> old_header_diff
head -n +$NOLD $file &> header
diff header scripts/old_header &> old_header_diff
count=`cat old_header_diff | wc -l`
#echo $file " " COUNT " " $count >> diff_headers
if [ "$count" -eq "0" ]; then
echo $file >> clean_files
cat old_header_diff >> clean_files
{ head -n 15 ${HOME}/Kokkos/kokkos/scripts/new_header; tail -n +44 $file; } > tmp
{ head -n +$NNEW scripts/new_header; tail -n +$NOLD1 $file; } > tmp
cp tmp $file
else
head -n +15 $file &> header
diff header ${HOME}/Kokkos/kokkos/scripts/new_header &> new_header_diff
head -n +$NNEW $file &> header
diff header scripts/new_header &> new_header_diff
count=`cat new_header_diff | wc -l`
if [ "$count" -eq "0" ]; then
echo $file >> updated_files
Expand Down

0 comments on commit e13514e

Please sign in to comment.