Commit cc4efe69 by Wenzel Jakob

more code style checks in Travis CI :)

parent fe40dfe6
...@@ -27,7 +27,6 @@ public: ...@@ -27,7 +27,6 @@ public:
if (!src_ || !PyCallable_Check(src_.ptr())) if (!src_ || !PyCallable_Check(src_.ptr()))
return false; return false;
{
/* /*
When passing a C++ function as an argument to another C++ When passing a C++ function as an argument to another C++
function via Python, every function call would normally involve function via Python, every function call would normally involve
...@@ -47,7 +46,6 @@ public: ...@@ -47,7 +46,6 @@ public:
return true; return true;
} }
} }
}
object src(src_, true); object src(src_, true);
value = [src](Args... args) -> Return { value = [src](Args... args) -> Return {
......
...@@ -693,8 +693,8 @@ struct field_descriptor { ...@@ -693,8 +693,8 @@ struct field_descriptor {
inline PYBIND11_NOINLINE void register_structured_dtype( inline PYBIND11_NOINLINE void register_structured_dtype(
const std::initializer_list<field_descriptor>& fields, const std::initializer_list<field_descriptor>& fields,
const std::type_info& tinfo, size_t itemsize, const std::type_info& tinfo, size_t itemsize,
bool (*direct_converter)(PyObject *, void *&)) bool (*direct_converter)(PyObject *, void *&)) {
{
auto& numpy_internals = get_numpy_internals(); auto& numpy_internals = get_numpy_internals();
if (numpy_internals.get_type_info(tinfo, false)) if (numpy_internals.get_type_info(tinfo, false))
pybind11_fail("NumPy: dtype is already registered"); pybind11_fail("NumPy: dtype is already registered");
......
...@@ -40,6 +40,19 @@ while read -u 3 f; do ...@@ -40,6 +40,19 @@ while read -u 3 f; do
done done
found= found=
# The mt=41 sets a red background for matched tabs:
exec 3< <(GREP_COLORS='mt=41' grep '^\s*{\s*$' include/ docs/*.rst -rn --color=always)
while read -u 3 f; do
if [ -z "$found" ]; then
echo -e '\e[31m\e[01mError: braces should occur on the same line as the if/while/.. statement. Found issues in the following files: \e[0m'
found=1
errors=1
fi
echo " $f"
done
found=
exec 3< <(grep '\<\(if\|for\|while\)(\|){' include/ tests/*.{cpp,py,h} -rn --color=always) exec 3< <(grep '\<\(if\|for\|while\)(\|){' include/ tests/*.{cpp,py,h} -rn --color=always)
while read -u 3 line; do while read -u 3 line; do
if [ -z "$found" ]; then if [ -z "$found" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment