Skip to content

Commit a35c7c2

Browse files
committed
style: adding clang-format as manual hook
1 parent 7b7ec66 commit a35c7c2

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

.clang-format

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# See all possible options and defaults with:
3+
# clang-format --style=llvm --dump-config
4+
BasedOnStyle: LLVM
5+
AccessModifierOffset: -4
6+
AlignConsecutiveAssignments: true
7+
AlwaysBreakTemplateDeclarations: Yes
8+
BinPackArguments: false
9+
BinPackParameters: false
10+
BreakBeforeBinaryOperators: All
11+
BreakConstructorInitializers: BeforeColon
12+
ColumnLimit: 99
13+
IndentCaseLabels: true
14+
IndentPPDirectives: AfterHash
15+
IndentWidth: 4
16+
Language: Cpp
17+
SpaceAfterCStyleCast: true
18+
# SpaceInEmptyBlock: true # too new
19+
Standard: Cpp11
20+
TabWidth: 4
21+
...

include/pybind11/iostream.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ PYBIND11_NAMESPACE_END(detail)
104104
.. code-block:: cpp
105105
106106
{
107-
py::scoped_ostream_redirect output{std::cerr, py::module_::import("sys").attr("stderr")};
108-
std::cerr << "Hello, World!";
107+
py::scoped_ostream_redirect output{
108+
std::cerr,
109+
py::module::import("sys").attr("stderr")
110+
};
109111
}
110112
\endrst */
111113
class scoped_ostream_redirect {

setup.cfg

+1-6
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@ ignore =
4343
docs/**
4444
tools/**
4545
include/**
46-
.appveyor.yml
47-
.cmake-format.yaml
48-
.gitmodules
49-
.pre-commit-config.yaml
50-
.readthedocs.yml
51-
.clang-tidy
46+
.*
5247
pybind11/include/**
5348
pybind11/share/**
5449
CMakeLists.txt

0 commit comments

Comments
 (0)