No project description provided
Project description
rcmt
rcmt automates refactorings across many repositories.
Write Python code to define how the content of files should look like. Then let rcmt apply the changes across repositories and create pull requests.
Features
- Mass Refactoring - create, update or delete files across many repositories.
- Automation - automatic creation of merge requests in repositories; optionally merge them automatically if approved and all checks have passed.
- Flexibility - call third-party APIs or integrate libraries.
The Task file
A Task file tells rcmt which repositories to modify. It is written in Python.
from rcmt import Task, Context, register_task
# Replace with your repository.
REPOSITORY = "github.com/wndhydrnt/rcmt-example"
# A Task bundles the code that determines which repositories to modify and how to modify
# them. It is a regular Python class that extends the base class `Task`.
class HelloWorld(Task):
name = "hello-world"
pr_title = "rcmt Hello World"
pr_body = """This pull request has been created as part of the how-to guide:
https://rcmt.readthedocs.io/get-started/create-a-task/
"""
# The `filter` method determines which repositories to modify. It is called by rcmt
# for each repository.
def filter(self, ctx: Context) -> bool:
return ctx.repo.full_name == REPOSITORY
# The `apply` method contains the code that modifies files in a repository. In this
# example, the `own` function creates the file `hello-world.txt` with the content
# `Hello World` in the root of the repository. `target` is not an absolute path
# because rcmt automatically sets the current working directory (`cwd`) to the
# checkout of the repository.
def apply(self, ctx: Context) -> None:
with open("hello-world.txt", "w+") as f:
f.write("Hello World")
# Register the task with rcmt so rcmt knows about it.
register_task(HelloWorld())
What's next
Contributing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rcmt-0.30.0.tar.gz.
File metadata
- Download URL: rcmt-0.30.0.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdab03f5269abc84b255fb737fe7fb8d75f635f44497efd500ae39f575ea662a
|
|
| MD5 |
9bba9d0e6371c7eb6e78dced4159e20d
|
|
| BLAKE2b-256 |
b45df205ce64e23d02c619d03aad7a707b0af15381d169350fd6281379375ebc
|
File details
Details for the file rcmt-0.30.0-py3-none-any.whl.
File metadata
- Download URL: rcmt-0.30.0-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b0e8f633b072be42582baa985cbbe84b666338174fbec3d20cdd105afaccb4
|
|
| MD5 |
167980df34d80c36e16200df9b480cc8
|
|
| BLAKE2b-256 |
0f7892a688dc1d0c6f9bd4c6f90a3d4f742465415f9d4d33d487fb5bf909a26b
|