Skip to content

Commit

Permalink
Check search term to full string
Browse files Browse the repository at this point in the history
Changed the search term in the copyright linting function to check for the whole string, rather than just a single year.

Issue: #189
  • Loading branch information
padjal committed May 6, 2024
1 parent f5d8b3c commit 58d876d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,16 @@ 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)
header="Copyright (c) 2021-$(date +%Y) Yegor Bugayenko"

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
if ! grep -q "$header" "$file"; then
copyright_check="true"
echo "⚠️ Check copyright. Current year not found in file: $file"
echo "⚠️ Copyright not found in file: $file"
fi
done < <(find "$LOCAL" -type f \( -name "*.sh" -o -name "*.py" -o -name "*.rb" \))

Expand Down

0 comments on commit 58d876d

Please sign in to comment.