mk
Project description
mk
mk
is a CLI tool that aims to ease contribution to any open-source project
by hiding repository implementation details from the casual contributor.
With it, you can contribute without having to know all the build
and testing tools that the project team already uses, which often have
strange requirements.
If you ever asked yourself one of the below questions, probably you would
want to try mk
and if it can help you
- How do I run tests locally?
- Which are the test suites I can run?
- Is my change ready to be reviewed?
- How can I propose a change for review?
Run mk
inside any cloned repository to display which options you have. No
configuration file is needed as the tool will look for
common tools used by the repository and expose their commands.
mk
is inspired by the tools listed below, but it does not aim to replace them.
Installation
We recommend using pipx
to install
mk
in order to avoid potential dependency conflicts. You can use
pip3 install mk
as well.
pipx install mk
Run it
$ mk
Usage: mk [OPTIONS] COMMAND [ARGS]...
Options:
--version
-v, --verbose Increase verbosity. [default: 0]
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or
customize the installation.
--help Show this message and exit.
Commands:
detect Display detected information about current project.
lint ... (from pre-commit)
lint2 ... (from tox)
packaging ... (from tox)
py ... (from tox)
up Upload current change by creating or updating a CR/PR.
How it works
mk
inspects the current core repository and detects build tools used
by the project, like pre-commit, tox, npm and exposes their commands to
the user in a predictable way.
For example, you should be able to lint any code repository running only
mk lint
, regardless of author preference for picking one way to execute
them or another.
Be assured that mk
does not make use of AI to guess what needs to
run. As most projects use relatively similar patterns, it is easy to identify
the one to execute.
At this moment, if two tools expose the same command name, the tool will add a number to its name. In the future, we may decide to either chain them under a single name or allow some tools to shadow others and avoid duplicates.
What are the main benefits
One of the benefits of mk
is that it should reduce the amount of
how-to-contribute documentation the author needs to write.
A considerable amount of maintainer effort can go into producing documentation that makes it easier for someone to make a contribution to a project.
Some projects are less affected than others. That is usually related to how well do the potential contributors know the practices used by the project. Still, if your project has a wide range of uses, you will quickly discover that newbie contributors may hit a knowledge wall. Such a barrier will likely prevent most of them from becoming active contributors. The remaining ones will flood the project with questions, distracting other maintainers from doing more advanced tasks.
Unless you want to deter contributions, you should plan to make it as easy as
possible for people to contribute. That is one area where mk
aims to help.
Using mk to propose changes to projects
Instead of writing long list of tasks to follow, we can use a tool that
tells him what to do next. For example, mk
has a build-in command named
up(load)
that aims to ease preparing a local change from being
proposed to the project.
This command detects if it should use GitHub workflow or Gerrit and will run the appropriate commands for opening or updating a CR/PR. Users will be allowed to upload a change only after passing the minimal set of local tests, preventing noisy mistakes or clog CI/CD pipelines.
In addition to linting, it will also check that the repository is not in dirty status or that the testing did not leave untracked files on disk.
Planned features
- Allow command aliases like git. If you type
mk l
it should directly run lint unless there is another command starting withl
. (#19) - Persistent state of each command run - This means that it will know if a specific command was run and if it failed or not. The state would be linked to the repository state, so modifying a tracked file would reset the state to be unknown. (#20)
- Configuration file where additional actions can be added. (#21)
- Dependencies between commands. While some tools support dependencies, many do not. You should be able to declare that a specific command would run only after another one already passed. (#22)
- Ability to generate CI/CD pipelines so the user would spend less time writing non-portable configuration. (#23)
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
File details
Details for the file mk-1.0.5.tar.gz
.
File metadata
- Download URL: mk-1.0.5.tar.gz
- Upload date:
- Size: 47.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | def02bde6abd5a5e4f82726d5f41c3093b4db3a3f9004433acbb130e366183aa |
|
MD5 | 1769b9a6c8ddbc2129d7123dffa57506 |
|
BLAKE2b-256 | 352a31848f72e779f393c5660b3fe59e9b52b7de5ff073c544bfdae1b6ec7591 |
File details
Details for the file mk-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: mk-1.0.5-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68341b9e729f7483016a975f14c2de7b5c625177c23c0e6cf2c1daa787ebcca9 |
|
MD5 | 237e86d4a30629b5766e463a5b942e2e |
|
BLAKE2b-256 | ef81de273276d1c23313c0b335cce4eec8509b84cb953c2edfd2767d5d8bc44a |