Access input file names in system hooks?
See original GitHub issueIs there a way to access the input filename for system
hooks? I’m trying to run sort --output $file $file
on a set of simple Yaml files containing only key-value pairs.
repos:
- repo: local
hooks:
- id: sort-simple-yaml
name: Sort simple YAML files
entry: sort --output $file $file
language: system
files: .+\.yml
Related: https://github.com/pre-commit/pre-commit/issues/522
I tried sort-simple-yaml
but couldn’t get it to sort even when setting files
explicitly.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: sort-simple-yaml
files: ^.*\.yml$ # nothing happens
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Access the changed files path in git pre-receive hook
I'm wondering if there is a temporary location where the files are saved in git as soon as they are pushed so that...
Read more >Git Hooks
We'll cover most of the major hook filenames here. Client-Side Hooks. There are a lot of client-side hooks. This section splits them into...
Read more >Handling Multiple File Uploads With React Hook Form
In this article, we are going to discuss how to work on multiple file uploads with the React Hook Form.
Read more >File hooks - GitLab Docs
Inside the file_hooks directory, create a file with a name of your choice, without spaces or special characters. Make the hook file executable...
Read more >Git Hooks | Atlassian Git Tutorial
If you take a look inside .git/hooks , you'll find the following files: ... Then, it calls git symbolic-ref --short HEAD to get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool, didn’t know about the
file-contents-sorter
hook. Will use that then.Just to confirm, there’s no documented way to access the file name in an
entry
field?just tried it, seems to work fine to me?