Skip to main content

Scripts for creating mirror repositories that do not have .pre-commit-hooks.yaml

Project description

Build Status Azure DevOps coverage pre-commit.ci status

pre-commit-mirror-maker

Scripts for creating mirror repositories that do not have .pre-commit-hooks.yaml

Installation

$ pip install pre-commit-mirror-maker

Sample Usage

$ 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
  --id ID               Hook id, defaults to the entry point.
  --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]

For example: making a mirror of the yapf package:

$ 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 24
drwxrwxr-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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pre_commit_mirror_maker-1.6.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pre_commit_mirror_maker-1.6.0-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pre_commit_mirror_maker-1.6.0.tar.gz.

File metadata

  • Download URL: pre_commit_mirror_maker-1.6.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for pre_commit_mirror_maker-1.6.0.tar.gz
Algorithm Hash digest
SHA256 547c905bef47006f90ed69e14c3e27242da1b2b563bb075601c4813fe9bc3ae3
MD5 b3e352ebe65b63026b647801a9cd6efe
BLAKE2b-256 aaeca883a3bea2b864b6f5a2c47b2f4e339857e1869615189b9a40bd45afeec1

See more details on using hashes here.

File details

Details for the file pre_commit_mirror_maker-1.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pre_commit_mirror_maker-1.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for pre_commit_mirror_maker-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4e27e71fa3fbb4e90aa418c9bde38c8d68bd107c233f757b5aad3e5ef9af2f8c
MD5 1b219a5ae67c77ee4223bfbac8956902
BLAKE2b-256 d6cd88043befb1174bda9e73bd199795982c410ef3115212d610b302751d94ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page