热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Featurerequesthookgroupsandrunhooksbygroup

Immigratingsometasksfroma

I'm migrating some tasks from a

1
Makefile

to my pre-commit config. This gives me the equivalent of

1
make all

, but I'd like to be able to tag groups of hooks as

1
lint

or

1
build

tasks so I can do something like:

1
2
pre-commit install --group lint

pre-commit run -a --group build

I'd like to do this because I otherwise have a ton of duplication between my

1
Makefile

and pre-commit config.

该提问来源于开源项目:pre-commit/pre-commit

(I may be wrong) but it seems like your current goals are:




  • only run a specific list of things during pre-commit (maybe all?) (I'm not even sure this is one of your goals, basing this off of your original post and not your example configuration)

This is not one of my goals.

  • In some make targets, run a specific set of hooks against all files

This is what I am trying to achieve. What I was missing was that you could pass a hook id to run. I basically had it backwards. Thanks for the help.



(I do think adding your makefile snippet above to the docs as an example would be a good thing)


   



推荐阅读
author-avatar
爱我独自等待_白兔窝2013
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有