Skip to content

Commit

Permalink
Merge pull request #214 from Quansight-Labs/clang-format
Browse files Browse the repository at this point in the history
Add clang-format file and update code style
  • Loading branch information
hameerabbasi committed Oct 25, 2019
2 parents b23faea + e1e01fa commit e19d05e
Show file tree
Hide file tree
Showing 4 changed files with 546 additions and 649 deletions.
18 changes: 18 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
BasedOnStyle: LLVM
SpaceBeforeCtorInitializerColon: false
DerivePointerAlignment: false
PointerAlignment: Middle
ColumnLimit: 80
AlwaysBreakTemplateDeclarations: true
AlignAfterOpenBracket: AlwaysBreak
AlwaysBreakAfterReturnType: None
AllowAllParametersOfDeclarationOnNextLine: true
BinPackParameters: true
PenaltyReturnTypeOnItsOwnLine: 1000
IndentPPDirectives: AfterHash
MaxEmptyLinesToKeep: 2

# Macros that aren't followed by a semi-colon
StatementMacros:
- PyObject_HEAD
5 changes: 5 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
vmImage: 'ubuntu-16.04'
steps:
- template: ci/azure-test-scipy-fft.yml
- job: clang_format
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: ci/azure-run-clang-format.yml


trigger:
Expand Down
16 changes: 16 additions & 0 deletions ci/azure-run-clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
steps:
- bash: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main"
sudo apt-get update
sudo apt-get install -y clang-format-8
displayName: Install clang-format
- bash: |
clang-format-8 -i uarray/_uarray_dispatch.cxx
DIFF=$(git diff)
if [ $DIFF != "" ]; then
echo "Detected formatting errors, suggested changes below:"
git diff
exit 1
fi
displayName: Run clang-format

0 comments on commit e19d05e

Please sign in to comment.