Skip to content

Commit

Permalink
Add CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
y-yu committed Jun 19, 2020
1 parent e6b5561 commit cfa34f4
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

## Pull Request Process

When you want to contribute to this project,
please first discuss the change you wish to make via GitHub Issue.

1. Check that your patch is legal under the [LICENCE](https://github.com/qulacs/qulacs/blob/master/LICENSE).
2. Test and format in your computer.
- If you want to know how to do it please see `How to format and test` section below.
3. PR to the `dev` instead of `master` branch.
- Because we use `master` branch as the release branch.

## How to format and test

You should format and test in your computer before you submit a PR.
First you have to install [dependecies](https://github.com/qulacs/qulacs#requirement) and [clang-format](https://clang.llvm.org/docs/ClangFormat.html) (version 9) to your computer
before you build and test your patch.
And you execute these commands at the root directory of this project:

### For macOS and Linux

```console
$ git ls-files "*.cpp" | xargs clang-format -style=file -i
$ ./script/build_gcc.sh
$ python setup.py install
$ cd build
$ make test
$ make pythontest
```

### For Windows

```console
$ git ls-files "*.cpp" | xargs clang-format -style=file -i
$ ./script/build_msvc_2015.bat
$ python setup.py install
$ cmake --build ./visualstudio --target test --config Release
$ cmake --build ./visualstudio --target pythontest --config Release
```

### Tips

- We only check the format in Linux. Travis CI could point out format errors even if there is no error in your Windows or macOS.
- CI requires `clang-format` version 9 so you should use the same version of `clang-format` to avoid some trouble.
- We recommend use Python from [pyenv](https://github.com/pyenv/pyenv) and [vertualenv](https://pypi.org/project/virtualenv/) for the local test.
- Since we run `python setup.py install` at global Python unstable qulacs would be installed unintentionally.
- And it would be difficult to show dependencies version when we need for debug

0 comments on commit cfa34f4

Please sign in to comment.