Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 3cc3107

Browse files
committed
Enable cmake-format and clang-format with new utility
* Bump hpc-coding-conventions to latest master * enable formatting of CMake files in CMake/package/ sub-directory
1 parent 2f91f3c commit 3cc3107

File tree

8 files changed

+31
-28
lines changed

8 files changed

+31
-28
lines changed

.bbp-project.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tools:
2+
ClangFormat:
3+
enable: True
4+
include:
5+
match:
6+
- coreneuron/.*\.((cu)|(h)|([chi]pp))$
7+
CMakeFormat:
8+
enable: True

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ spconfig.*
1111
.clang-tidy
1212
.cmake-format.yaml
1313
.pre-commit-config.yaml
14+
.bbp-project-venv/

CMake/hpc-coding-conventions

CMake/packages/FindSphinx.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
# See top-level LICENSE file for details.
55
# =============================================================================
66

7-
find_program(SPHINX_EXECUTABLE
8-
NAMES sphinx-build
9-
DOC "/path/to/sphinx-build")
7+
find_program(
8+
SPHINX_EXECUTABLE
9+
NAMES sphinx-build
10+
DOC "/path/to/sphinx-build")
1011

1112
include(FindPackageHandleStandardArgs)
1213

13-
find_package_handle_standard_args(Sphinx
14-
"Failed to find sphinx-build executable"
15-
SPHINX_EXECUTABLE)
14+
find_package_handle_standard_args(Sphinx "Failed to find sphinx-build executable" SPHINX_EXECUTABLE)

CMake/packages/Findlikwid.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# See top-level LICENSE file for details.
55
# =============================================================================
66

7+
# ~~~
78
# Findlikwid
89
# -------------
910
#
@@ -26,12 +27,12 @@
2627
# likwid_FOUND - set to true if the library is found
2728
# likwid_INCLUDE - list of required include directories
2829
# likwid_LIBRARIES - list of required library directories
30+
# ~~~
2931

3032
find_path(likwid_INCLUDE_DIRS "likwid.h" HINTS "${LIKWID_DIR}/include")
3133
find_library(likwid_LIBRARIES likwid HINTS "${LIKWID_DIR}/lib")
3234

3335
# Checks 'REQUIRED', 'QUIET' and versions.
3436
include(FindPackageHandleStandardArgs)
3537

36-
find_package_handle_standard_args(likwid
37-
REQUIRED_VARS likwid_INCLUDE_DIRS likwid_LIBRARIES)
38+
find_package_handle_standard_args(likwid REQUIRED_VARS likwid_INCLUDE_DIRS likwid_LIBRARIES)

CMake/packages/Findnmodl.cmake

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# See top-level LICENSE file for details.
55
# =============================================================================
66

7+
# ~~~
78
# Findnmodl
89
# -------------
910
#
@@ -26,19 +27,21 @@
2627
# nmodl_FOUND - set to true if the library is found
2728
# nmodl_INCLUDE - list of required include directories
2829
# nmodl_BINARY - the nmodl binary
29-
30+
# ~~~
3031

3132
# UNIX paths are standard, no need to write.
32-
find_program(nmodl_BINARY NAMES nmodl${CMAKE_EXECUTABLE_SUFFIX}
33-
HINTS "${CORENRN_NMODL_DIR}/bin" QUIET)
33+
find_program(
34+
nmodl_BINARY
35+
NAMES nmodl${CMAKE_EXECUTABLE_SUFFIX}
36+
HINTS "${CORENRN_NMODL_DIR}/bin" QUIET)
3437

3538
find_path(nmodl_INCLUDE "nmodl/fast_math.ispc" HINTS "${CORENRN_NMODL_DIR}/include")
3639
find_path(nmodl_PYTHONPATH "nmodl/__init__.py" HINTS "${CORENRN_NMODL_DIR}/lib")
3740

3841
# Checks 'REQUIRED', 'QUIET' and versions.
3942
include(FindPackageHandleStandardArgs)
4043

41-
find_package_handle_standard_args(nmodl
44+
find_package_handle_standard_args(
45+
nmodl
4246
FOUND_VAR nmodl_FOUND
4347
REQUIRED_VARS nmodl_BINARY nmodl_INCLUDE nmodl_PYTHONPATH)
44-

CMake/packages/Findreportinglib.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# See top-level LICENSE file for details.
55
# =============================================================================
66

7+
# ~~~
78
# Findreportinglib
89
# -------------
910
#
@@ -26,17 +27,18 @@
2627
# reportinglib_FOUND - set to true if the library is found
2728
# reportinglib_INCLUDE_DIRS - list of required include directories
2829
# reportinglib_LIBRARIES - list of libraries to be linked
30+
# ~~~
2931

3032
# UNIX paths are standard, no need to write.
3133
find_path(reportinglib_INCLUDE_DIR reportinglib/Report.h)
3234
find_library(reportinglib_LIBRARY reportinglib)
3335
get_filename_component(reportinglib_LIB_DIR ${reportinglib_LIBRARY} DIRECTORY)
34-
find_program (reportinglib_somaDump somaDump ${reportinglib_LIB_DIR}/../bin)
36+
find_program(reportinglib_somaDump somaDump ${reportinglib_LIB_DIR}/../bin)
3537

3638
# Checks 'REQUIRED', 'QUIET' and versions.
3739
include(FindPackageHandleStandardArgs)
3840

39-
find_package_handle_standard_args(reportinglib
41+
find_package_handle_standard_args(
42+
reportinglib
4043
FOUND_VAR reportinglib_FOUND
4144
REQUIRED_VARS reportinglib_INCLUDE_DIR reportinglib_LIBRARY reportinglib_LIB_DIR)
42-

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,6 @@ list(APPEND CMAKE_MODULE_PATH ${CORENEURON_PROJECT_SOURCE_DIR}/CMake
8585
# =============================================================================
8686
set(CODING_CONV_PREFIX "CORENRN")
8787
set(CORENRN_3RDPARTY_DIR "external")
88-
# Adds .cu with respect to the current default in hpc-coding-conventions, and drops various patterns
89-
# that don't match anything in CoreNEURON.
90-
set(CORENRN_ClangFormat_FILES_RE
91-
"^.*\\\\.cu$$" "^.*\\\\.h$$" "^.*\\\\.[chi]pp$$"
92-
CACHE STRING "List of regular expressions matching C/C++ filenames" FORCE)
93-
set(CORENRN_ClangFormat_EXCLUDES_RE
94-
""
95-
CACHE STRING "list of regular expressions to exclude C/C++ files from formatting" FORCE)
96-
set(CORENRN_CMakeFormat_EXCLUDES_RE
97-
"CMake/packages/.*$$"
98-
CACHE STRING "list of regular expressions to exclude CMake files from formatting" FORCE)
9988
include(AddHpcCodingConvSubmodule)
10089
add_subdirectory(CMake/hpc-coding-conventions/cpp)
10190

0 commit comments

Comments
 (0)