macisamuele / language-formatters-pre-commit-hooks

Collection of custom pre-commit hooks.
Apache License 2.0
115 stars 58 forks source link

"Offset" is defined in the YAML hook, but is unaccessible from the command line #145

Closed Alexander-Serov closed 1 year ago

Alexander-Serov commented 1 year ago

Hello!

I see the "offset" parameter defined here for the yaml files. However, when I try to use it in v2.6.0, I get the following message:

Pretty format YAML.......................................................Failed
- hook id: pretty-format-yaml
- exit code: 2

usage: pretty-format-yaml
       [-h]
       [--autofix]
       [--indent INDENT]
       [--preserve-quotes]
       [--line-width LINE_WIDTH]
       [filenames [filenames ...]]
pretty-format-yaml: error: unrecognized arguments: --offset

My pre-commit-config:

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
  rev: v2.6.0
  hooks:
  - id: pretty-format-yaml
    args: [--autofix, --indent, '2', --offset, '2']

Am I doing something wrong?

Alexander-Serov commented 1 year ago

FYI @macisamuele

macisamuele commented 1 year ago

this happens because the change is not released into a new version yet.

I'm planning to release it in the next days (it will be 2.7.0) but if you need it earlier you could set the revision to the commit that added the flag (f0d68c19b8fbb89643be7f6bcebc425499d803f0)

Alexander-Serov commented 1 year ago

Oh thanks, saw the failed builds but didn't realize it hadn't been released yet! No problem, I can wait. Thanks for the community service!