Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BasedOnStyle: LLVM
IncludeBlocks: Regroup
PointerAlignment: Left
Standard: c++17
70 changes: 70 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
FormatStyle: file

Checks: |
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-unchecked-optional-access,
clang-analyzer-*,
-clang-analyzer-core.NullDereference,
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
google-*,
-google-readability-todo,
-google-build-using-namespace,
misc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
performance-*,
portability-*,
readability-*,
-readability-identifier-length,
-readability-magic-numbers,
-readability-function-cognitive-complexity

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.ConstantParameterCase
value: camelBack
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: "true"
- key: readability-identifier-naming.LocalConstantCase
value: camelBack
- key: readability-identifier-naming.LocalVariableCase
value: camelBack
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.MemberIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.MethodCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.ParameterIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: camelBack
7 changes: 7 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
format:
line_width: 100
keyword_case: "upper"
autosort: true

markup:
first_comment_is_literal: true
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{py,pyi}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[{*.{cmake,cmake.in},CMakeLists.txt}]
max_line_length = 100
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
44 changes: 44 additions & 0 deletions .license-tools-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"author": {
"name": "MQSS Project",
"years": [2024, 2026]
},
"force_author": true,
"custom_license": "Licensed under the Apache License v2.0 with LLVM Exceptions (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttps://llvm.org/LICENSE.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under the License.\n\nSPDX-License-Identifier: Apache-2.0 WITH LLVM-exception",
"force_license": true,
"title": false,
"include": ["**/*"],
"style_override_for_suffix": {
".pyi": "DOCSTRING_STYLE",
".in": "POUND_STYLE",
".mlir": "SLASH_STYLE",
".td": "SLASH_STYLE",
".yaml": "POUND_STYLE",
".toml": "POUND_STYLE",
".proto": "SLASH_STYLE",
".ts": "C_STYLE",
".css": "C_STYLE",
".ps1": "POUND_STYLE"
},
"exclude": [
"^\\.[^/]+",
"/\\.[^/]+",
".*\\.qasm",
".*\\.ll",
".*\\.md",
".*\\.bib",
".*\\.cff",
".*\\.json",
".*\\.html",
".*\\.tfc",
".*\\.qc",
".*\\.real",
".*\\.tex",
"uv\\.lock",
"py\\.typed",
"Dockerfile",
"prefix_defs.txt",
"test_defs.cpp.in",
"LICENSE"
]
}
80 changes: 59 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# To run all pre-commit checks, use:
#
# pre-commit run -a
#
# To install pre-commit hooks that run every time you commit:
#
# pre-commit install
#

ci:
autoupdate_commit_msg: "⬆️🪝 update pre-commit hooks"
autoupdate_schedule: quarterly
autofix_commit_msg: "🎨 pre-commit fixes"

exclude: \.svg$

repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -18,7 +34,7 @@ repos:

# Handling unwanted unicode characters
- repo: https://github.com/sirosen/texthooks
rev: 0.6.8
rev: 0.7.1
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand All @@ -31,32 +47,54 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal

# Check for license headers
- repo: https://github.com/emzeat/mz-lictools
rev: v2.9.0
hooks:
- id: license-tools

# Check for spelling
- repo: https://github.com/crate-ci/typos
rev: v1.29.4
rev: v1.46.3
hooks:
- id: typos

# Clang-format the C++ part of the code base automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.5
hooks:
- id: clang-format
types_or: [c++, c, cuda]

# CMake format the CMakeLists.txt files
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
additional_dependencies: [pyyaml]
types: [file]
files: (\.cmake|CMakeLists.txt)(.in)?$

# Format configuration files with prettier
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.4.2
rev: v3.8.3
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
args:
- --print-width=100
- --prose-wrap=always
- --tab-width=2
exclude: ^docs/header\.html$

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.6
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi]
exclude: docs/header\.html$

# Catch common capitalization mistakes
- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml

# Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.2
hooks:
- id: check-dependabot
- id: check-github-workflows
15 changes: 6 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# ------------------------------------------------------------------------------
# Copyright 2024 Munich Quantum Software Stack Project
# Copyright (c) 2024 - 2026 MQSS Project
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 with LLVM Exceptions (the
# "License"); you may not use this file except in compliance with the License.
# Licensed under the Apache License v2.0 with LLVM Exceptions (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/Munich-Quantum-Software-Stack/QDMI-Devices/blob/develop/LICENSE
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Expand All @@ -14,7 +14,6 @@
# the License.
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# ------------------------------------------------------------------------------

# set required cmake version
cmake_minimum_required(VERSION 3.19...3.30)
Expand All @@ -25,8 +24,7 @@ project(
DESCRIPTION "MQSS Client"
LANGUAGES CXX)

# Generate compile_commands.json to make it easier to work with clang based
# tools
# Generate compile_commands.json to make it easier to work with clang based tools
set(CMAKE_EXPORT_COMPILE_COMMANDS
ON
CACHE BOOL "Export compile commands" FORCE)
Expand All @@ -41,7 +39,6 @@ if(ENABLE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -O0 -g")
endif()


set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
set(CMAKE_C_EXTENSIONS OFF)
Expand Down
24 changes: 20 additions & 4 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Copyright (c) 2024 - 2026 MQSS Project
# All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

include(FetchContent)
set(FETCH_PACKAGES "")

#if(BUILD_DOCUMENTATION)
if(BUILD_DOCUMENTATION)
set(CMAKE_POLICY_DEFAULT_CMP0116
NEW
CACHE STRING
"Set the default CMP0116 policy to NEW for documentation builds")
CACHE STRING "Set the default CMP0116 policy to NEW for documentation builds")
set(DOXYGEN_VERSION
1.15.0
CACHE STRING "Doxygen version")
Expand All @@ -31,7 +47,7 @@ set(FETCH_PACKAGES "")
GIT_TAG ${DOXYGEN_AWESOME_REV}
FIND_PACKAGE_ARGS ${DOXYGEN_AWESOME_VERSION})
list(APPEND FETCH_PACKAGES doxygen-awesome-css)
#endif()
endif()

if(FETCH_PACKAGES)
FetchContent_MakeAvailable(${FETCH_PACKAGES})
Expand Down
Loading
Loading