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

added .clang-format and formatted example file #19

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

zebastian
Copy link

The style described in this .clang-format file can be used to auto format the source code. I looked at a couple of files, and this file should be quite close to what the general style in the project looked.
You will need to install clang-format (sudo apt-get install clang-format [or any other package manager])
Then you can apply this style to any file with

clang-format --style=file -i path/to/file.h

Please let me know, what you think of this.

This .clang-format file can be used to autoformat the source code for
vcglib

I assumed the general indentation is done with 4 spaces, since this was
mostly used.
Any differing taste of style should be expressable in the .clang-format
file.

The example file has been formatted with:
```
clang-format --style=file -i vcg/complex/algorithms/parametrization/
uv_utils.h
```

also added full path name include guards (VCG_[path to file in uppercase
and underscore delimiter]). This can be used as a global rule to avoid
collisions.
alemuntoni added a commit that referenced this pull request Aug 23, 2021
@alemuntoni
Copy link
Member

Thanks @zebastian, and sorry for the very late reply!
I didn't know about clang-format, it seems a very useful tool! I'll look into it and I'll slowly apply it on vcg and meshlab!

@zebastian
Copy link
Author

@alemuntoni glad you like it, its been a while i looked into clang-format :-)
Let me know if you have any questions...

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