pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 3 forks source link

Unexpected hook in skip block using alias #186

Closed blarghmatey closed 1 year ago

blarghmatey commented 1 year ago

I am trying to disable a specific hook configuration that is duplicating another ID that I would also like to run in CI. When I set an alias on the second configuration and add that alias to the ci:skip list I get the error message:

==> File .pre-commit-config.yaml
==> At Config()
==> At key: ci
==> At key: skip
=====> unexpected hook ids: prettier-django

The configuration in question looks like:

ci:
  skip:
    - prettier-django
repos:
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v3.0.3
    hooks:
      - id: prettier
        types_or: [javascript, jsx, ts, tsx, json, scss, sass, css]
        args:
          - --no-config
          - --no-semi
      - id: prettier
        alias: prettier-django
        name: prettier-django
        types: [html]
        additional_dependencies:
          - prettier
          - prettier-plugin-django-alpine
asottile commented 1 year ago

yep I think it doesn't know about alias -- if you'd like you can contribute a fix to https://github.com/pre-commit-ci/pre-commit-ci-config (or I'll be able to get to it next week)

blarghmatey commented 1 year ago

Thanks, I just opened a PR to address this in https://github.com/pre-commit-ci/pre-commit-ci-config/pull/104

asottile commented 1 year ago

this should be live within a few minutes! thanks for the report and for the patch!