crytic / slither

Static Analyzer for Solidity and Vyper
https://blog.trailofbits.com/2018/10/19/slither-a-solidity-static-analysis-framework/
GNU Affero General Public License v3.0
5.33k stars 966 forks source link

[Bug-Candidate]: pre-commit does not work as documented #2549

Open olexiyb opened 2 months ago

olexiyb commented 2 months ago

Describe the issue:

I have added in my .pre-commit-config.yaml

   - repo: https://github.com/crytic/slither
      rev: 0.10.4
      hooks:
        - id: slither

And I get

pre-commit/repoc36zuhi6/.pre-commit-hooks.yaml is not a file

For some reason tag version is missing .pre-commit-hooks.yaml file

Code example to reproduce the issue:

NA

Version:

0.10.4

Relevant log output:

No response

elopez commented 2 months ago

Hi! https://github.com/crytic/slither/pull/2521 was only merged very recently, so it's not yet available on any release. I'm guessing you could use rev: master in the meantime, but I'll defer to @dbast who added the feature 😄

dbast commented 2 months ago

yep. there was no release after the PR merge yet... till then the hook can be used via e.g.

- repo: https://github.com/crytic/slither
  # latest commit sha1 on master ... using just "master" as rev breaks hook caching
  rev: 16fd330723aca93dc3342dee77340e4b344dc732
  hooks:
    - id: slither

works here https://github.com/dbast/sol-press/blob/main/.pre-commit-config.yaml#L24

olexiyb commented 1 month ago

This is not a way how pre-commit should be used, as pre-commit autoupdate won't work Anyway hopefully pre-commit config will be tagged in next release