Title: Be able to run pre-commit check on file removal (for languages which not file-limited, but dir-limited) · Issue #3048 · pre-commit/pre-commit · GitHub
Open Graph Title: Be able to run pre-commit check on file removal (for languages which not file-limited, but dir-limited) · Issue #3048 · pre-commit/pre-commit
X Title: Be able to run pre-commit check on file removal (for languages which not file-limited, but dir-limited) · Issue #3048 · pre-commit/pre-commit
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 fold...
Open Graph 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, a...
X 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, *.tfvar...
Opengraph URL: https://github.com/pre-commit/pre-commit/issues/3048
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Be able to run pre-commit check on file removal (for languages which not file-limited, but dir-limited)","articleBody":"### search you tried in the issue tracker\r\n\r\nfile removal\r\n\r\n### describe your actual problem\r\n\r\nI'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.\r\n\r\nFor example, we have 2 files in one directory:\r\n\r\n`vars.tf`\r\n```tf\r\nvariable \"kms_enabled\" {\r\n description = \"Enable creation of app-specific KMS key. Required if S3 or RDS is enabled.\"\r\n type = bool\r\n default = false\r\n}\r\n```\r\n\r\n`outputs.tf`\r\n```tf\r\noutput \"kms_enabled\" {\r\n description = \"Is KMS used\"\r\n value = var.kms_enabled\r\n}\r\n```\r\n\r\nIf everything that I do in the folder - removes `vars.tf` - pre-commit will skip any checks which means that we commit invalid code.\r\n\r\nIn terraform hooks, we get all the changed file paths, extract dir paths and execute hooks on dirs.\r\nhttps://github.com/antonbabenko/pre-commit-terraform/blob/7122298824a9530e8f9c48e5de4281cca6301d67/hooks/_common.sh#L245C27-L253 \r\n\r\nIs there any possibility of forcing pre-commit to not skip deleted file paths from the list of files that need to be checked?\r\n\r\n### pre-commit --version\r\n\r\npre-commit 3.2.1","author":{"url":"https://github.com/MaxymVlasov","@type":"Person","name":"MaxymVlasov"},"datePublished":"2023-11-01T13:03:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/3048/pre-commit/issues/3048"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ac1a4b7c-82d0-ba73-336d-4123bdde50e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBEC:53D51:8CF046:C4C8A3:6A4C96B7 |
| html-safe-nonce | 44d372e295fff942704de0033ae2474ae1b277718891cfe49aa3fdb8fe7885f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkVDOjUzRDUxOjhDRjA0NjpDNEM4QTM6NkE0Qzk2QjciLCJ2aXNpdG9yX2lkIjoiMzA0MzI0OTQ0MjE1MDcxNzExMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 84f43d7222d78ca4b1953833b9169b578ff2c4e8607f4e4005a2e78aede9f2ca |
| hovercard-subject-tag | issue:1972341633 |
| github-keyboard-shortcuts | repository,issues,commits,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/3048/issue_layout |
| twitter:image | https://opengraph.githubassets.com/926397c2bd10f953f30fd9546ac90b1fcb1b44c3b1ec5ec06c6e58091a2f3a3a/pre-commit/pre-commit/issues/3048 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/926397c2bd10f953f30fd9546ac90b1fcb1b44c3b1ec5ec06c6e58091a2f3a3a/pre-commit/pre-commit/issues/3048 |
| og:image:alt | 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, a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MaxymVlasov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git |
| octolytics-dimension-user_id | 6943086 |
| octolytics-dimension-user_login | pre-commit |
| octolytics-dimension-repository_id | 17689377 |
| octolytics-dimension-repository_nwo | pre-commit/pre-commit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17689377 |
| octolytics-dimension-repository_network_root_nwo | pre-commit/pre-commit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7a2dede45637df6b92ddcfe2a557e67d4b5854ae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width