prettier / pre-commit

Mirror of Prettier package for pre-commit.
5 stars 6 forks source link

Move cmd args to entry key #17

Closed joao-p-marques closed 4 years ago

joao-p-marques commented 4 years ago

As in https://github.com/prettier/prettier/blob/master/.pre-commit-hooks.yaml#L3

This frees args keyword, so that it can be used downstream in pre-commit hooks

Fixes https://github.com/prettier/pre-commit/issues/16

fisker commented 4 years ago

This makes it not able to override args, so I don't think it's good.

fisker commented 4 years ago

Before we do any changes, Please read discussions with the author of pre-commit in https://github.com/prettier/pre-commit/issues/1#issuecomment-670962627

joao-p-marques commented 4 years ago

Can't we override the entry keyword in a downstream hook?

yajo commented 4 years ago

Without this patch (and #18 or whatever works for it), to enable the XML plugin you need:

  - repo: https://github.com/prettier/pre-commit
    rev: v2.1.2
    hooks:
      - id: prettier
        name: prettier + plugin-xml
        additional_dependencies:
          - prettier@2.1.2
          - "@prettier/plugin-xml@0.12.0"
        args:
          - --write
          - --list-different
          - --ignore-unknown
          - --plugin=@prettier/plugin-xml

While before it was:

  - repo: https://github.com/prettier/prettier
    rev: 2.1.2
    hooks:
      - id: prettier
        name: prettier + plugin-xml
        additional_dependencies:
          - "@prettier/plugin-xml@0.12.0"
        args:
          - --plugin=@prettier/plugin-xml

Clearly much better. Sadly that's broken since today (https://github.com/prettier/prettier/issues/9459, still we don't know why).