用于创建没有.pre-commit-hooks.yaml的镜像存储库的脚本

pre-commit-mirror-maker的Python项目详细描述


Build StatusCoverage Status

预提交镜像生成器

用于创建没有 .pre-commit-hooks.yaml

安装

$ pip install pre-commit-mirror-maker

样本使用

$ pre-commit-mirror --help
usage: pre-commit-mirror [-h] --language {node,python,ruby,rust}
                         --package-name PACKAGE_NAME
                         (--files-regex FILES_REGEX | --types TYPES)
                         [--entry ENTRY] [--args ARGS]
                         repo_path

positional arguments:
  repo_path             Local path where the git repo is checked out.

optional arguments:
  -h, --help            show this help message and exit
  --language {node,python,ruby,rust}
                        Which language to use.
  --package-name PACKAGE_NAME
                        Package name as it appears on the remote package
                        manager.
  --files-regex FILES_REGEX
                        Files regex to use in hooks.yaml
  --types TYPES         `identify` type to match
  --entry ENTRY         Entry point, defaults to the package name.
  --args ARGS           Comma separated arguments for the hook. Escape commas
                        in args with a backslash (\). For example: --args='-i,
                        --ignore=E265\,E501' would give you [-i,
                        --ignore=E265,E501]

例如:制作yapf包的镜像:

$ git init mirrors-yapf
Initialized empty Git repository in /tmp/mirrors-yapf/.git/$ pre-commit-mirror mirrors-yapf --language python --package-name yapf --args=-i --types python
[master (root-commit) 88bffee] Mirror: 0.1.3 3 files changed, 16 insertions(+) create mode 100644 .pre-commit-hooks.yaml create mode 100644 .version create mode 100644 setup.py[master 24cd5f4] Mirror: 0.1.4 2 files changed, 2 insertions(+), 2 deletions(-)[master 6695a76] Mirror: 0.1.5...[master 091ab92] Mirror: 0.22.0 2 files changed, 2 insertions(+), 2 deletions(-)$ ls -al mirrors-yapf/
total 24drwxrwxr-x 3 asottile asottile 4096 May 26 10:00 .drwxrwxr-x 8 asottile asottile 4096 May 26 10:00 ..drwxrwxr-x 8 asottile asottile 4096 May 26 10:00 .git-rw-rw-r-- 1 asottile asottile  136 May 26 10:00 .pre-commit-hooks.yaml-rw-rw-r-- 1 asottile asottile  137 May 26 10:00 setup.py-rw-rw-r-- 1 asottile asottile    7 May 26 10:00 .version

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
jstl中循环内部的java方法   java如何以编程方式查找iOS应用程序的堆内存?   java JPA列注释   http Java在Web浏览器中显示HttpResponse的内容   ssl Java如何接受我的自签名证书而不必将其添加到Java信任库   java解析bufferedReader数据,在某些字符处停止   java将具有多个属性的对象映射到另一个对象,然后收集到列表   java是否可以将抽象方法的返回类型设置为与类相同?   java Android导航抽屉,带有菜单图标而非后退按钮   如何在JavaSpringMVC中防止会话重放攻击?   是VB。NET SmtpClient API受限于Java SendMail?   跨多线程/节点的java会话管理   来自Eclipse的java maven项目   使用已解析Java DOM XML中的元素添加新元素