Skip to content

Commit c0647e0

Browse files
authored
🎨 Code format and linting config update (#408)
1 parent 015d0e6 commit c0647e0

11 files changed

+41
-31
lines changed

.clang-tidy

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
FormatStyle: file
22

33
Checks: |
4-
clang-diagnostic-*,
5-
clang-analyzer-*,
6-
-clang-analyzer-core.NullDereference,
74
boost-*,
85
bugprone-*,
96
-bugprone-easily-swappable-parameters,
107
-bugprone-unchecked-optional-access,
118
clang-analyzer-*,
9+
-clang-analyzer-core.NullDereference,
10+
clang-diagnostic-*,
1211
cppcoreguidelines-*,
1312
-cppcoreguidelines-non-private-member-variables-in-classes,
1413
-cppcoreguidelines-special-member-functions,

.cmake-format.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
format:
2+
line_width: 100
23
keyword_case: "upper"
34
autosort: true

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{py,pyi}]
12+
indent_size = 4
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[{*.{cmake,cmake.in},CMakeLists.txt}]
18+
max_line_length = 100

.git_archival.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node: $Format:%H$
22
node-date: $Format:%cI$
33
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4-
ref-names: $Format:%D$

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ coverage.xml
5353
.hypothesis/
5454
.pytest_cache/
5555
cover/
56+
*.profraw
5657

5758
# Translations
5859
*.mo
@@ -73,6 +74,7 @@ instance/
7374

7475
# Sphinx documentation
7576
docs/_build/
77+
docs/api/
7678

7779
# PyBuilder
7880
.pybuilder/
@@ -136,7 +138,7 @@ _skbuild/
136138

137139
# Any build dirs in the tests
138140
test/**/build/
139-
/src/mqt/qcec/_version.py
141+
/src/mqt/**/_version.py
140142

141143
# Common editor files
142144
*~
@@ -169,3 +171,6 @@ Thumbs.db
169171
/docs/**/build
170172
.vs
171173
out/build
174+
175+
node_modules/
176+
wheelhouse/

CMakeLists.txt

+5-9
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ if(BUILD_MQT_QCEC_BINDINGS)
2323
CACHE STRING "Prefer Brew/Conda to Apple framework Python")
2424
set(Python_ARTIFACTS_INTERACTIVE
2525
ON
26-
CACHE
27-
BOOL
28-
"Prevent multiple searches for Python and instead cache the results.")
26+
CACHE BOOL "Prevent multiple searches for Python and instead cache the results.")
2927

3028
# top-level call to find Python
3129
find_package(
@@ -46,9 +44,7 @@ if(BUILD_MQT_QCEC_TESTS)
4644
add_subdirectory(test)
4745
endif()
4846

49-
configure_file(
50-
${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
51-
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
52-
add_custom_target(
53-
uninstall COMMAND ${CMAKE_COMMAND} -P
54-
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
47+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
48+
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
49+
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P
50+
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Chair for Design Automation, Technical University of Munich
3+
Copyright (c) 2024 Chair for Design Automation, Technical University of Munich
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

cmake/ExternalDependencies.cmake

+3-7
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@ if(BUILD_MQT_QCEC_TESTS)
5353
set(GTEST_VERSION
5454
1.14.0
5555
CACHE STRING "Google Test version")
56-
set(GTEST_URL
57-
https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.tar.gz
58-
)
56+
set(GTEST_URL https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.tar.gz)
5957
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
60-
FetchContent_Declare(googletest URL ${GTEST_URL} FIND_PACKAGE_ARGS
61-
${GTEST_VERSION} NAMES GTest)
58+
FetchContent_Declare(googletest URL ${GTEST_URL} FIND_PACKAGE_ARGS ${GTEST_VERSION} NAMES GTest)
6259
list(APPEND FETCH_PACKAGES googletest)
6360
else()
6461
find_package(googletest ${GTEST_VERSION} QUIET NAMES GTest)
@@ -80,8 +77,7 @@ if(BUILD_MQT_QCEC_BINDINGS)
8077
else()
8178
find_package(pybind11_json QUIET)
8279
if(NOT pybind11_json_FOUND)
83-
FetchContent_Declare(
84-
pybind11_json GIT_REPOSITORY https://github.com/pybind/pybind11_json)
80+
FetchContent_Declare(pybind11_json GIT_REPOSITORY https://github.com/pybind/pybind11_json)
8581
list(APPEND FETCH_PACKAGES pybind11_json)
8682
endif()
8783
endif()

cmake/cmake_uninstall.cmake.in

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# Source:
2-
# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
1+
# Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
32

43
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
5-
message(
6-
FATAL_ERROR
7-
"Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
4+
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
85
endif()
96

107
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)

src/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include
2222

2323
# link to the MQT::Core libraries
2424
target_link_libraries(${PROJECT_NAME} PUBLIC MQT::CoreDD MQT::CoreZX)
25-
target_link_libraries(${PROJECT_NAME} PRIVATE MQT::ProjectWarnings
26-
MQT::ProjectOptions)
25+
target_link_libraries(${PROJECT_NAME} PRIVATE MQT::ProjectWarnings MQT::ProjectOptions)
2726

2827
# add MQT alias
2928
add_library(MQT::QCEC ALIAS ${PROJECT_NAME})

src/python/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ pybind11_add_module(
66
OPT_SIZE
77
# Source code goes here
88
bindings.cpp)
9-
target_link_libraries(pyqcec PRIVATE MQT::QCEC MQT::CorePython pybind11_json
10-
MQT::ProjectOptions MQT::ProjectWarnings)
9+
target_link_libraries(pyqcec PRIVATE MQT::QCEC MQT::CorePython pybind11_json MQT::ProjectOptions
10+
MQT::ProjectWarnings)
1111

1212
# Install directive for scikit-build-core
1313
install(

0 commit comments

Comments
 (0)