Skip to content

Commit

Permalink
ENH: Add a clang-format file.
Browse files Browse the repository at this point in the history
Clang-format can be used to reformat C/C++ code for codestyle
fixups. The `.clang-format` file here implements the
NumPy codestyle document as much as possible.

Co-authored-by: Paul Ganssle <paul@ganssle.io>
  • Loading branch information
charris and pganssle committed Aug 26, 2021
1 parent 3712815 commit ecd74af
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
#
# Based on Paul Ganssle's version at
# https://gist.github.com/pganssle/0e3a5f828b4d07d79447f6ced8e7e4db
# and modified for NumPy
BasedOnStyle: Google
AlwaysBreakAfterReturnType: TopLevel
AllowShortIfStatementsOnASingleLine: false
AlignAfterOpenBracket: AlwaysBreak
BreakBeforeBraces: Stroustrup
ColumnLimit: 79
ContinuationIndentWidth: 8
DerivePointerAlignment: false
IndentWidth: 4
Language: Cpp
PointerAlignment: Right
ReflowComments: true
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
StatementMacros: [PyObject_HEAD, PyObject_VAR_HEAD, PyObject_HEAD_EXTRA]
TabWidth: 4
UseTab: Never

0 comments on commit ecd74af

Please sign in to comment.