Skip to content

Run arbitrary commands in pre-commit hooks, while using the environment pre-commit provides (using additional_dependencies)

License

Notifications You must be signed in to change notification settings

ddanier/pre-commit-run-cmd

Repository files navigation

pre-commit-run-cmd

WORK IN PROGRESS

Idea:

Run any commands in the environment pre-commit provides. Use additional_dependencies to define the dependencies you need and the args to define the command you want to run.

Example config showing this:

repos:
  - repo: https://github.com/ddanier/pre-commit-run-cmd.git
    rev: v0.1.1
    hooks:
      - id: run-python
        name: "flake8"
        args: ["flake8"]
        additional_dependencies:
          - flake8
        types: [python]
  - repo: https://github.com/ddanier/pre-commit-run-cmd.git
    rev: v0.1.1
    hooks:
      - id: run-node
        name: "eslint"
        args: ["eslint"]
        additional_dependencies:
          - eslint
        types: [javascript]

Note: Currently only python and node are supported.

Feature ideas

  • Allow to change current working directory.
  • Support more languages.

About

Run arbitrary commands in pre-commit hooks, while using the environment pre-commit provides (using additional_dependencies)

Resources

License

Stars

Watchers

Forks

Packages

No packages published