purcell / sqlint

Simple SQL linter supporting ANSI and PostgreSQL syntaxes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Somehow, hooks yaml is not cloned

AbelVM opened this issue · comments

Pre-commit fails to install the hooks, claiming it's not present in the cache folder used for cloning

Sorry, what's the actual problem here? This report isn't clear at all.

Ah, I think you're talking about the pre-commit tool tool, for which @adarnimrod contributed support a few months ago? I've never used it and don't support it, so perhaps @adarnimrod can give you some pointers.

Hahahah, sorry for the crappy issue! I was interrupted while writing it down and I should have pushed unintentionally the create button.

The issue here is that the pre-commit related YAML files are not published in the tagged branches (they are only present in the master branch), so they are not cloned by pre-commit itself and fails to install this very hook.

Right, thanks. Only master is used for development, so this shouldn't really affect anyone, I would think? Any tags would be historical, so there'll always be workflow things in newer code that don't exist in older code.

The way pre-commits works downloads from the pointed tag, not branch (https://pre-commit.com/#using-the-latest-version-for-a-repository), in the repo, and the file .pre-commit-hooks.yaml is not present in any tag of this project. Your snippet

-   repo: https://github.com/purcell/sqlint
    rev: master
    hooks:
    -   id: sqlint

Is then internally changed to the last available tag, 0.1.9

- repo: https://github.com/purcell/sqlint
  rev: 0.1.9
  hooks:
    - id: sqlint

And the hooks file is not present there, so once the tag is cloned to cache, pre-commit is not able to find it and fails.

This seems defunct now that the 0.1.10 tag includes this file, but I see that pre-commit autoupdate also includes a --bleeding-edge arg for this use case.