helm-docs icon indicating copy to clipboard operation
helm-docs copied to clipboard

Pre-commit hooks ignores -s argument

Open emanuele-leopardi opened this issue 3 years ago • 1 comments

repos:
  - repo: https://github.com/norwoodj/helm-docs
    rev: v1.2.0
    hooks:
      - id: helm-docs
        args:
          - -s file

Given the above I was expecting helm-docs to keep the order in the table as the file itself, instead it still processes it as this argument hasn't been passed and sets all up alphanumerically

Another test I tried was the following

repos:
  - repo: https://github.com/norwoodj/helm-docs
    rev: v1.2.0
    hooks:
      - id: helm-docs
        args:
          - -s filefafsfd

this again gets completely ignored

emanuele-leopardi avatar Jul 22 '22 11:07 emanuele-leopardi

I think this is related to how pre-commit / YAML in general handles command line arguments. Have you tried the following?

repos:
  - repo: https://github.com/norwoodj/helm-docs
    rev: v1.2.0
    hooks:
      - id: helm-docs
        args:
          - -s
          - filefafsfd

Putting the argument on a separate line might do the trick. Alternatively, you can use the long-arg format with an = sign like so:

repos:
  - repo: https://github.com/norwoodj/helm-docs
    rev: v1.2.0
    hooks:
      - id: helm-docs
        args:
          - --sort-values-order=filefafsfd

sc250024 avatar Jul 22 '22 12:07 sc250024

@emanuele-leopardi Did you try what @sc250024 proposes? If so how did it do?

@sc250024 Do you think this should be a thing that makes sense to manage on our end?

Nepo26 avatar Jun 29 '23 11:06 Nepo26

Yep I confirm it works that way! Thanks

emanuele-leopardi avatar Sep 15 '23 13:09 emanuele-leopardi