Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Alexander-Serov opened this issue Feb 7, 2023 · 3 comments

Comments

@Alexander-Serov
Copy link

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
Copy link
Author

FYI @macisamuele

@macisamuele
Copy link
Owner

macisamuele commented Feb 7, 2023

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 (f0d68c1)

@Alexander-Serov
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants