GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - commure/precommit: git hook library

BranchesTags
Open more actions menu

Latest commit

 

History

48 Commits
48 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
test
test
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 
hooks.yaml
hooks.yaml
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

precommit

Installation

To install binary :

cargo install --git=http://github.com/commure/precommit.git

Then in repository

precommit install <hook_yaml_file>

Information

Runs hooks specified in yaml based on regex test during git pre-commit for staged files.

Config file

<hook_name>:
  commands: <list of commands to execute for given hook>
    - command: <command to run>
      arguments: <command_arguments note special variable of filename which will fill in file that will be run>
  regex: <regex to test whether or not to run a given file>

Example

pre-commit:
  prettier:
    commands:
      - command: prettier
        arguments: [--write, <filename>]
      - command: git
        arguments: [add, <filename>]
    regex: ".*(js|jsx|scss|md)$"

  eslint:
    commands:
      - command: eslint
        arguments: [<filename>]
      - command: git
        arguments: [add, <filename>]
    regex: ".*(js|sass|css)$"

  rustfmt:
    commands:
      - command: rustfmt
        arguments: [<filename>]
      - command: git
        arguments: [add, <filename>]
    regex: ".*(rs)$"

  clippy:
    commands:
      - command: cargo
        arguments: [clippy]
    regex: ".*(rs)$"

  print_yaml:
    commands:
      - command: cat
        arguments: [<filename>]
    regex: ".*(yaml|yml)$"

About

git hook library

Resources

Readme
Activity
Custom properties

Stars

2 stars

Watchers

11 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.