forked from espressomd/espresso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maintainer: added cmake-format check.
- Loading branch information
1 parent
0c8a23e
commit 8f54b3e
Showing
13 changed files
with
181 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# ------------------------------------------------ | ||
# Options affecting comment reflow and formatting. | ||
# ------------------------------------------------ | ||
with section("markup"): | ||
# If comment markup is enabled, don't reflow the first comment block in each | ||
# listfile. Use this to preserve formatting of your copyright/license | ||
# statements. | ||
first_comment_is_literal = True | ||
|
||
# ----------------------------- | ||
# Options affecting formatting. | ||
# ----------------------------- | ||
with section("format"): | ||
# If an argument group contains more than this many sub-groups (parg or kwarg | ||
# groups) then force it to a vertical layout. | ||
max_subgroups_hwrap = 12 | ||
# If a positional argument group contains more than this many arguments, then | ||
# force it to a vertical layout. | ||
max_pargs_hwrap = 12 | ||
# If a candidate layout is wrapped horizontally but it exceeds this many | ||
# lines, then reject the layout. | ||
max_lines_hwrap = 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
fail_fast: false | ||
exclude: 'libs' | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: clang-format | ||
name: clang-format | ||
entry: bash maintainer/CI/clang-format.sh | ||
entry: sh maintainer/format/clang-format.sh | ||
language: system | ||
always_run: false | ||
files: '.*\.(cpp|hpp|cu|cuh)' | ||
args: ["-i", "-style=file"] | ||
|
||
- id: autopep8 | ||
name: autopep8 | ||
entry: bash maintainer/CI/autopep8.sh | ||
entry: sh maintainer/format/autopep8.sh | ||
language: system | ||
always_run: false | ||
files: '.*\.(py|pyx|pxd)' | ||
exclude: '\.pylintrc|.*.\.py\.in' | ||
args: ["--ignore=E266,W291,W293", "--in-place", "--aggressive"] | ||
|
||
- id: cmake-format | ||
name: cmake-format | ||
entry: sh maintainer/format/cmake-format.sh | ||
language: system | ||
always_run: false | ||
files: 'CMakeLists.txt' | ||
args: ["-i"] | ||
|
||
- id: ex-flags | ||
name: executable flags | ||
entry: sh maintainer/format/ex_flag.sh | ||
language: system | ||
always_run: false | ||
exclude: '.*\.(sh|py|sh\.in|cmakein)|.git' | ||
types: [file, executable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# Copyright (C) 2018-2020 The ESPResSo project | ||
# | ||
# This file is part of ESPResSo. | ||
# | ||
# ESPResSo is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ESPResSo is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
AUTOPEP8_VER=1.3.4 | ||
PYCODESTYLE_VER=2.3.1 | ||
|
||
if hash autopep8 2>/dev/null; then | ||
AUTOPEP8="$(which autopep8)" | ||
else | ||
echo "No autopep8 found." | ||
exit 2 | ||
fi | ||
|
||
if ! "${AUTOPEP8}" --version 2>&1 | grep -qFo "autopep8 ${AUTOPEP8_VER} (pycodestyle: ${PYCODESTYLE_VER})"; then | ||
echo "Could not find autopep8 ${AUTOPEP8_VER} with pycodestyle ${PYCODESTYLE_VER}" | ||
echo "${AUTOPEP8} is $(${AUTOPEP8} --version 2>&1)" | ||
exit 2 | ||
fi | ||
|
||
${AUTOPEP8} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# Copyright (C) 2018-2020 The ESPResSo project | ||
# | ||
# This file is part of ESPResSo. | ||
# | ||
# ESPResSo is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ESPResSo is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
|
||
CLANG_FORMAT_VER=6.0 | ||
if hash clang-format_${CLANG_FORMAT_VER} 2>/dev/null; then | ||
CLANGFORMAT="$(which clang-format-${CLANG_FORMAT_VER})" | ||
elif hash clang-format 2>/dev/null; then | ||
CLANGFORMAT="$(which clang-format)" | ||
else | ||
echo "No clang-format found." | ||
exit 2 | ||
fi | ||
|
||
if ! "${CLANGFORMAT}" --version | grep -qEo "version ${CLANG_FORMAT_VER}\.[0-9]+"; then | ||
echo "Could not find clang-format ${CLANG_FORMAT_VER}. ${CLANGFORMAT} is $(${CLANGFORMAT} --version | grep -Eo '[0-9\.]{5}' | head -n 1)." | ||
exit 2 | ||
fi | ||
|
||
${CLANGFORMAT} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
# Copyright (C) 2018-2020 The ESPResSo project | ||
# | ||
# This file is part of ESPResSo. | ||
# | ||
# ESPResSo is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ESPResSo is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
CMAKE_FORMAT_VER=0.6.9 | ||
if hash cmake-format 2>/dev/null; then | ||
CMAKE_FORMAT="$(which cmake-format)" | ||
else | ||
echo "No cmake-format found." | ||
exit 2 | ||
fi | ||
|
||
|
||
if ! "${CMAKE_FORMAT}" --version | grep -qEo "${CMAKE_FORMAT_VER}"; then | ||
echo "Could not find cmake-format ${CMAKE_FORMAT_VER}." | ||
exit 2 | ||
fi | ||
|
||
${CMAKE_FORMAT} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
# Copyright (C) 2018-2020 The ESPResSo project | ||
# | ||
# This file is part of ESPResSo. | ||
# | ||
# ESPResSo is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ESPResSo is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
chmod -x "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ pylint>=2.2.2 | |
astroid>=2.1.0 | ||
isort>=4.3.4 | ||
setuptools>=20.7.0 | ||
pre-commit>=2.2.0 | ||
cmake-format==0.6.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters