Skip to content

Commit

Permalink
Add check for missing license headers
Browse files Browse the repository at this point in the history
Add `make check_license_headers` as a test workflow step, in order to detect any
yaml or py files without the required license header.
  • Loading branch information
mjwolf committed Sep 5, 2024
1 parent e3e73de commit f9abe74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ jobs:
with:
python-version: '3.x'
- run: git fetch --prune --unshallow --tags
- run: make check_license_headers
- run: make check

5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ check_license_headers:
@echo "Files missing license headers:\n"
@find . -type f \( -path './scripts/*' -o -path './schemas/*' \) \
\( -name '*.py' -o -name '*.yml' \) \
-print0 | xargs -0 -n1 grep -L "Licensed to Elasticsearch B.V." \
|| exit 0
-print0 | xargs -0 -n1 grep -L "Licensed to Elasticsearch B.V."

# Clean deletes all temporary and generated content.
.PHONY: clean
Expand Down Expand Up @@ -86,7 +85,7 @@ misspell:
fi
./build/misspell/bin/misspell -error README.md CONTRIBUTING.md schemas/* docs/* experimental/schemas/*

# Warn re misspell removal
# Warn re misspell removal
.PHONY: misspell_warn
misspell_warn:
@echo "Warning: due to lack of cross-platform support, misspell is no longer included in this task and may be deprecated in future\n"
Expand Down

0 comments on commit f9abe74

Please sign in to comment.