Skip to content

Developer Guide

Yourun edited this page Apr 11, 2022 · 6 revisions

Developer Guide

A guide for me, and for everyone who wants to contribute to kefir, how to properly contribute kefir.

First-time setup

In the beginning, just follow the instructions from here. But I'll still reproduce.

Fork my kefir from github

just touch Fork button

Clone your fork from github

git clone https://github.com/Yourun-proger/kefir.git
cd kefir

Add fork origin

git remote add fork https://github.com/{your_name}/kefir.git

Receive fresh changes

git fetch origin

Create your own branch

git checkout -b your_branch

Enable venv

On Windows:

> py -m venv env
> env\scripts\activate

On MacOS/Linux:

$ python3 -m venv env
$ . env/bin/activate

Update pip and setuptools

py -m pip install -U pip setuptools

On Unix-based you need python or python3 instead of py

Install tox

pip install tox==3.24.5

That's all about setup

Git flow

  1. Your change
    • do your change
    • write about changes in the changelog

2. Push it to main right nooow!!!

True 2.

Run test workflow:

$ tox -e py{your_version}

your_version = 38 if you have 3.8 e.t.c.

Run linters

$ tox -e lint

If not all is ok run black:

$ tox -e format

Commit and push

  1. Commit changes with good commit message (len <= 35)

  2. Push it to branch or to main =_=

Create pull request

Just touch Compare and create pull request button. Now all PR go to main branch

Wait

Just wait. Or do some fix if i reviewed PR.

How to squash commits

I don't know this is really important, but why not. Let's go

git rebase -i HEAD~(num of last commits for squash)

Then you go to vim or emacs or visual studio code or notepad++ or something else, where you try to squash commits.

First commit is better when it isn't changed. Others change to s or to squash.

Then you save message only for first commit, others delete right now!

and finally:

git push -f fork your_branch

Congrats! Your pull request was merged (closed)

Good xp for you and for me