Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create lit test for copyright header validation #15296

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Next Next commit
validation-test: Implement date logic for copyright validator
  • Loading branch information
AndrewSB committed Jun 28, 2022
commit a2355939d621e5f1803e63efebadc73d202bce26
15 changes: 15 additions & 0 deletions validation-test/copyright.test-sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# This test validates that all source files have _correct_ copyright notices.

set -euo pipefail

# Takes a filepath as the sole argument
function dates() {
local G_LOG_OUTPUT=$(git log --format="%ad" --date="format:%Y" -- %@)

local CREATED_AT="tail -1 $G_LOG_OUTPUT"
local LAST_EDIT="head -1 $G_LOG_OUTPUT"

echo "created at
}