Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pre-commit): improve default matching and docs
pre-commit passes all filenames to be checked to the invoked command, which does not work with vacuum's current behavior of taking only one filename at a time to lint. On the other hand, sometimes there are multiple OpenAPI or Swagger specs in a repo that should be checked. Additionally, there is no bullet proof way to recognize something being an OpenAPI or Swagger spec available for use in pre-commit at the moment. Therefore, the default configuration is a balancing act between working out of the box without additional tweaks in usual setups, as well as providing means to override it to match cases where it doesn't. Improve the documentation to note the configuration constraints, and ways to make it work if the default does not. Improve also the default configuration to match conventional spec filenames also in subdirectories, not only in top level. Add also a `types` matcher to filter out non-text files possibly matched by the `files` pattern. (The `types` matcher can be overridden in user config as well in the unlikely case it happens to cause problems.)
- Loading branch information