build: Add exhaustive switch statement lint

For now, only check the JSON views package, since this was the instance
that most recently tripped us up. There are a few dozen failures
elsewhere in Terraform which would need to be addressed before expanding
this to other packages.
This commit is contained in:
Alisdair McDiarmid
2021-09-24 15:02:30 -04:00
parent a742d7ee88
commit e09bad76ff
6 changed files with 26 additions and 5 deletions

7
scripts/exhaustive.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo "==> Checking for switch statement exhaustiveness..."
# For now we're only checking a handful of packages, rather than defaulting to
# everything with a skip list.
exhaustive ./internal/command/views/json