Skip to content

Commit

Permalink
Add copyright protection
Browse files Browse the repository at this point in the history
Added copyright protection to the linting step of the makefiles.

Issue: #189
  • Loading branch information
padjal committed May 3, 2024
1 parent b621604 commit f5d8b3c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,21 @@ fi
bibcop tex/report.bib

find "${LOCAL}" -name '*.sh' -type f -print0 | xargs -0 -n1 shellcheck --shell=bash --severity=style

# Get the current year
current_year=$(date +%Y)

copyright_check="false"

# Iterate over each file in the directory recursively
while IFS= read -r file; do
# Search for the pattern in the file
if ! grep -q "$current_year" "$file"; then
copyright_check="true"
echo "⚠️ Check copyright. Current year not found in file: $file"
fi
done < <(find "$LOCAL" -type f \( -name "*.sh" -o -name "*.py" -o -name "*.rb" \))

if [[ "${copyright_check}" = "true" ]]; then
exit 1
fi

0 comments on commit f5d8b3c

Please sign in to comment.