Description
search you tried in the issue tracker
file removal
describe your actual problem
I'm maintainer of Terraform pre-commit hooks, and Terraform during checks and execution, merges all *.tf, *.tfvars, and few other file extensions in one folder in one big configuration and checks that across all these files everything is OK.
For example, we have 2 files in one directory:
vars.tf
variable "kms_enabled" {
description = "Enable creation of app-specific KMS key. Required if S3 or RDS is enabled."
type = bool
default = false
}
outputs.tf
output "kms_enabled" {
description = "Is KMS used"
value = var.kms_enabled
}
If everything that I do in the folder - removes vars.tf
- pre-commit will skip any checks which means that we commit invalid code.
In terraform hooks, we get all the changed file paths, extract dir paths and execute hooks on dirs.
https://github.com/antonbabenko/pre-commit-terraform/blob/7122298824a9530e8f9c48e5de4281cca6301d67/hooks/_common.sh#L245C27-L253
Is there any possibility of forcing pre-commit to not skip deleted file paths from the list of files that need to be checked?
pre-commit --version
pre-commit 3.2.1