Skip to content

Commit be80729

Browse files
nkoukpaizanactions-user
authored andcommitted
Apply pre-commmit fixes
1 parent 323b399 commit be80729

File tree

208 files changed

+11738
-11778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+11738
-11778
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
.vscode/
55
*.DS_Store
66
build/
7-
*.DS_Store
7+
*.DS_Store

CMakeLists.txt

+73-75
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,54 @@
11
#
2-
# Copyright (c) 2017, Lawrence Livermore National Security, LLC.
3-
# Produced at the Lawrence Livermore National Laboratory.
4-
# Written by Slaven Peles <[email protected]>.
5-
# LLNL-CODE-718378.
6-
# All rights reserved.
2+
# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the
3+
# Lawrence Livermore National Laboratory. Written by Slaven Peles
4+
# <[email protected]>. LLNL-CODE-718378. All rights reserved.
75
#
8-
# This file is part of GridKit™. For details, see github.com/LLNL/GridKit
9-
# Please also read the LICENSE file.
6+
# This file is part of GridKit™. For details, see github.com/LLNL/GridKit Please
7+
# also read the LICENSE file.
108
#
119
# Redistribution and use in source and binary forms, with or without
12-
# modification, are permitted provided that the following conditions are met:
13-
# - Redistributions of source code must retain the above copyright notice,
14-
# this list of conditions and the disclaimer below.
15-
# - Redistributions in binary form must reproduce the above copyright notice,
16-
# this list of conditions and the disclaimer (as noted below) in the
17-
# documentation and/or other materials provided with the distribution.
18-
# - Neither the name of the LLNS/LLNL nor the names of its contributors may
19-
# be used to endorse or promote products derived from this software without
20-
# specific prior written permission.
10+
# modification, are permitted provided that the following conditions are met: -
11+
# Redistributions of source code must retain the above copyright notice, this
12+
# list of conditions and the disclaimer below. - Redistributions in binary form
13+
# must reproduce the above copyright notice, this list of conditions and the
14+
# disclaimer (as noted below) in the documentation and/or other materials
15+
# provided with the distribution. - Neither the name of the LLNS/LLNL nor the
16+
# names of its contributors may be used to endorse or promote products derived
17+
# from this software without specific prior written permission.
2118
#
22-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23-
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24-
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25-
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26-
# DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL
27-
# SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE
28-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
29-
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30-
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32-
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33-
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISINGIN ANY
34-
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
35-
# THE POSSIBILITY OF SUCH DAMAGE.
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
# DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE
23+
# U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
# NEGLIGENCE OR OTHERWISE) ARISINGIN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29+
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3630
#
3731
# Lawrence Livermore National Laboratory is operated by Lawrence Livermore
38-
# National Security, LLC, for the U.S. Department of Energy, National
39-
# Nuclear Security Administration under Contract DE-AC52-07NA27344.
32+
# National Security, LLC, for the U.S. Department of Energy, National Nuclear
33+
# Security Administration under Contract DE-AC52-07NA27344.
4034
#
41-
# This document was prepared as an account of work sponsored by an agency
42-
# of the United States government. Neither the United States government nor
43-
# Lawrence Livermore National Security, LLC, nor any of their employees
44-
# makes any warranty, expressed or implied, or assumes any legal liability
45-
# or responsibility for the accuracy, completeness, or usefulness of any
46-
# information, apparatus, product, or process disclosed, or represents that
47-
# its use would not infringe privately owned rights. Reference herein to
48-
# any specific commercial product, process, or service by trade name,
49-
# trademark, manufacturer, or otherwise does not necessarily constitute or
50-
# imply its endorsement, recommendation, or favoring by the United States
51-
# government or Lawrence Livermore National Security, LLC. The views and
52-
# opinions of authors expressed herein do not necessarily state or reflect
53-
# those of the United States government or Lawrence Livermore National
54-
# Security, LLC, and shall not be used for advertising or product
55-
# endorsement purposes.
35+
# This document was prepared as an account of work sponsored by an agency of the
36+
# United States government. Neither the United States government nor Lawrence
37+
# Livermore National Security, LLC, nor any of their employees makes any
38+
# warranty, expressed or implied, or assumes any legal liability or
39+
# responsibility for the accuracy, completeness, or usefulness of any
40+
# information, apparatus, product, or process disclosed, or represents that its
41+
# use would not infringe privately owned rights. Reference herein to any
42+
# specific commercial product, process, or service by trade name, trademark,
43+
# manufacturer, or otherwise does not necessarily constitute or imply its
44+
# endorsement, recommendation, or favoring by the United States government or
45+
# Lawrence Livermore National Security, LLC. The views and opinions of authors
46+
# expressed herein do not necessarily state or reflect those of the United
47+
# States government or Lawrence Livermore National Security, LLC, and shall not
48+
# be used for advertising or product endorsement purposes.
5649
#
57-
#
58-
# [[
59-
# Author(s):
60-
# - Cameron Rutherford <[email protected]>
61-
# - Slaven Peles <[email protected]>
62-
# ]]
50+
# [[ Author(s): - Cameron Rutherford <[email protected]> - Slaven
51+
# Peles <[email protected]> ]]
6352

6453
cmake_minimum_required(VERSION 3.12)
6554

@@ -73,7 +62,9 @@ set(PACKAGE_VERSION_MAJOR "0")
7362
set(PACKAGE_VERSION_MINOR "0")
7463
set(PACKAGE_VERSION_PATCH "7")
7564

76-
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
65+
set(PACKAGE_VERSION
66+
"${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}"
67+
)
7768

7869
# Ipopt support is disabled by default
7970
option(GRIDKIT_ENABLE_IPOPT "Enable Ipopt support" OFF)
@@ -82,7 +73,8 @@ option(GRIDKIT_ENABLE_IPOPT "Enable Ipopt support" OFF)
8273
option(GRIDKIT_ENABLE_SUNDIALS "Enable SUNDIALS support" ON)
8374

8475
# Enable KLU
85-
option(GRIDKIT_ENABLE_SUNDIALS_SPARSE "Enable SUNDIALS sparse linear solvers" ON)
76+
option(GRIDKIT_ENABLE_SUNDIALS_SPARSE "Enable SUNDIALS sparse linear solvers"
77+
ON)
8678

8779
# Enzyme support is disabled by default
8880
option(GRIDKIT_ENABLE_ENZYME "Enable automatic differentiation with Enzyme" OFF)
@@ -95,23 +87,23 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
9587
# use, i.e. don't skip the full RPATH for the build tree
9688
set(CMAKE_SKIP_BUILD_RPATH FALSE)
9789

98-
# when building, don't use the install RPATH already
99-
# (but later on when installing)
90+
# when building, don't use the install RPATH already (but later on when
91+
# installing)
10092
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
10193

10294
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
10395

104-
# add the automatically determined parts of the RPATH
105-
# which point to directories outside the build tree to the install RPATH
96+
# add the automatically determined parts of the RPATH which point to directories
97+
# outside the build tree to the install RPATH
10698
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
10799

108100
# the RPATH to be used when installing, but only if it's not a system directory
109-
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
101+
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
102+
"${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
110103
if("${isSystemDir}" STREQUAL "-1")
111-
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
104+
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
112105
endif("${isSystemDir}" STREQUAL "-1")
113106

114-
115107
# TODO: Probably beter to set a debug interface target
116108
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG")
117109

@@ -127,9 +119,14 @@ if(GRIDKIT_ENABLE_IPOPT)
127119
enable_language(Fortran) # Needed for linking to HSL
128120
endif()
129121
if(GRIDKIT_ENABLE_SUNDIALS)
130-
find_package(SUNDIALS 7.0.0 REQUIRED CONFIG
131-
PATHS ${SUNDIALS_DIR}
132-
${SUNDIALS_DIR}/lib/cmake/sundials)
122+
find_package(
123+
SUNDIALS
124+
7.0.0
125+
REQUIRED
126+
CONFIG
127+
PATHS
128+
${SUNDIALS_DIR}
129+
${SUNDIALS_DIR}/lib/cmake/sundials)
133130
message(STATUS "SUNDIALS configuration found: ${SUNDIALS_CONFIG}")
134131
endif()
135132
if(GRIDKIT_ENABLE_SUNDIALS_SPARSE)
@@ -151,11 +148,13 @@ add_subdirectory(src)
151148
enable_testing()
152149
add_subdirectory(examples)
153150
add_subdirectory(tests)
154-
155-
export(EXPORT gridkit-targets FILE ${CMAKE_CURRENT_BINARY_DIR}/GridKitTargets.cmake)
151+
152+
export(EXPORT gridkit-targets
153+
FILE ${CMAKE_CURRENT_BINARY_DIR}/GridKitTargets.cmake)
156154

157155
# Configuring exporting cmake config
158-
install(EXPORT gridkit-targets
156+
install(
157+
EXPORT gridkit-targets
159158
FILE GridKitTargets.cmake
160159
NAMESPACE GRIDKIT::
161160
DESTINATION share/cmake/gridkit)
@@ -169,14 +168,13 @@ write_basic_package_version_file(
169168
COMPATIBILITY SameMajorVersion)
170169

171170
# Generate config file that includes exports
172-
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
171+
configure_package_config_file(
172+
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
173173
${CMAKE_CURRENT_BINARY_DIR}/GridKitConfig.cmake
174174
INSTALL_DESTINATION share/cmake/gridkit
175-
NO_SET_AND_CHECK_MACRO
176-
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
175+
NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
177176

178177
# Install configuration file
179-
install(FILES
180-
${CMAKE_CURRENT_BINARY_DIR}/GridKitConfig.cmake
181-
${CMAKE_CURRENT_BINARY_DIR}/GridKitConfigVersion.cmake
182-
DESTINATION share/cmake/gridkit)
178+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GridKitConfig.cmake
179+
${CMAKE_CURRENT_BINARY_DIR}/GridKitConfigVersion.cmake
180+
DESTINATION share/cmake/gridkit)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,4 +331,4 @@ To help enforce the above code style guidelines, we use autoformatting provided
331331

332332
VS Code users can use `clang-format` to automatically format their code by installing the [C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) and using the `Format Document` command in the command palette with the file to be formatted open. As well, you can enabled the `editor.formatOnSave` option to auto-format any file when you save it.
333333

334-
Other users can use the [`git clang-format`](https://clang.llvm.org/docs/ClangFormat.html#git-integration) subcommand installed along with `clang-format` to auto-format all staged files.
334+
Other users can use the [`git clang-format`](https://clang.llvm.org/docs/ClangFormat.html#git-integration) subcommand installed along with `clang-format` to auto-format all staged files.

0 commit comments

Comments
 (0)