Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consistent formatting using clang-format #74

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fancycode
Copy link
Member

In order to get a consistent code format, I suggest using clang-format to format files.

This PR contains a configuration file with formatting definitions (see http://releases.llvm.org/3.9.0/tools/clang/docs/ClangFormatStyleOptions.html for further details) and integrates clang-format in the Makefile, pre-commit hook and Travis tests.
The actual formatting is in a separate commit to make reviewing / cherry-picking the changes easier.

Please let me know what you think, imho a consistent code style helps a lot with readability.

NOTE: You can even integrate it with emacs: https://clang.llvm.org/docs/ClangFormat.html#emacs-integration 😃

- Support running `make format` to format files locally.
- Check format in pre-commit hook.
- Check format on Travis.
@farindk
Copy link
Contributor

farindk commented Aug 31, 2018

Sorry, I'm no proponent of automatic formatting. Just have a look how it destroys all the tables I added in the heif.h comments and intentional paragraphs. I like to have variable number of empty lines to indicate code section, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants