daveshanley / vacuum

vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool. Built in go, it tears through API specs faster than you can think. vacuum is compatible with Spectral rulesets and generates compatible reports.
https://quobix.com/vacuum
MIT License
565 stars 46 forks source link

Pre-commit failing with files under dir and --base dir set #327

Open guglie opened 1 year ago

guglie commented 1 year ago

First of all, thanks for the great tool! 🚀

If I have my openAPI spec files in a folder named docs ( containing relative refs) and run the following pre-commit (while committing multiple spec files under the docs folder):

- repo: https://github.com/daveshanley/vacuum
  rev: "v0.3.3"
  hooks:
    -   id: vacuum
        name: Check OpenAPI doc
        files: ^docs/.*.yml$
        args: ["--base", "./docs", "--details", "--errors"]

It can't find the files while committing.

  ERROR   Please supply an OpenAPI specification to lint

But running it manually is ok and finds the relative refs without problems. pre-commit run vacuum --files docs/*.yml

daveshanley commented 1 year ago

Hmm.. will look into this for you.