diff --git a/.travis.yml b/.travis.yml index 3044ac7a18ecf8..b0b1876e9fc542 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ script: - cd ../Kernel - ./makeall.sh - ../Meta/lint-shell-scripts.sh +- ../Meta/check-license-headers.sh - ../Meta/Lagom/build-js.sh - cd ../Libraries/LibJS/Tests - ./run-tests diff --git a/DevTools/HackStudio/Debugger/Debugger.h b/DevTools/HackStudio/Debugger/Debugger.h index 90a3318d72e270..451269746a9aee 100644 --- a/DevTools/HackStudio/Debugger/Debugger.h +++ b/DevTools/HackStudio/Debugger/Debugger.h @@ -1,4 +1,3 @@ - /* * Copyright (c) 2020, Itamar S. * All rights reserved. diff --git a/Libraries/LibC/netinet/tcp.h b/Libraries/LibC/netinet/tcp.h deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/Meta/check-license-headers.sh b/Meta/check-license-headers.sh new file mode 100755 index 00000000000000..60cd03151ea318 --- /dev/null +++ b/Meta/check-license-headers.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +cd "$script_path/.." || exit 1 + +# We simply check if the file starts with: +# /* +# * Copyright +PATTERN=$'^/\*\n \* Copyright' +ERRORS=() + +while IFS= read -r f; do + if [[ ! $(cat "$f") =~ $PATTERN ]]; then + ERRORS+=("$f") + fi +done < <(git ls-files -- \ +'*.cpp' \ +'*.h' \ +':!:Tests' \ +':!:Base' \ +':!:Kernel/FileSystem/ext2_fs.h' \ +':!:Libraries/LibC/getopt.cpp' \ +':!:Libraries/LibCore/puff.h' \ +':!:Libraries/LibELF/exec_elf.h' \ +) + +if (( ${#ERRORS[@]} )); then + echo "Files missing license headers: ${ERRORS[*]}" + exit 1 +fi