Skip to content

Commit

Permalink
Implement config for clang-format and editors
Browse files Browse the repository at this point in the history
This creates a config file for the clang-format tool. It also establishes
a .editorconfig file to help establish the proper settings for editing
code in this project.

First step to resolving #125
  • Loading branch information
krader1961 authored and siteshwar committed Nov 30, 2017
1 parent 265f4ad commit 77c5037
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .clang-format
@@ -0,0 +1,22 @@
# Use the Google style with these modifications and a couple of others:
#
# 1) Lines can be up to 100 chars long rather than 80.
# 2) Use a four space indent rather than two spaces.
#
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4

# The following directives override defaults established above.

# We don't want OCLint pragmas to be reformatted.
CommentPragmas: '^!OCLINT'

# Allow slightly overlong lines.
PenaltyExcessCharacter: 10

# Don't try to infer the most common alignment of `&` and `*` by analyzing the
# source file. Use right alignment; i.e., bind to the symbol not the type.
DerivePointerAlignment: false
PointerAlignment: Right
13 changes: 13 additions & 0 deletions .editorconfig
@@ -0,0 +1,13 @@
root = true

[*]
indent_size = 4
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[{Makefile,*.in}]
indent_style = tab
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -15,7 +15,6 @@ before_install:
- docker pull ${OS_TYPE}

script:
- find \( -name \*.c -o -name \*.h \) -exec sh -c '! grep --color "^[[:space:]]*//" $@' find {} \+ && echo No line comments found...
- echo > build.sh "set -e;
export CFLAGS='-fno-strict-aliasing -Wno-unknown-pragmas -Wno-missing-braces -Wno-unused-result -Wno-return-type -Wno-int-to-pointer-cast -Wno-parentheses -Wno-unused -Wno-unused-but-set-variable -Wno-cpp -Wno-char-subscripts';
cd /source;
Expand Down

0 comments on commit 77c5037

Please sign in to comment.