-
Notifications
You must be signed in to change notification settings - Fork 93
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
configuration for white-space #724
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
15d726f
add .clang-format, precommit hooks and minimal doc
KrisThielemans c10c303
remove use of sudo for pip instructions
KrisThielemans 922031d
reduced keys .clang-format [ci skip]
KrisThielemans 0810225
White space config (#3)
casperdcl 43b98e9
Apply suggestions from code review in #724 [ci skip]
KrisThielemans File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
Language : Cpp | ||
# BasedOnStyle : GNU | ||
AlwaysBreakAfterReturnType: TopLevelDefinitions | ||
AlwaysBreakTemplateDeclarations: true | ||
BraceWrapping: | ||
SplitEmptyFunction: false | ||
ColumnLimit: 130 | ||
IndentPPDirectives: AfterHash | ||
PointerAlignment: Left | ||
SortIncludes: false | ||
SortUsingDeclarations: false | ||
SpaceBeforeParens: ControlStatements | ||
Standard: Cpp11 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Check | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
name: pre-commit | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- run: sudo apt-get install -yqq clang-format | ||
- uses: pre-commit/action@v2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
repos: | ||
- repo: git://github.com/doublify/pre-commit-clang-format | ||
rev: '62302476' | ||
hooks: | ||
- id: clang-format | ||
files: \.(c|cc|cxx|cpp|h|hpp|hxx|inl|txx)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Information specific for developers | ||
|
||
Please check files here for information/code practices for developers. | ||
|
||
- Do read our [contribution guidelines](../../CONTRIBUTING.md) | ||
- Set your editor settings appropriately: [instructions](editor-settings.md) | ||
- Install git hooks for serious development: [instructions](git-hooks.md) | ||
- Read the documentation, including the STIR developers guide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Developer documentation: editor settings | ||
|
||
White-spaces and indentation with multiple developers are a pain. Please adhere to | ||
our white-space policy, which we try to enforce via [clang-format](https://clang.llvm.org/docs/ClangFormat.html). | ||
Check that site for integration with your editor/IDE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Developer documentation: how to install (software for) git hooks | ||
|
||
You first need to have Python and pip | ||
|
||
## Install [pre-commit](https://pre-commit.com) | ||
See https://pre-commit.com/#install but the following might work. | ||
|
||
pip install pre-commit | ||
|
||
If this fails with a permission error, try adding `--user` to the command. | ||
|
||
If that fails with a message about `PyYAML` and `distutils`, try | ||
|
||
pip install --ignore-installed PyYAML | ||
|
||
## Install clang-format | ||
### debian/Ubuntu | ||
sudo apt install clang-format | ||
### MacOS | ||
brew install clang-format | ||
### Others | ||
search the internet and tell us | ||
|
||
## Enable pre-commit hooks | ||
```sh | ||
cd /whereever/STIR | ||
pre-commit install | ||
``` | ||
KrisThielemans marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If you need to work with a branch that was forked prior to in inclusion of clang-format, you will need to temporarily disable/uninstall pre-commit again: | ||
|
||
pre-commit uninstall | ||
|
||
or once-off with | ||
|
||
git commit --no-verify |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or
git commit --no-verify