checks.bash: check OSV file is never deleted

Add a test that a file in data/ cannot be deleted.

Change-Id: Ie668b75020d7c184ddbb8ae66f612e945dd62e9b
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/439298
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
This commit is contained in:
Julie Qiu 2022-10-08 12:04:40 -04:00
Родитель 7557701122
Коммит 95da670779
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -87,6 +87,13 @@ check_misspell() {
runcmd misspell -i "unknwon" -error .
}
check_data_osv() {
commit=$(git log --name-status HEAD^..HEAD)
if [[ "$commit" =~ .*"D"."data/osv/".* ]]; then
err "Files in the data/osv/ directory should never be deleted. Use the withdrawn field instead to remove reports. See doc/format.md for details."
fi
}
go_linters() {
check_vet
check_staticcheck
@ -99,6 +106,7 @@ go_modtidy() {
}
runchecks() {
check_data_osv
check_headers
go_linters
go_modtidy