This is a guide for developers who would like to contribute to this project. It is recommended to use Python 3.10 and above for development.
If you're interested in contributing to litecli, thank you. We'd love your help! You'll always get credit for your work.
-
Fork the repository on GitHub.
-
Clone your fork locally:
$ git clone <url-for-your-fork>
-
Add the official repository (
upstream
) as a remote repository:$ git remote add upstream [email protected]:dbcli/litecli.git
-
Set up a virtual environment for development:
$ cd litecli $ python -m venv .venv
We've just created a virtual environment that we'll use to install all the dependencies and tools we need to work on litecli. Whenever you want to work on litecli, you need to activate the virtual environment:
$ source .venv/bin/activate
When you're done working, you can deactivate the virtual environment:
$ deactivate
-
Install the dependencies and development tools:
$ pip install --editable .[dev]
-
Create a branch for your bugfix or feature based off the
main
branch:$ git checkout -b <name-of-bugfix-or-feature>
-
While you work on your bugfix or feature, be sure to pull the latest changes from
upstream
. This ensures that your local codebase is up-to-date:$ git pull upstream main
-
When your work is ready for the litecli team to review it, push your branch to your fork:
$ git push origin <name-of-bugfix-or-feature>
-
Create a pull request on GitHub.
While you work on litecli, it's important to run the tests to make sure your code hasn't broken any existing functionality. To run the tests, just type in:
$ tox
Some CLI tests expect the program ex
to be a symbolic link to vim
.
In some systems (e.g. Arch Linux) ex
is a symbolic link to vi
, which will
change the output and therefore make some tests fail.
You can check this by running:
$ readlink -f $(which ex)
Litecli uses ruff to format the source code.
To check the style and fix any violations, run:
$ tox -e style
Be sure to commit and push any stylistic fixes.