Skip to content

Latest commit

 

History

History
executable file
·
49 lines (31 loc) · 1.88 KB

CONTRIBUTING.md

File metadata and controls

executable file
·
49 lines (31 loc) · 1.88 KB

Contributing to iMIX

All kinds of contributions are welcome, including but not limited to the following.

  • Fixes (typo, bugs)
  • New features and components

Workflow

  1. fork and pull the latest iMIX repository
  2. checkout a new branch (do not use master branch for PRs)
  3. commit your changes
  4. create a PR

Note: If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.

Code style

Python

We adopt PEP8 as the preferred code style. And we use pre-commmit hook to identify simple issues before submission to code review.

The pre-commit hooks for linting and formatting are as follows:

  • flake8: a package three tools: PyFlakes, Pep8, McCabe. It can check the not standard place of code.
  • yapf: check and format Python files.
  • docformatter: A formatter to format docstring.
  • pre-commit-hooks: other check hooks like trailing-whitespace, check-yaml, end-of-file-fixer and so on.

The config for a pre-commit hook is stored in .pre-commit-config.

Style configurations of flake8, yapf and isort can be found in .flake8, .style.yapf, .isort.cfg

After you clone the repository, you will need to install initialize pre-commit hook.

pip install pre-commit  # install  pre-commit package manager
pre-commit  # initialize and install the pre-commit hooks

From the repository folder

pre-commit install  # set up the git hook scripts

After this on every commit check code linters and formatter will be enforced.

Before you create a PR, make sure that your code lints and is formatted by yapf.