Commit ef3a2f02 authored by Chet Nieter's avatar Chet Nieter

Copying hooks and CONTRIBUTING.md from qt-viewer.

Copying the pre-commit hook script, git attribute file for flake8
merge check and new CONTRIBUTING.md from qt-viewer. Small changes
were made to CONTRIBUTING.md so the repo references match.
parent 8a9e5c0d
#!/bin/sh
# Test for flake8
which flake8 > /dev/null 2>&1
if [ $? != 0 ]; then
echo 'To enable pep-8 validation install flake8 and then run setup-hooks.sh'
exit 0
fi
files=`git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$'`
if [ -z "$files" ]
then
exit 0
else
output=`flake8 $files`
status=$?
if [ ${status} != 0 ]; then
echo 'PEP8 errors found in commit:'
echo "$output"
fi
fi
exit 0
*.py format.flake8
Contributing to Cinema
======================
This page documents at a very high level how to contribute to Cinema.
This page documents at a very high level how to contribute to Cinema. The
Cinema development cycle is built upon the following components:
Setup
-----
1. [Issues][] identify any issues including bugs and feature requests. In
general, every code change should have an associated issue which identifies
the bug being fixed or the feature being added.
For information about setting up a gitlab account and how to fork this project go [here][VTK_contributing] and [here][VTK_develop].
2. [Merge Requests][] are collections of changes that address issues.
Workflow
--------
Reporting Issues
================
Cinema development uses a [branchy workflow][branchy] equivalent to [that one used in projects like VTK][VTK_develop], based on a master branch and different topic branches. The master branch always reflects a state with the latest delivered development changes and is the place from where topic branches are branched and merged to. It should always be in a stable state.
If you have a bug report or a feature request for ParaView, you can use the
[Issues][] tracker to report a [new issue][].
[branchy]: https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/git/develop.md
To report an issue.
[VTK_contributing]: https://gitlab.kitware.com/vtk/vtk/blob/master/CONTRIBUTING.md
1. Register [GitLab Access] to create an account and select a user name.
[VTK_develop]: https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/git/develop.md
2. Create a [new issue][].
3. Ensure that the issue has a **Title** and **Description**
with enough details for someone from the development team to reproduce the
issue. See [Gitlab Markdown] guide for styling the **Description**. Include
screenshots and sample datasets whenever possible.
Fixing issues
=============
Typically, one addresses issues by writing code. To start contributing to a
Cinema project:
1. Register for [GitLab Access] to create an account and select a user name.
2. Fork the relevant repository into your user's namespace on GitLab.
3. Create a local clone of the relevant Cinema repository from your fork.
Optionally configure Git to [use SSH instead of HTTPS][]. For example if
you are working on an issue in the `Cinema/cinema_python` repository:
$ git clone https://gitlab.kitware.com/<username>/cinema_python.git cinema_python
4. Create a topic branch and edit files and create commits to resolve the
issue (repeat as needed):
Style
-----
$ edit file1 file2 file3
$ git add file1 file2 file3
$ git commit
Aim for PEP8 style compliance. flake8 should not report any violations in the library.
Commit messages must be thorough and informative so that reviewers will
have a good understanding of why the change is needed before looking at the
code. Appropriately refer to the issue number, if applicable. Cinema
development uses a [branchy workflow][branchy] equivalent to the one used
in projects like [VTK][VTK_develop], based on a master branch and different
topic branches.
Please make sure your python code follows the [PEP 8] style guidelines.
The [flake8] tool is a good way to check for violations. If you run the
`./setup-hooks.sh` after cloning a Cinema repo it will setup pre-commit
checks with flake8 if you have the tool installed.
5. Depending on the repository you are working with run tests with ctest
directly or replace the [vtkcinema_python] submodule in [ParaView] with
your branch and run the Cinema tests in ParaView:
$ ctest -R Cinema
6. Push your commits in your topic branch to your fork in gitlab.
7. [Create a Merge Request][] and solicit feedback from other Cinema developers.
8. Once another Cinema developer has signed off on your changes then you can
have the kwrobot merge your changes:
$ do: merge
[GitLab Access]: https://gitlab.kitware.com/users/sign_in
[Gitlab Markdown]: https://gitlab.kitware.com/help/markdown/markdown
[use SSH instead of HTTPS]: Documentation/dev/git/download.md#use-ssh-instead-of-https
[Issues]: https://gitlab.kitware.com/groups/cinema/issues
[Merge Requests]: https://gitlab.kitware.com/groups/cinema/merge_requests
[new issue]: https://gitlab.kitware.com/groups/cinema/issues/new
[vtkcinema_python]: https://gitlab.kitware.com/paraview/paraview/tree/master/ThirdParty/cinema
[ParaView]: https://gitlab.kitware.com/paraview/paraview
[PEP 8]: https://www.python.org/dev/peps/pep-0008/
[flake8]: http://flake8.pycqa.org/en/latest/#
[Create a Merge Request]: Documentation/dev/git/develop.md#create-a-merge-request
[branchy]: https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/git/develop.md
[VTK_develop]: https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/git/develop.md
#!/bin/sh
curr_dir="$(pwd)"
target_file=${curr_dir}/.git/hooks/pre-commit
source_file=${curr_dir}/.git-hooks/pre-commit
if [ -f $target_file ]; then
echo "Please move current $target_file out of the way first."
else
ln -s $source_file $target_file
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment