-
-
Notifications
You must be signed in to change notification settings - Fork 763
Open
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.
Description
Description
For a work project, we have a need of automating running a Taskfile task whenever a particular file changes and we want to automate this with pre-commit. Since there isn't an official Taskfile pre-commit hook I opted to write my own - I figured that I'd share in case this is a use case that Task would like to officially support:
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json
repos:
- repo: local
hooks:
- id: airflow-lockfile-update
name: airflow-lockfile-update
language: golang
pass_filenames: false
files: airflow/pyproject.toml
entry: task
args: ["--dir", "airflow", "update-requirements"]
additional_dependencies:
- "github.com/go-task/task/v3/cmd/[email protected]"Here's what this would look like if it were officially supported:
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json
repos:
- repo: https://github.com/go-task/task
rev: v3.42.1
hooks:
- id: task
files: airflow/pyproject.toml
args: ["--dir", "airflow", "update-requirements"]If this is something that looks useful I'd be happy to contribute - it would require a .pre-commit-hooks.yaml to be placed at the root of the repo:
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-hooks.json
- id: task
name: task
description: Runs a task on your project
language: golang
entry: task
pass_filenames: false
require_serial: truejtwaleson and kasaikou
Metadata
Metadata
Assignees
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.