pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 4 forks source link

Command not found errors #199

Closed csabasari closed 11 months ago

csabasari commented 11 months ago

Hi, and sorry if I ask lame questions - I went through on the available documentation regarding pre-commit and pre-commit.ci and also the open/closed issues too, and I didn't found any solution. This is the reference: https://results.pre-commit.ci/run/github/711907207/1702648407.ADucDK-KSciL8Ias7FXQhQ

We subscribed through Github and we found out some checks are missing components in the CI. We have a bunch of terraform/shell related checks included in the configuration which are running fine locally (obviously). As soon as they are invoked through the pre-commit.ci, the commands are missing. Did I missed something from the documentation, and somehow I can add these things there through some variables, or I should not expect that those ones are going to work?

The missing executables are: shfmt, shell_lint, terraform, tflint, tfsec, checkov, tfupdate. Of course they are out of the regular pre-commit scope, and my default assumption that they won't work (I cannot guess how big environment you need to build to check support every possible environment) - I just want to make sure I'm not missing anything.

Thank you for your help in advance! This is my .pre-commit-config.yaml :

---
default_language_version:
  # force all unspecified python hooks to run python3
  python: python3

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: check-added-large-files
      - id: check-case-conflict
      - id: check-executables-have-shebangs
      - id: check-json
      - id: check-merge-conflict
      - id: check-shebang-scripts-are-executable
      - id: check-symlinks
      - id: check-yaml
      - id: destroyed-symlinks
      - id: detect-private-key
      - id: end-of-file-fixer
      - id: forbid-submodules
      - id: mixed-line-ending
        args:
          - --fix=lf
      - id: pretty-format-json
        args:
          - --autofix
      - id: trailing-whitespace

  - repo: https://github.com/pre-commit-ci/pre-commit-ci-config
    rev: v1.6.1
    hooks:
      - id: check-pre-commit-ci-config

  # Text file hooks
  - repo: https://github.com/igorshubovych/markdownlint-cli
    rev: v0.38.0
    hooks:
      - id: markdownlint
        args:
          - --config=.mdl_config.yaml

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v4.0.0-alpha.4
    hooks:
      - id: prettier

  # GitHub Actions hooks
  - repo: https://github.com/python-jsonschema/check-jsonschema
    rev: 0.27.3
    hooks:
      - id: check-github-actions
      - id: check-github-workflows

  # pre-commit hooks
  - repo: https://github.com/pre-commit/pre-commit
    rev: v3.6.0
    hooks:
      - id: validate_manifest

  # Shell script hooks
  - repo: https://github.com/cisagov/pre-commit-shfmt
    rev: v0.0.2
    hooks:
      - id: shfmt
        args:
          # Indent by two spaces
          - -i
          - '2'
          # Binary operators may start a line
          - -bn
          # Switch cases are indented
          - -ci
          # Redirect operators are followed by a space
          - -sr

  - repo: https://github.com/detailyang/pre-commit-shell
    rev: 1.0.5
    hooks:
      - id: shell-lint

  # Terraform hooks
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.83.6
    hooks:
      - id: terraform_fmt
      - id: terraform_validate
      - id: terraform_tflint
      - id: terraform_tfsec
      - id: terraform_checkov
      - id: tfupdate

ci:
    autofix_commit_msg: |
      [pre-commit.ci] auto fixes from pre-commit.com hooks

      for more information, see https://pre-commit.ci
    autofix_prs: true
    autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
    autoupdate_schedule: weekly
asottile commented 11 months ago

dupe #13

you can find things which don't use pre-commit's unsupported escape hatches system/script such as shellcheck-py