gruntwork-io / pre-commit

A collection of pre-commit hooks used by Gruntwork tools
https://gruntwork.io/
Apache License 2.0
484 stars 155 forks source link

helmlint always passed #77

Open tomqwu opened 2 years ago

tomqwu commented 2 years ago

Describe the bug helmlint doesn't really lint

the folder structure looks like

tree test-hook
test-hook
└── test
    ├── Chart.yaml
    ├── charts
    ├── templates
    │   ├── NOTES.txt
    │   ├── _helpers.tpl
    │   ├── deployment.yaml
    │   ├── hpa.yaml
    │   ├── ingress.yaml
    │   ├── service.yaml
    │   ├── serviceaccount.yaml
    │   └── tests
    │       └── test-connection.yaml
    └── values.yaml

4 directories, 10 files

To Reproduce Steps to reproduce the behavior including the relevant Terraform/Terragrunt/Packer version number and any code snippets and module inputs you used.

a default helm lint test run looks like

helm lint test 
==> Linting test
[INFO] Chart.yaml: icon is recommended
[ERROR] values.yaml: unable to parse YAML: error converting YAML to JSON: yaml: line 79: did not find expected key
[ERROR] templates/: cannot load values.yaml: error converting YAML to JSON: yaml: line 79: did not find expected key
[ERROR] : unable to load chart
        cannot load values.yaml: error converting YAML to JSON: yaml: line 79: did not find expected key

Error: 1 chart(s) linted, 1 chart(s) failed

But the pre-commit run looks like

pre-commit run --all-files
helmlint.................................................................Passed

here is the pre-commit config

repos:
  - repo: https://github.com/gruntwork-io/pre-commit
    rev: v0.1.17 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
    hooks:
      - id: helmlint

Expected behavior The helmlint should give the same result as helm lint

Additional context Add any other context about the problem here.

tomqwu commented 2 years ago

pre-commit run --all-files -verbose shows this

.cache/pre-commit/repoz_8jwzgx/hooks/helmlint.sh: line 68: realpath: command not found

After installing the package the problem is resolved, the getting started doc should add this as a dependency.

brew install coreutils

slettner commented 2 years ago

+1 on this issue, would be helpful to document this