Skip to main content

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 to 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

You can either:

  • Run the setup script (can replace python3 with whatever command you use):
python3 ./scripts/setup.py
  • Or, which is effectively the same, with less checks (can replace python3 with 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

legitcli-0.1.5.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

legitcli-0.1.5-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file legitcli-0.1.5.tar.gz.

File metadata

  • Download URL: legitcli-0.1.5.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.8.18 Darwin/23.0.0

File hashes

Hashes for legitcli-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3c20c96847c8cf2f8b4f5bd4b68d2554a28c7596de04f3930b4e08afe4c1df45
MD5 868c8ce1cb811acbe3f6073fc554aa67
BLAKE2b-256 35d1ea5fc9c7b30588de20a49795512f258e6b30b7f953cbb3682e3a409feb6a

See more details on using hashes here.

File details

Details for the file legitcli-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: legitcli-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.8.18 Darwin/23.0.0

File hashes

Hashes for legitcli-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7c1fb01fda5551d2433de58ee16395377eff13a6ddde421bae7fc2da2cd67215
MD5 84aca12d05c1e67a46d59f67e6330792
BLAKE2b-256 dd07aa3c5867ff76aa0c4c9b30daa50088996851be65a96dc7b92ec1416b5814

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