No project description provided
Project description
LeGit CLI
LeGit aims to validate your git commits, based on scopes defined by you, such as branch names or authors.
Install
Currently, the only way to install LeGit CLI is through Python's pip. Make
sure that your Python version is 3.8 or higher and run:
pip install legitcli
And that's it, you can verify if installation was succesful by running
legit version
Usage
Open a terminal on any git repository and run
legit setup
This will add legit as a commit hook and will call it on every commit you
attempt to do. It will also create a legitrules.yml file which will dictate
which rules to apply(documentation on this is a WiP, for now, you can check some
samples)
And that's it, you're set, any commits will do will first be validated using the rules file!
However, if you'd like to debug or do some tests mainly on legitrules.yml, you
can run the following, which will have no impact on your commits (requires a
text file to be given, which would be the file with the commit message):
legit validate --verbose --rules-file legitrules.yml COMMIT_MESSAGE_TEXT_FILE
For Contributors
This project uses poetry as its package manager. You don't necessarily need
poetry as you can simply install required packages with pip and run the
project directly from the main entry point. However,
you'll require poetry to run tests, and it makes life easier to use this
project.
Setup
To setup a python virtual environment with all project depencencies defined in the pyproject TOML file, you can:
- Run the setup script (can replace
python3with whatever command you use to run Python):
python3 ./scripts/setup.py
- Or, which is effectively the same, with less checks (can replace
python3with whatever command you use):
python3 -m venv .venv
poetry env use .venv/bin/python
poetry install --with dev
Running Code
To check that setup was successfuly, you can simply run:
poetry run legit
This should output the command's help and usage. To test the main validation flow, you can do something like below:
poetry run legit validate --verbose --rules-file resources/rulefiles/samples/simple.yml resources/message/short_message.txt
Overall poetry run legit is equivalent to legit on release, so you can use
this command to test anything as it would run on release.
To run tests:
poetry run pytest
Finally, to check that build works (does not include tests):
poetry build
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
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 legitcli-0.1.7.tar.gz.
File metadata
- Download URL: legitcli-0.1.7.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
504140f29e1e0b10fc0f2ca1b9aad7b71802bfd55db69168146580401be60849
|
|
| MD5 |
9a42d2b1605ee076826e5e67a3652601
|
|
| BLAKE2b-256 |
c257fb62238102219e80d0d769654f27a20f083c76616d298a8f05a07b778713
|
File details
Details for the file legitcli-0.1.7-py3-none-any.whl.
File metadata
- Download URL: legitcli-0.1.7-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff2ba17552c9e663518ba0837acf886967e4f1c20ca70e9b50161b397073f8e5
|
|
| MD5 |
f6cf00de7278e063a11b914878a11a29
|
|
| BLAKE2b-256 |
4309fc84b379553f780d5611f9ffef3353fb5efde5192d0f4183b28f77942240
|