Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 3.39 KB

CONTRIBUTING.md

File metadata and controls

78 lines (56 loc) · 3.39 KB

How to contribute

You can contribute to this project:

  • writing issues
  • contributing to the code basis

Writing issues

If you find some bug or you think some new feature could improve the package, please write an issue going to New Issue and follow the instructions under the corresponding template

Contributing to the code basis

We follow the nbdev framework for the literate programming development of this project. So if you want to contribute, please familiarize first with this framework. Specially, we write our code, tests and documentation at the same time in jupyter notebooks.

If you have not heard about nbdev yet and / or find the idea weird to develop in notebooks as it was the case for me, please watch the following youtube video first: I like notebooks by Jeremy Howard, the creator of this wonderful framework.

Setup the development environment

Prerequisites to setup the development environment:

  • conda

To setup the development environment:

  1. Fork this project repository, i.e., click on the "Fork" button on the right of the top of the repo page. This creates a copy of the project code on your GitHub user account.
  2. Clone your forked project from your GitHub account to your local disk and navigate into it:
git clone [email protected]:YourLogin/sql_formatter.git
cd sql_formatter
  1. Setup the upstream remote to be the original project repository (this one and not your forked one):
git remote add upstream https://github.com/PabloRMira/sql_formatter.git
  1. Synchronize your master branch with the upstream branch:
git checkout master
git pull upstream master
  1. Create a new branch to hold your development changes:
git checkout -b my_feature_branch
  1. Install our conda development environment running conda env create -f environment.yml
  2. Activate the python environment using conda activate sql-formatter-dev
  3. Run nbdev_install_git_hooks
  4. Run pip install -e . to install the package in editable mode. This way the command line interface (CLI) sql-formatter will incorporate your changes in the python code
  5. When your change is ready commit it, and push it to your fork
git add modified_files
git commit -m "some message"
git push -u origin my_feature_brach
  1. Follow these instructions to create a pull request from your fork.

Development Workflow

For development we follow these steps:

  1. Pick an existing issue and write in the comments you would like to fix it
  • If your idea is not documented in an issue yet, please write first an issue
  1. Create a branch from master and implement your idea
  2. Before pushing your solution run first make prepush to make sure everything is allright to merge, specially our tests
  3. Make a pull request for your solution
  • The pull request title should be meaningful, something like "[PREFIX] Title of the issue you fixed". Please try to use some of the following prefixes:
    • [FIX] for bugfixes
    • [FEA] for new features
    • [DOC] for documentation
    • [MNT] for maintenance

Only pull requests / commits using the aforementioned prefixes will be added to the changelog / release notes