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

exclude configuration as array #717

Open
dalisoft opened this issue May 10, 2024 · 0 comments
Open

exclude configuration as array #717

dalisoft opened this issue May 10, 2024 · 0 comments
Labels
feature request A new lefthook feature description

Comments

@dalisoft
Copy link

⚡ Summary

I would like to see exclude array support

Value

exclude:
  - bun.lockb
  - package-lock.json
  - yarn.lock
  - pnpm-lock.yaml

Behavior and configuration changes

Currently configuration is like this:

prepare-commit-msg:
  commands:
    commitlint:
      env:
        PATH: $PATH:./node_modules/.bin
      run: commitlint --edit

pre-commit:
  parallel: true
  commands:
    biome:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.{js,ts,jsx,tsx,json,jsonc}"
      run: biome check {staged_files} --apply
    markdown:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.md"
      run: dprint fmt {staged_files}
    docker:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "Dockerfile"
      run: dprint fmt {staged_files}
    typos:
      env:
        PATH: $PATH:./node_modules/.bin
      exclude: "bun.lockb|package-lock.json|yarn.lock|pnpm-lock.yaml"
      run: typos {staged_files}

pre-push:
  parallel: true
  commands:
    biome:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.{js,ts,jsx,tsx,json,jsonc}"
      run: biome check {all_files}
    markdown:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.md"
      run: dprint check {all_files}
    docker:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "Dockerfile"
      run: dprint check {all_files}
    typos:
      env:
        PATH: $PATH:./node_modules/.bin
      exclude: "bun.lockb|package-lock.json|yarn.lock|pnpm-lock.yaml"
      run: typos {all_files}

And i would like to see like this

prepare-commit-msg:
  commands:
    commitlint:
      env:
        PATH: $PATH:./node_modules/.bin
      run: commitlint --edit

pre-commit:
  parallel: true
  commands:
    biome:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.{js,ts,jsx,tsx,json,jsonc}"
      run: biome check {staged_files} --apply
    markdown:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.md"
      run: dprint fmt {staged_files}
    docker:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "Dockerfile"
      run: dprint fmt {staged_files}
    typos:
      env:
        PATH: $PATH:./node_modules/.bin
-    exclude: "bun.lockb|package-lock.json|yarn.lock|pnpm-lock.yaml"
+    exclude:
        - bun.lockb
        - package-lock.json
        - yarn.lock
        - pnpm-lock.yaml
      run: typos {staged_files}

pre-push:
  parallel: true
  commands:
    biome:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.{js,ts,jsx,tsx,json,jsonc}"
      run: biome check {all_files}
    markdown:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "*.md"
      run: dprint check {all_files}
    docker:
      env:
        PATH: $PATH:./node_modules/.bin
      glob: "Dockerfile"
      run: dprint check {all_files}
    typos:
      env:
        PATH: $PATH:./node_modules/.bin
-     exclude: "bun.lockb|package-lock.json|yarn.lock|pnpm-lock.yaml"
+     exclude:
        - bun.lockb
        - package-lock.json
        - yarn.lock
        - pnpm-lock.yaml
      run: typos {all_files}
@dalisoft dalisoft added the feature request A new lefthook feature description label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new lefthook feature description
Projects
None yet
Development

No branches or pull requests

1 participant