Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
7946715d
Commit
7946715d
authored
Aug 29, 2016
by
Wenzel Jakob
Committed by
GitHub
Aug 29, 2016
Browse files
Merge pull request #369 from jagerman/check-for-tabs
Check for style issues during docs build
parents
5d1d380e
dbc4bf68
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
93 deletions
+128
-93
.travis.yml
.travis.yml
+4
-2
tests/object.h
tests/object.h
+81
-81
tests/test_stl_binders.cpp
tests/test_stl_binders.cpp
+10
-10
tools/check-style.sh
tools/check-style.sh
+33
-0
No files found.
.travis.yml
View file @
7946715d
...
@@ -38,9 +38,11 @@ matrix:
...
@@ -38,9 +38,11 @@ matrix:
# Documentation build:
# Documentation build:
-
os
:
linux
-
os
:
linux
language
:
docs
language
:
docs
env
:
DOCS
env
:
DOCS
STYLE
install
:
pip install sphinx sphinx_rtd_theme
install
:
pip install sphinx sphinx_rtd_theme
script
:
make -C docs html SPHINX_OPTIONS=-W
script
:
-
make -C docs html SPHINX_OPTIONS=-W
-
tools/check-style.sh
cache
:
cache
:
directories
:
directories
:
-
$HOME/.cache/pip
-
$HOME/.cache/pip
...
...
tests/object.h
View file @
7946715d
tests/test_stl_binders.cpp
View file @
7946715d
tools/check-style.sh
0 → 100755
View file @
7946715d
#!/bin/bash
#
# Script to check include/test code for common pybind11 code style errors.
# Currently just checks for tabs used instead of spaces.
#
# Invoke as: tools/check-style.sh
#
errors
=
0
IFS
=
$'
\n
'
found
=
grep
$'
\t
'
include/ tests/ docs/
*
.rst
-rl
|
while
read
f
;
do
if
[
-z
"
$found
"
]
;
then
echo
-e
'\e[31m\e[01mError: found tabs instead of spaces in the following files:\e[0m'
found
=
1
errors
=
1
fi
echo
"
$f
"
done
found
=
grep
'\<\(if\|for\|while\)('
include/ tests/
*
-r
--color
=
always |
while
read
line
;
do
if
[
-z
"
$found
"
]
;
then
echo
-e
'\e[31m\e[01mError: found the following coding style problems:\e[0m'
found
=
1
errors
=
1
fi
echo
"
$line
"
done
exit
$errors
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment