Skip to main content

Checkout repos to current cookiecutter config

Project description

License PyPI CI pre-commit.ci status CodeQL codecov.io readthedocs.org python3.8 Black pylint Known Vulnerabilities

Checkout repos to current cookiecutter config

Checkout one or more repos to current cookiecutter config

This will make changes to local repositories, hopefully preserving their history

Ideally only the working tree will change

Ignored files should be backed up

Use with caution

Usage

usage: repocutter [-h] [-v] [-a] [-c] [-b REV,NEW] [-i LIST] PATH [REPOS [REPOS ...]]

Checkout repos to current cookiecutter config

positional arguments:
  PATH                          path to cookiecutter template dir
  REPOS                         repos to run cookiecutter over

optional arguments:
  -h, --help                    show this help message and exit
  -v, --version                 show program's version number and exit
  -a, --accept-hooks            accept pre/post hooks
  -c, --gc                      clean up backups from previous runs
  -b REV,NEW, --branch REV,NEW  checkout new branch from existing revision
  -i LIST, --ignore LIST        comma separated list of paths to ignore, cookiecutter vars are allowed

Configuration

Currently only written for a configuration exactly like below

Technically a repo would not need to be a poetry project if the below section exists within its pyproject.toml file

This is the only use case at this time (If there are any other configurations you would like added please leave an issue)

Each repository’s pyproject.toml file will be parsed for data to recreate its working tree

A poetry section in the project’s pyproject.toml file that looks like the following…

[tool.poetry]
description = "Checkout repos to current cookiecutter config"
keywords = [
  "config",
  "cookiecutter",
  "jinja2",
  "repo",
  "template"
]
name = "repocutter"
version = "0.2.0"

…will temporarily write to the cookiecutter project’s cookiecutter.json file until the repo is created

{
  "project_name": "repocutter",
  "project_version": "0.2.0",
  "project_description": "Checkout repos to current cookiecutter config",
  "project_keywords": "config,cookiecutter,jinja2,repo,template",
}

The above configuration will reduce the diff, but it will still work if your config is not exactly the same

Why?

As time goes on, and you use cookiecutter for new projects, you will make more and more changes to your cookiecutter repo

You will find these new project layouts are preferable to your older, more outdated, projects

If you have a project layout configured with cookiecutter then it’s likely you will want this layout for all your projects

Configuring your existing projects manually is even more tedious than configuring a new project manually, especially if you have a lot of them

By checking out your projects to your configured cookiecutter layout, you can use whatever diff tool you use to rollback any undesired changes

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

repocutter-0.6.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

repocutter-0.6.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file repocutter-0.6.0.tar.gz.

File metadata

  • Download URL: repocutter-0.6.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.13 Darwin/22.2.0

File hashes

Hashes for repocutter-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f248abd2e7865a655471fbdb7c94221651fec98de5ed43ad0d0a43d7608c1212
MD5 6ec94afb624e8febcd1603d342ba572f
BLAKE2b-256 a48b1845e0c0e266c8ead54c4f3f0ff2bdeaa7f4c888dc87284ea38cebeb87ab

See more details on using hashes here.

File details

Details for the file repocutter-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: repocutter-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.13 Darwin/22.2.0

File hashes

Hashes for repocutter-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a84cb37cf40ef5839038e8ac19731e69cf0f5ba2cd5a401bfd085b8737d370d7
MD5 3a518226d08af724fbd244256f3df4df
BLAKE2b-256 32422e4349b0dfeaa0e319a3e979a0e3337eb6dfef5faeeefb206a0dfa042a48

See more details on using hashes here.

Supported by

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