2.7 KiB
2.7 KiB
Contributing to darktable
The darktable project welcomes contributions:
- Code
- Documentation
- Testing (and any backtraces if you happen to crash darktable)
- Translations
- Camera profiles.
- Tutorials, screencasts, etc.
See the darktable development page for more information.
Code
Before you spend a lot of time working on a new feature, it's always best to discuss your proposed changes with us first. The best place to do that is in our dev support matrix channel, or just create a Github Issue (Make sure to check back to answer follow up questions). This will dramatically improve your chances of having your code merged, especially if we think you'll hang around to maintain it.
For more places to discuss darktable, see here for more information.
Coding style
We like our code to be properly formatted. We have a well-defined coding style, and .clang-format style file represents it fully. You can enforce your commits to follow it:
- Install clang-format clang tool. Probably, any version will be ok, but the newer the better.
- You'll need to integrate
gitandclang-format.
- For that, you will need to download
git-clang-formatfrom here or here. - Read it to check for nastiness.
- Warning: apparently, it only works with Python2, and does not work with Python3!
- Put it somewhere in your path (e.g.
~/binor/usr/local/bin) and ensure that it is executable (chmod +x).
- Now, step into your local clone of repository:
cd darktable/.git/hooks- If you previously did not have a
pre-commithook:cp pre-commit.sample pre-commit && chmod +x pre-commit
- Open
pre-commitwith your favourite text editor, and append before the last block, here is how the end should look:
# format everything
res=$(git clang-format --diff | wc -l)
if [ $res -ne 1 ]
then
git clang-format
echo "Commit did not match clang-format"
exit 1;
fi
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
- Also, there is a Developer's Guide on our GitHub wiki, which includues some Coding Style guidelines.