From acc4a7161a52b6e12cbdcbad9cf76122dc0064da Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Mon, 17 Nov 2025 22:44:22 +0100 Subject: [PATCH 001/115] feat: add ResultType and check_key_sequence_ordered function for key sequence validation; include ruff configuration for linting --- scripts/mstd_cpp_checks/cpp_types.py | 24 ++++++++++++++++++++++++ scripts/mstd_cpp_checks/ruff.toml | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 scripts/mstd_cpp_checks/cpp_types.py create mode 100644 scripts/mstd_cpp_checks/ruff.toml diff --git a/scripts/mstd_cpp_checks/cpp_types.py b/scripts/mstd_cpp_checks/cpp_types.py new file mode 100644 index 0000000..fb48ecb --- /dev/null +++ b/scripts/mstd_cpp_checks/cpp_types.py @@ -0,0 +1,24 @@ +from enum import Enum + +class ResultTypeEnum(Enum): + Ok = 0 + Warning = 1 + Error = 2 + +class ResultType: + def __init__(self, value, description=None): + self.value = value + self.description = description + +def check_key_sequence_ordered(key_sequence, line, filename, linenumber): + + if not isinstance(key_sequence, list): + raise TypeError("key_sequence must be a list") + + indices = [line.split().index(key) for key in key_sequence if key in line] + + if len(indices) == len(key_sequence) and sorted(indices) != indices: + return ResultType(ResultTypeEnum.Warning, f"key_sequence {key_sequence} not ordered correctly on line {line} in {filename}:{linenumber}") + + return ResultType(ResultTypeEnum.Ok) + \ No newline at end of file diff --git a/scripts/mstd_cpp_checks/ruff.toml b/scripts/mstd_cpp_checks/ruff.toml new file mode 100644 index 0000000..8ffbbca --- /dev/null +++ b/scripts/mstd_cpp_checks/ruff.toml @@ -0,0 +1,28 @@ + +[lint] +select = ["ALL"] +ignore = [ + "D203", # blank line before docstring of class (conflict with other rule) + "D213", # multiline summary second line (conflict with other rule) + "COM812", # trailing comma missing (conflict with other rule) + "FIX002", # missing TODO - already solved by other rules which force linking author and github issue +] +exclude = ["examples/*.ipynb", "scripts/*.py"] +typing-modules = ["molartrader.type_checking"] + +[lint.per-file-ignores] +"tests/*.py" = [ + "S101", # assert used + "PLR2004", # magic value used in comparison + "TID252", # relative imports not allowed (tests is not a separate package) + "ARG001", # unused function argument, because of pytest fixtures +] + +[lint.flake8-type-checking] +runtime-evaluated-base-classes = [ + "molartrader.dtos.base.BaseDTO", # pydantic model needs runtime type checking +] + +[lint.isort] +# Our own generated __version__.py file is first-party +known-first-party = ["__version__"] From 1147f7951352bc94571dc3b1833e05550545bd18 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Mon, 17 Nov 2025 23:17:40 +0100 Subject: [PATCH 002/115] feat: implement C++ type checking utilities and rules; add ResultType and check_key_sequence_ordered function with enhanced documentation --- scripts/mstd_cpp_checks/cpp_checks.py | 32 ++++++++++++++ scripts/mstd_cpp_checks/cpp_types.py | 60 ++++++++++++++++++++------- scripts/mstd_cpp_checks/enums.hpp | 19 +++++++++ scripts/mstd_cpp_checks/files.py | 59 ++++++++++++++++++++++++++ scripts/mstd_cpp_checks/rules.py | 46 ++++++++++++++++++++ 5 files changed, 201 insertions(+), 15 deletions(-) create mode 100644 scripts/mstd_cpp_checks/cpp_checks.py create mode 100644 scripts/mstd_cpp_checks/enums.hpp create mode 100644 scripts/mstd_cpp_checks/files.py create mode 100644 scripts/mstd_cpp_checks/rules.py diff --git a/scripts/mstd_cpp_checks/cpp_checks.py b/scripts/mstd_cpp_checks/cpp_checks.py new file mode 100644 index 0000000..5e4ce93 --- /dev/null +++ b/scripts/mstd_cpp_checks/cpp_checks.py @@ -0,0 +1,32 @@ +"""Module defining C++ check rules.""" + +from enums import FileType + +from cpp_checks import ResultType, check_key_sequence_ordered + + +def static_constexpr_inline_rule(line: str) -> ResultType: + """Check for usage of static, constexpr, and inline in variable declarations. + + Parameters + ---------- + line: str + The line of code to check. + + Returns + ------- + cpp_types.ResultType: + Result of the check, Warning if all keywords are not present, Ok otherwise + + """ + key_sequence = ["static", "inline", "constexpr"] + return check_key_sequence_ordered(key_sequence, line) + + +rules = [] +rules.append( + [ + {FileType.CPPHeader, FileType.CPPSource}, + static_constexpr_inline_rule + ] +) diff --git a/scripts/mstd_cpp_checks/cpp_types.py b/scripts/mstd_cpp_checks/cpp_types.py index fb48ecb..35d28cf 100644 --- a/scripts/mstd_cpp_checks/cpp_types.py +++ b/scripts/mstd_cpp_checks/cpp_types.py @@ -1,24 +1,54 @@ -from enum import Enum +"""Module defining C++ type checking utilities.""" + +from __future__ import annotations + +from enums import ResultTypeEnum + -class ResultTypeEnum(Enum): - Ok = 0 - Warning = 1 - Error = 2 - class ResultType: - def __init__(self, value, description=None): + """Class representing the result of a C++ type check.""" + + def __init__( + self, + value: ResultTypeEnum, + description: str | None = None + ) -> None: + """Initialize ResultType with a value and optional description.""" self.value = value self.description = description -def check_key_sequence_ordered(key_sequence, line, filename, linenumber): - + +def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType: + """Check if keys in key_sequence appear in order on the given line. + + Parameters + ---------- + key_sequence: list[str] + The sequence of keys to check for order. + line: str + The line of text to check. + filename: str + The name of the file containing the line. + linenumber: int + The line number in the file. + + Returns + ------- + ResultType: + Result of the check, Warning if keys are out of order, Ok otherwise + + """ if not isinstance(key_sequence, list): - raise TypeError("key_sequence must be a list") - + msg = f"key_sequence {key_sequence} must be a list" + raise TypeError(msg) + indices = [line.split().index(key) for key in key_sequence if key in line] - + if len(indices) == len(key_sequence) and sorted(indices) != indices: - return ResultType(ResultTypeEnum.Warning, f"key_sequence {key_sequence} not ordered correctly on line {line} in {filename}:{linenumber}") - + return ResultType( + ResultTypeEnum.Warning, + f"key_sequence {key_sequence} not ordered correctly " + f"in line {line}." + ) + return ResultType(ResultTypeEnum.Ok) - \ No newline at end of file diff --git a/scripts/mstd_cpp_checks/enums.hpp b/scripts/mstd_cpp_checks/enums.hpp new file mode 100644 index 0000000..2ba10ef --- /dev/null +++ b/scripts/mstd_cpp_checks/enums.hpp @@ -0,0 +1,19 @@ +""" +Module defining enumerations used in C++ checks. +""" + +from enum import Enum + +class FileType(Enum): + """Enumeration of file types for C++ checks.""" + + CPPHeader = 0 + CPPSource = 1 + CMakeLists = 2 + +class ResultTypeEnum(Enum): + """Enumeration of result types for C++ type checks.""" + + Ok = 0 + Warning = 1 + Error = 2 diff --git a/scripts/mstd_cpp_checks/files.py b/scripts/mstd_cpp_checks/files.py new file mode 100644 index 0000000..4e0e50d --- /dev/null +++ b/scripts/mstd_cpp_checks/files.py @@ -0,0 +1,59 @@ +"""Module for file operations in C++ checks.""" + +from pathlib import Path + +from enums import FileType + + +def determine_file_type(filename: str) -> FileType: + """Determine the file type based on the filename extension. + + Parameters + ---------- + filename: str + The name of the file to check. + + Returns + ------- + FileType: + The determined file type. + + """ + if filename.endswith((".h", ".hpp")): + return FileType.CPPHeader + if filename.endswith((".cpp", ".cxx", ".cc", ".c")): + return FileType.CPPSource + if filename == "CMakeLists.txt": + return FileType.CMakeLists + + msg = f"Unknown file type for filename: {filename}" + raise ValueError(msg) + + +def get_files_in_dirs(dirs: list[str]) -> list[str]: + """Get all files in the specified directories. + + Parameters + ---------- + dirs: list[str] + List of directory paths to search for files. + + Returns + ------- + list[str]: + List of file paths found in the specified directories. + + """ + all_files = [] + + for dir_path in dirs: + path_obj = Path(dir_path) + if not path_obj.is_dir(): + msg = f"Provided path {dir_path} is not a directory." + raise NotADirectoryError(msg) + + for file_path in path_obj.rglob("*"): + if file_path.is_file(): + all_files.extend([str(file_path)]) + + return all_files diff --git a/scripts/mstd_cpp_checks/rules.py b/scripts/mstd_cpp_checks/rules.py new file mode 100644 index 0000000..ef2ae84 --- /dev/null +++ b/scripts/mstd_cpp_checks/rules.py @@ -0,0 +1,46 @@ +"""Module defining how to handle rules for C++ checks.""" + +import logging +from pathlib import Path + +from enums import FileType, ResultTypeEnum + +from files import determine_file_type + +rule_logger = logging.getLogger("mstd_cpp_checks.rules") + + +def check_file(filename: str, rules: list[set[FileType], callable]) -> None: + """Perform checks based on the file type. + + Parameters + ---------- + filename: str + The name of the file to check. + rules: list[callable] + List of rule functions to apply. + + Returns + ------- + None + + """ + file_type = determine_file_type(filename) + + with Path(filename).open("r", encoding="utf-8") as f: + lines = f.readlines() + + for linenumber, line in enumerate(lines): + for file_types, rule in rules: + if file_types and file_type not in file_types: + continue + + result = rule(line) + if result.value == ResultTypeEnum.Warning: + rule_logger.warning( + "Warning in %s:%s: %s", filename, linenumber, result.description + ) + elif result.value == ResultTypeEnum.Error: + rule_logger.error( + "Error in %s:%s: %s", filename, linenumber, result.description + ) From f5f4c1e052db77b48bb39035812c98ff7cadc09c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Tue, 18 Nov 2025 07:56:12 +0100 Subject: [PATCH 003/115] chore: add .gitignore file to exclude Python cache and ruff cache files --- scripts/mstd_cpp_checks/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 scripts/mstd_cpp_checks/.gitignore diff --git a/scripts/mstd_cpp_checks/.gitignore b/scripts/mstd_cpp_checks/.gitignore new file mode 100644 index 0000000..2ec96a6 --- /dev/null +++ b/scripts/mstd_cpp_checks/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +*.pyc +.ruff_cache From 5fc9baa5523af198e2c3f3d1d830170d0bd9c838 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 21 Nov 2025 08:19:05 +0100 Subject: [PATCH 004/115] feat: update addLicense.sh to include Python files in license addition process --- scripts/addLicense.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/addLicense.sh b/scripts/addLicense.sh index ceac578..e6afdea 100755 --- a/scripts/addLicense.sh +++ b/scripts/addLicense.sh @@ -1,4 +1,4 @@ -for i in $(find test/ include/ -regex ".*\.\(hpp\|cpp\|c\|h\)$"); do +for i in $(find test/ include/ scripts/mstd_cpp_checks -regex ".*\.\(hpp\|cpp\|c\|h\|py\)$"); do if ! grep -q Copyright $i; then From ef0aefa6a220a29b88f8f3f825e6c0208247e9ab Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 21 Nov 2025 08:19:23 +0100 Subject: [PATCH 005/115] chore: clean up ruff.toml by removing unused configurations and updating ignore rules --- scripts/mstd_cpp_checks/ruff.toml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/scripts/mstd_cpp_checks/ruff.toml b/scripts/mstd_cpp_checks/ruff.toml index 8ffbbca..8db0230 100644 --- a/scripts/mstd_cpp_checks/ruff.toml +++ b/scripts/mstd_cpp_checks/ruff.toml @@ -6,23 +6,5 @@ ignore = [ "D213", # multiline summary second line (conflict with other rule) "COM812", # trailing comma missing (conflict with other rule) "FIX002", # missing TODO - already solved by other rules which force linking author and github issue + "S607", # relative paths are not allowed by this rule in subprocess commands ] -exclude = ["examples/*.ipynb", "scripts/*.py"] -typing-modules = ["molartrader.type_checking"] - -[lint.per-file-ignores] -"tests/*.py" = [ - "S101", # assert used - "PLR2004", # magic value used in comparison - "TID252", # relative imports not allowed (tests is not a separate package) - "ARG001", # unused function argument, because of pytest fixtures -] - -[lint.flake8-type-checking] -runtime-evaluated-base-classes = [ - "molartrader.dtos.base.BaseDTO", # pydantic model needs runtime type checking -] - -[lint.isort] -# Our own generated __version__.py file is first-party -known-first-party = ["__version__"] From 21f4782bf454dc9f3e3410a54eaa932f2c4ac283 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 21 Nov 2025 08:19:34 +0100 Subject: [PATCH 006/115] feat: add GPL license headers, refactor C++ checks, and implement file type enumerations --- scripts/mstd_cpp_checks/cpp_checks.py | 68 ++++++++++++++------ scripts/mstd_cpp_checks/cpp_rules.py | 51 +++++++++++++++ scripts/mstd_cpp_checks/cpp_types.py | 29 ++++++++- scripts/mstd_cpp_checks/enums.hpp | 19 ------ scripts/mstd_cpp_checks/enums.py | 42 ++++++++++++ scripts/mstd_cpp_checks/files.py | 93 ++++++++++++++++++++++----- scripts/mstd_cpp_checks/rules.py | 23 ++++++- 7 files changed, 267 insertions(+), 58 deletions(-) create mode 100644 scripts/mstd_cpp_checks/cpp_rules.py delete mode 100644 scripts/mstd_cpp_checks/enums.hpp create mode 100644 scripts/mstd_cpp_checks/enums.py diff --git a/scripts/mstd_cpp_checks/cpp_checks.py b/scripts/mstd_cpp_checks/cpp_checks.py index 5e4ce93..4c7fcef 100644 --- a/scripts/mstd_cpp_checks/cpp_checks.py +++ b/scripts/mstd_cpp_checks/cpp_checks.py @@ -1,32 +1,58 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + """Module defining C++ check rules.""" +import logging +import sys + +from cpp_rules import cpp_rules from enums import FileType +from files import __BASE_DIR__, get_files_in_dirs, get_staged_files +from rules import check_file + +__CPP_DIRS__ = ["include", "test"] +__OTHER_DIRS__ = ["scripts"] +__EXCLUDE_DIRS__ = ["__pycache__", ".ruff_cache"] +__EXCLUDE_FILES__ = [".gitignore"] -from cpp_checks import ResultType, check_key_sequence_ordered +__DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ +cpp_check_logger = logging.getLogger("mstd_cpp_checks") -def static_constexpr_inline_rule(line: str) -> ResultType: - """Check for usage of static, constexpr, and inline in variable declarations. - Parameters - ---------- - line: str - The line of code to check. +def run_checks(rules: list[set[FileType], callable]) -> None: - Returns - ------- - cpp_types.ResultType: - Result of the check, Warning if all keywords are not present, Ok otherwise + if "full" in sys.argv: + cpp_check_logger.info("Running full checks...") + dirs = [__BASE_DIR__ / dir_name for dir_name in __DIRS__] + files = get_files_in_dirs(dirs, __EXCLUDE_DIRS__, __EXCLUDE_FILES__) + else: + cpp_check_logger.info("Running checks on staged files...") + files = get_staged_files() - """ - key_sequence = ["static", "inline", "constexpr"] - return check_key_sequence_ordered(key_sequence, line) + for filename in files: + check_file(filename, rules) -rules = [] -rules.append( - [ - {FileType.CPPHeader, FileType.CPPSource}, - static_constexpr_inline_rule - ] -) +if __name__ == "__main__": + run_checks(cpp_rules) diff --git a/scripts/mstd_cpp_checks/cpp_rules.py b/scripts/mstd_cpp_checks/cpp_rules.py new file mode 100644 index 0000000..146f28d --- /dev/null +++ b/scripts/mstd_cpp_checks/cpp_rules.py @@ -0,0 +1,51 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + +from cpp_types import ResultType +from enums import FileType, check_key_sequence_ordered + + +def static_constexpr_inline_rule(line: str) -> ResultType: + """Check for usage of static, constexpr, and inline in variable declarations. + + Parameters + ---------- + line: str + The line of code to check. + + Returns + ------- + cpp_types.ResultType: + Result of the check, Warning if all keywords are not present, Ok otherwise + + """ + key_sequence = ["static", "inline", "constexpr"] + return check_key_sequence_ordered(key_sequence, line) + + +cpp_rules = [] +cpp_rules.append( + [ + {FileType.CPPHeader, FileType.CPPSource}, + static_constexpr_inline_rule + ] +) diff --git a/scripts/mstd_cpp_checks/cpp_types.py b/scripts/mstd_cpp_checks/cpp_types.py index 35d28cf..a729478 100644 --- a/scripts/mstd_cpp_checks/cpp_types.py +++ b/scripts/mstd_cpp_checks/cpp_types.py @@ -1,3 +1,25 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + """Module defining C++ type checking utilities.""" from __future__ import annotations @@ -42,7 +64,12 @@ def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType msg = f"key_sequence {key_sequence} must be a list" raise TypeError(msg) - indices = [line.split().index(key) for key in key_sequence if key in line] + line_elements = line.split() + indices = [ + line_elements.index(key) + for key in key_sequence + if key in line_elements + ] if len(indices) == len(key_sequence) and sorted(indices) != indices: return ResultType( diff --git a/scripts/mstd_cpp_checks/enums.hpp b/scripts/mstd_cpp_checks/enums.hpp deleted file mode 100644 index 2ba10ef..0000000 --- a/scripts/mstd_cpp_checks/enums.hpp +++ /dev/null @@ -1,19 +0,0 @@ -""" -Module defining enumerations used in C++ checks. -""" - -from enum import Enum - -class FileType(Enum): - """Enumeration of file types for C++ checks.""" - - CPPHeader = 0 - CPPSource = 1 - CMakeLists = 2 - -class ResultTypeEnum(Enum): - """Enumeration of result types for C++ type checks.""" - - Ok = 0 - Warning = 1 - Error = 2 diff --git a/scripts/mstd_cpp_checks/enums.py b/scripts/mstd_cpp_checks/enums.py new file mode 100644 index 0000000..f382489 --- /dev/null +++ b/scripts/mstd_cpp_checks/enums.py @@ -0,0 +1,42 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + +"""Module defining enumerations used in C++ checks.""" + +from enum import Enum + + +class FileType(Enum): + """Enumeration of file types for C++ checks.""" + + UNKNOWN = 0 + CPPHeader = 1 + CPPSource = 2 + CMakeLists = 3 + + +class ResultTypeEnum(Enum): + """Enumeration of result types for C++ type checks.""" + + Ok = 0 + Warning = 1 + Error = 2 diff --git a/scripts/mstd_cpp_checks/files.py b/scripts/mstd_cpp_checks/files.py index 4e0e50d..0925dcd 100644 --- a/scripts/mstd_cpp_checks/files.py +++ b/scripts/mstd_cpp_checks/files.py @@ -1,16 +1,41 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + """Module for file operations in C++ checks.""" +import subprocess from pathlib import Path from enums import FileType +__BASE_DIR__ = Path(__file__).parent.parent.parent.resolve() + -def determine_file_type(filename: str) -> FileType: +def determine_file_type(filename: str | Path) -> FileType: """Determine the file type based on the filename extension. Parameters ---------- - filename: str + filename: str | Path The name of the file to check. Returns @@ -19,6 +44,8 @@ def determine_file_type(filename: str) -> FileType: The determined file type. """ + filename = str(filename) + if filename.endswith((".h", ".hpp")): return FileType.CPPHeader if filename.endswith((".cpp", ".cxx", ".cc", ".c")): @@ -26,34 +53,68 @@ def determine_file_type(filename: str) -> FileType: if filename == "CMakeLists.txt": return FileType.CMakeLists - msg = f"Unknown file type for filename: {filename}" - raise ValueError(msg) + return FileType.UNKNOWN -def get_files_in_dirs(dirs: list[str]) -> list[str]: +def get_files_in_dirs( + paths: list[Path], + exclude_dirs: list[str] | None = None, + exclude_files: list[str] | None = None +) -> list[Path]: """Get all files in the specified directories. Parameters ---------- - dirs: list[str] + paths: list[Path] List of directory paths to search for files. + exclude_dirs: list[str] | None + List of directory names to exclude from the search. Defaults to None. + exclude_files: list[str] | None + List of file names to exclude from the search. Defaults to None. Returns ------- - list[str]: + list[Path]: List of file paths found in the specified directories. """ - all_files = [] + if exclude_dirs is None: + exclude_dirs = [] - for dir_path in dirs: - path_obj = Path(dir_path) - if not path_obj.is_dir(): - msg = f"Provided path {dir_path} is not a directory." - raise NotADirectoryError(msg) + if exclude_files is None: + exclude_files = [] - for file_path in path_obj.rglob("*"): - if file_path.is_file(): - all_files.extend([str(file_path)]) + all_files = [] + for path in paths: + if path.is_dir() and path.name not in exclude_dirs: + all_files.extend( + get_files_in_dirs(path.iterdir(), exclude_dirs, exclude_files) + ) + elif path.is_file() and path.name not in exclude_files: + all_files.append(path) return all_files + + +def get_staged_files() -> list[str]: + """Get the list of staged files in the git repository. + + Returns + ------- + list[str]: + List of staged file paths. + + """ + result = subprocess.run( + ["git", "diff", "--name-only", "--cached"], + capture_output=True, + text=True, + check=True + ) + + if result.returncode != 0: + msg = "Failed to get staged files from git." + raise RuntimeError(msg) + + files = result.stdout.strip().split("\n") + return [file for file in files if file] diff --git a/scripts/mstd_cpp_checks/rules.py b/scripts/mstd_cpp_checks/rules.py index ef2ae84..56c1505 100644 --- a/scripts/mstd_cpp_checks/rules.py +++ b/scripts/mstd_cpp_checks/rules.py @@ -1,10 +1,31 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + """Module defining how to handle rules for C++ checks.""" import logging from pathlib import Path from enums import FileType, ResultTypeEnum - from files import determine_file_type rule_logger = logging.getLogger("mstd_cpp_checks.rules") From a3b25a72a91d98da4c37260022e427770320f25a Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 22 Nov 2025 23:17:09 +0100 Subject: [PATCH 007/115] refactor: start of centralizing all checks for mstd library into a single python package --- .../mstd_cpp_checks => checks}/.gitignore | 1 + checks/.python-version | 1 + checks/README.md | 0 checks/pyproject.toml | 12 +++ checks/src/checks.egg-info/PKG-INFO | 7 ++ checks/src/checks.egg-info/SOURCES.txt | 14 ++++ .../src/checks.egg-info/dependency_links.txt | 1 + checks/src/checks.egg-info/entry_points.txt | 2 + checks/src/checks.egg-info/requires.txt | 1 + checks/src/checks.egg-info/top_level.txt | 1 + checks/src/checks/__init__.py | 0 checks/src/checks/cpp_rules.py | 32 ++++++++ checks/src/checks/enums.py | 20 +++++ checks/src/checks/files/__init__.py | 6 ++ .../src/checks/files}/files.py | 36 +++------ checks/src/checks/results/__init__.py | 5 ++ checks/src/checks/results/result_type.py | 26 ++++++ .../src/checks}/ruff.toml | 1 - .../src/checks}/rules.py | 26 +----- checks/src/checks/scripts/__init__.py | 0 checks/src/checks/scripts/cpp_checks.py | 36 +++++++++ checks/src/checks/utils/__init__.py | 5 ++ checks/src/checks/utils/utils.py | 46 +++++++++++ checks/uv.lock | 40 +++++++++ scripts/addLicense.sh | 2 +- scripts/mstd_cpp_checks/cpp_checks.py | 58 ------------- scripts/mstd_cpp_checks/cpp_rules.py | 51 ------------ scripts/mstd_cpp_checks/cpp_types.py | 81 ------------------- scripts/mstd_cpp_checks/enums.py | 42 ---------- 29 files changed, 271 insertions(+), 282 deletions(-) rename {scripts/mstd_cpp_checks => checks}/.gitignore (81%) create mode 100644 checks/.python-version create mode 100644 checks/README.md create mode 100644 checks/pyproject.toml create mode 100644 checks/src/checks.egg-info/PKG-INFO create mode 100644 checks/src/checks.egg-info/SOURCES.txt create mode 100644 checks/src/checks.egg-info/dependency_links.txt create mode 100644 checks/src/checks.egg-info/entry_points.txt create mode 100644 checks/src/checks.egg-info/requires.txt create mode 100644 checks/src/checks.egg-info/top_level.txt create mode 100644 checks/src/checks/__init__.py create mode 100644 checks/src/checks/cpp_rules.py create mode 100644 checks/src/checks/enums.py create mode 100644 checks/src/checks/files/__init__.py rename {scripts/mstd_cpp_checks => checks/src/checks/files}/files.py (70%) create mode 100644 checks/src/checks/results/__init__.py create mode 100644 checks/src/checks/results/result_type.py rename {scripts/mstd_cpp_checks => checks/src/checks}/ruff.toml (99%) rename {scripts/mstd_cpp_checks => checks/src/checks}/rules.py (55%) create mode 100644 checks/src/checks/scripts/__init__.py create mode 100644 checks/src/checks/scripts/cpp_checks.py create mode 100644 checks/src/checks/utils/__init__.py create mode 100644 checks/src/checks/utils/utils.py create mode 100644 checks/uv.lock delete mode 100644 scripts/mstd_cpp_checks/cpp_checks.py delete mode 100644 scripts/mstd_cpp_checks/cpp_rules.py delete mode 100644 scripts/mstd_cpp_checks/cpp_types.py delete mode 100644 scripts/mstd_cpp_checks/enums.py diff --git a/scripts/mstd_cpp_checks/.gitignore b/checks/.gitignore similarity index 81% rename from scripts/mstd_cpp_checks/.gitignore rename to checks/.gitignore index 2ec96a6..faf1d67 100644 --- a/scripts/mstd_cpp_checks/.gitignore +++ b/checks/.gitignore @@ -1,3 +1,4 @@ __pycache__ *.pyc .ruff_cache +.venv/ diff --git a/checks/.python-version b/checks/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/checks/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/checks/README.md b/checks/README.md new file mode 100644 index 0000000..e69de29 diff --git a/checks/pyproject.toml b/checks/pyproject.toml new file mode 100644 index 0000000..40a3d2b --- /dev/null +++ b/checks/pyproject.toml @@ -0,0 +1,12 @@ +[project] +name = "checks" +version = "0.1.0" +description = "This package handles commit and CI checks for mstd" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "ruff>=0.14.6", +] + +[project.scripts] +cpp_checks = "checks.scripts.cpp_checks:main" \ No newline at end of file diff --git a/checks/src/checks.egg-info/PKG-INFO b/checks/src/checks.egg-info/PKG-INFO new file mode 100644 index 0000000..24f04e4 --- /dev/null +++ b/checks/src/checks.egg-info/PKG-INFO @@ -0,0 +1,7 @@ +Metadata-Version: 2.4 +Name: checks +Version: 0.1.0 +Summary: This package handles commit and CI checks for mstd +Requires-Python: >=3.12 +Description-Content-Type: text/markdown +Requires-Dist: ruff>=0.14.6 diff --git a/checks/src/checks.egg-info/SOURCES.txt b/checks/src/checks.egg-info/SOURCES.txt new file mode 100644 index 0000000..9a51d49 --- /dev/null +++ b/checks/src/checks.egg-info/SOURCES.txt @@ -0,0 +1,14 @@ +README.md +pyproject.toml +src/checks.egg-info/PKG-INFO +src/checks.egg-info/SOURCES.txt +src/checks.egg-info/dependency_links.txt +src/checks.egg-info/entry_points.txt +src/checks.egg-info/requires.txt +src/checks.egg-info/top_level.txt +src/checks/mstd_cpp_checks/cpp_rules.py +src/checks/mstd_cpp_checks/cpp_types.py +src/checks/mstd_cpp_checks/enums.py +src/checks/mstd_cpp_checks/files.py +src/checks/mstd_cpp_checks/rules.py +src/checks/scripts/cpp_checks.py \ No newline at end of file diff --git a/checks/src/checks.egg-info/dependency_links.txt b/checks/src/checks.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/checks/src/checks.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/checks/src/checks.egg-info/entry_points.txt b/checks/src/checks.egg-info/entry_points.txt new file mode 100644 index 0000000..cd68e03 --- /dev/null +++ b/checks/src/checks.egg-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +cpp_checks = checks.scripts.cpp_checks:main diff --git a/checks/src/checks.egg-info/requires.txt b/checks/src/checks.egg-info/requires.txt new file mode 100644 index 0000000..656cdc8 --- /dev/null +++ b/checks/src/checks.egg-info/requires.txt @@ -0,0 +1 @@ +ruff>=0.14.6 diff --git a/checks/src/checks.egg-info/top_level.txt b/checks/src/checks.egg-info/top_level.txt new file mode 100644 index 0000000..7780991 --- /dev/null +++ b/checks/src/checks.egg-info/top_level.txt @@ -0,0 +1 @@ +checks diff --git a/checks/src/checks/__init__.py b/checks/src/checks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/checks/src/checks/cpp_rules.py b/checks/src/checks/cpp_rules.py new file mode 100644 index 0000000..098c3b1 --- /dev/null +++ b/checks/src/checks/cpp_rules.py @@ -0,0 +1,32 @@ +"""C++ rules for mstd checks.""" + +from checks.files import FileType +from checks.results import ResultType +from checks.utils import check_key_sequence_ordered + + +def static_constexpr_inline_rule(line: str) -> ResultType: + """Check for usage of static, constexpr, and inline in variable declarations. + + Parameters + ---------- + line: str + The line of code to check. + + Returns + ------- + cpp_types.ResultType: + Result of the check, Warning if all keywords are not present, Ok otherwise + + """ + key_sequence = ["static", "inline", "constexpr"] + return check_key_sequence_ordered(key_sequence, line) + + +cpp_rules = [] +cpp_rules.append( + [ + {FileType.CPPHeader, FileType.CPPSource}, + static_constexpr_inline_rule + ] +) diff --git a/checks/src/checks/enums.py b/checks/src/checks/enums.py new file mode 100644 index 0000000..5f4ee4a --- /dev/null +++ b/checks/src/checks/enums.py @@ -0,0 +1,20 @@ +"""Module defining enumerations used in C++ checks.""" + +from enum import Enum + + +class FileType(Enum): + """Enumeration of file types for C++ checks.""" + + UNKNOWN = 0 + CPPHeader = 1 + CPPSource = 2 + CMakeLists = 3 + + +class ResultTypeEnum(Enum): + """Enumeration of result types for C++ type checks.""" + + Ok = 0 + Warning = 1 + Error = 2 diff --git a/checks/src/checks/files/__init__.py b/checks/src/checks/files/__init__.py new file mode 100644 index 0000000..3ef7576 --- /dev/null +++ b/checks/src/checks/files/__init__.py @@ -0,0 +1,6 @@ +"""Top level package for file operations in mstd checks.""" + +from .files import __BASE_DIR__, FileType, get_files_in_dirs, get_staged_files, determine_file_type + +__all__ = ["__BASE_DIR__", "FileType", "get_files_in_dirs", + "get_staged_files", "determine_file_type"] diff --git a/scripts/mstd_cpp_checks/files.py b/checks/src/checks/files/files.py similarity index 70% rename from scripts/mstd_cpp_checks/files.py rename to checks/src/checks/files/files.py index 0925dcd..2239f9a 100644 --- a/scripts/mstd_cpp_checks/files.py +++ b/checks/src/checks/files/files.py @@ -1,35 +1,23 @@ -/***************************************************************************** - +"""Module for file operations in mstd checks.""" - mstd library - Copyright (C) 2025-now Jakob Gamper - - This program 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. - - This program 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 . - - -******************************************************************************/ - -"""Module for file operations in C++ checks.""" +from __future__ import annotations import subprocess +from enum import Enum from pathlib import Path -from enums import FileType - __BASE_DIR__ = Path(__file__).parent.parent.parent.resolve() +class FileType(Enum): + """Enumeration of file types for mstd checks.""" + + UNKNOWN = 0 + CPPHeader = 1 + CPPSource = 2 + CMakeLists = 3 + + def determine_file_type(filename: str | Path) -> FileType: """Determine the file type based on the filename extension. diff --git a/checks/src/checks/results/__init__.py b/checks/src/checks/results/__init__.py new file mode 100644 index 0000000..52468e1 --- /dev/null +++ b/checks/src/checks/results/__init__.py @@ -0,0 +1,5 @@ +"""Top level package for check result types.""" + +from .result_type import ResultType, ResultTypeEnum + +__all__ = ["ResultType", "ResultTypeEnum"] diff --git a/checks/src/checks/results/result_type.py b/checks/src/checks/results/result_type.py new file mode 100644 index 0000000..c448ba3 --- /dev/null +++ b/checks/src/checks/results/result_type.py @@ -0,0 +1,26 @@ +"""Module defining result types for mstd checks.""" + +from __future__ import annotations + +from enum import Enum + + +class ResultTypeEnum(Enum): + """Enumeration of result types for mstd checks.""" + + Ok = "ok" + Warning = "warning" + Error = "error" + + +class ResultType: + """Class representing the result of a mstd type check.""" + + def __init__( + self, + value: ResultTypeEnum, + description: str | None = None + ) -> None: + """Initialize ResultType with a value and optional description.""" + self.value = value + self.description = description diff --git a/scripts/mstd_cpp_checks/ruff.toml b/checks/src/checks/ruff.toml similarity index 99% rename from scripts/mstd_cpp_checks/ruff.toml rename to checks/src/checks/ruff.toml index 8db0230..0a18c6e 100644 --- a/scripts/mstd_cpp_checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -1,4 +1,3 @@ - [lint] select = ["ALL"] ignore = [ diff --git a/scripts/mstd_cpp_checks/rules.py b/checks/src/checks/rules.py similarity index 55% rename from scripts/mstd_cpp_checks/rules.py rename to checks/src/checks/rules.py index 56c1505..516b363 100644 --- a/scripts/mstd_cpp_checks/rules.py +++ b/checks/src/checks/rules.py @@ -1,32 +1,10 @@ -/***************************************************************************** - - - mstd library - Copyright (C) 2025-now Jakob Gamper - - This program 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. - - This program 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 . - - -******************************************************************************/ - """Module defining how to handle rules for C++ checks.""" import logging from pathlib import Path -from enums import FileType, ResultTypeEnum -from files import determine_file_type +from checks.files import FileType, determine_file_type +from checks.results import ResultTypeEnum rule_logger = logging.getLogger("mstd_cpp_checks.rules") diff --git a/checks/src/checks/scripts/__init__.py b/checks/src/checks/scripts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py new file mode 100644 index 0000000..54f7edd --- /dev/null +++ b/checks/src/checks/scripts/cpp_checks.py @@ -0,0 +1,36 @@ +"""Module defining C++ check rules.""" + +import logging +import sys + +from checks.cpp_rules import cpp_rules +from checks.enums import FileType +from checks.files import __BASE_DIR__, get_files_in_dirs, get_staged_files +from checks.rules import check_file + +__CPP_DIRS__ = ["include", "test"] +__OTHER_DIRS__ = ["scripts"] +__EXCLUDE_DIRS__ = ["__pycache__", ".ruff_cache"] +__EXCLUDE_FILES__ = [".gitignore"] + +__DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ + +cpp_check_logger = logging.getLogger("mstd_cpp_checks") + + +def run_checks(rules: list[set[FileType], callable]) -> None: + + if "full" in sys.argv: + cpp_check_logger.info("Running full checks...") + dirs = [__BASE_DIR__ / dir_name for dir_name in __DIRS__] + files = get_files_in_dirs(dirs, __EXCLUDE_DIRS__, __EXCLUDE_FILES__) + else: + cpp_check_logger.info("Running checks on staged files...") + files = get_staged_files() + + for filename in files: + check_file(filename, rules) + + +def main() -> None: + run_checks(cpp_rules) diff --git a/checks/src/checks/utils/__init__.py b/checks/src/checks/utils/__init__.py new file mode 100644 index 0000000..767e0fa --- /dev/null +++ b/checks/src/checks/utils/__init__.py @@ -0,0 +1,5 @@ +"""Top level package for utility functions in mstd checks.""" + +from .utils import check_key_sequence_ordered + +__all__ = ["check_key_sequence_ordered"] diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py new file mode 100644 index 0000000..c0be335 --- /dev/null +++ b/checks/src/checks/utils/utils.py @@ -0,0 +1,46 @@ +"""Module defining utility functions for mstd checks.""" + +from __future__ import annotations + +from checks.results import ResultType, ResultTypeEnum + + +def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType: + """Check if keys in key_sequence appear in order on the given line. + + Parameters + ---------- + key_sequence: list[str] + The sequence of keys to check for order. + line: str + The line of text to check. + filename: str + The name of the file containing the line. + linenumber: int + The line number in the file. + + Returns + ------- + ResultType: + Result of the check, Warning if keys are out of order, Ok otherwise + + """ + if not isinstance(key_sequence, list): + msg = f"key_sequence {key_sequence} must be a list" + raise TypeError(msg) + + line_elements = line.split() + indices = [ + line_elements.index(key) + for key in key_sequence + if key in line_elements + ] + + if len(indices) == len(key_sequence) and sorted(indices) != indices: + return ResultType( + ResultTypeEnum.Warning, + f"key_sequence {key_sequence} not ordered correctly " + f"in line {line}." + ) + + return ResultType(ResultTypeEnum.Ok) diff --git a/checks/uv.lock b/checks/uv.lock new file mode 100644 index 0000000..8e3cf63 --- /dev/null +++ b/checks/uv.lock @@ -0,0 +1,40 @@ +version = 1 +revision = 3 +requires-python = ">=3.12" + +[[package]] +name = "checks" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [{ name = "ruff", specifier = ">=0.14.6" }] + +[[package]] +name = "ruff" +version = "0.14.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/f0/62b5a1a723fe183650109407fa56abb433b00aa1c0b9ba555f9c4efec2c6/ruff-0.14.6.tar.gz", hash = "sha256:6f0c742ca6a7783a736b867a263b9a7a80a45ce9bee391eeda296895f1b4e1cc", size = 5669501, upload-time = "2025-11-21T14:26:17.903Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/d2/7dd544116d107fffb24a0064d41a5d2ed1c9d6372d142f9ba108c8e39207/ruff-0.14.6-py3-none-linux_armv6l.whl", hash = "sha256:d724ac2f1c240dbd01a2ae98db5d1d9a5e1d9e96eba999d1c48e30062df578a3", size = 13326119, upload-time = "2025-11-21T14:25:24.2Z" }, + { url = "https://files.pythonhosted.org/packages/36/6a/ad66d0a3315d6327ed6b01f759d83df3c4d5f86c30462121024361137b6a/ruff-0.14.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9f7539ea257aa4d07b7ce87aed580e485c40143f2473ff2f2b75aee003186004", size = 13526007, upload-time = "2025-11-21T14:25:26.906Z" }, + { url = "https://files.pythonhosted.org/packages/a3/9d/dae6db96df28e0a15dea8e986ee393af70fc97fd57669808728080529c37/ruff-0.14.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7f6007e55b90a2a7e93083ba48a9f23c3158c433591c33ee2e99a49b889c6332", size = 12676572, upload-time = "2025-11-21T14:25:29.826Z" }, + { url = "https://files.pythonhosted.org/packages/76/a4/f319e87759949062cfee1b26245048e92e2acce900ad3a909285f9db1859/ruff-0.14.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a8e7b9d73d8728b68f632aa8e824ef041d068d231d8dbc7808532d3629a6bef", size = 13140745, upload-time = "2025-11-21T14:25:32.788Z" }, + { url = "https://files.pythonhosted.org/packages/95/d3/248c1efc71a0a8ed4e8e10b4b2266845d7dfc7a0ab64354afe049eaa1310/ruff-0.14.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d50d45d4553a3ebcbd33e7c5e0fe6ca4aafd9a9122492de357205c2c48f00775", size = 13076486, upload-time = "2025-11-21T14:25:35.601Z" }, + { url = "https://files.pythonhosted.org/packages/a5/19/b68d4563fe50eba4b8c92aa842149bb56dd24d198389c0ed12e7faff4f7d/ruff-0.14.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:118548dd121f8a21bfa8ab2c5b80e5b4aed67ead4b7567790962554f38e598ce", size = 13727563, upload-time = "2025-11-21T14:25:38.514Z" }, + { url = "https://files.pythonhosted.org/packages/47/ac/943169436832d4b0e867235abbdb57ce3a82367b47e0280fa7b4eabb7593/ruff-0.14.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:57256efafbfefcb8748df9d1d766062f62b20150691021f8ab79e2d919f7c11f", size = 15199755, upload-time = "2025-11-21T14:25:41.516Z" }, + { url = "https://files.pythonhosted.org/packages/c9/b9/288bb2399860a36d4bb0541cb66cce3c0f4156aaff009dc8499be0c24bf2/ruff-0.14.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ff18134841e5c68f8e5df1999a64429a02d5549036b394fafbe410f886e1989d", size = 14850608, upload-time = "2025-11-21T14:25:44.428Z" }, + { url = "https://files.pythonhosted.org/packages/ee/b1/a0d549dd4364e240f37e7d2907e97ee80587480d98c7799d2d8dc7a2f605/ruff-0.14.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:29c4b7ec1e66a105d5c27bd57fa93203637d66a26d10ca9809dc7fc18ec58440", size = 14118754, upload-time = "2025-11-21T14:25:47.214Z" }, + { url = "https://files.pythonhosted.org/packages/13/ac/9b9fe63716af8bdfddfacd0882bc1586f29985d3b988b3c62ddce2e202c3/ruff-0.14.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167843a6f78680746d7e226f255d920aeed5e4ad9c03258094a2d49d3028b105", size = 13949214, upload-time = "2025-11-21T14:25:50.002Z" }, + { url = "https://files.pythonhosted.org/packages/12/27/4dad6c6a77fede9560b7df6802b1b697e97e49ceabe1f12baf3ea20862e9/ruff-0.14.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:16a33af621c9c523b1ae006b1b99b159bf5ac7e4b1f20b85b2572455018e0821", size = 14106112, upload-time = "2025-11-21T14:25:52.841Z" }, + { url = "https://files.pythonhosted.org/packages/6a/db/23e322d7177873eaedea59a7932ca5084ec5b7e20cb30f341ab594130a71/ruff-0.14.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1432ab6e1ae2dc565a7eea707d3b03a0c234ef401482a6f1621bc1f427c2ff55", size = 13035010, upload-time = "2025-11-21T14:25:55.536Z" }, + { url = "https://files.pythonhosted.org/packages/a8/9c/20e21d4d69dbb35e6a1df7691e02f363423658a20a2afacf2a2c011800dc/ruff-0.14.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4c55cfbbe7abb61eb914bfd20683d14cdfb38a6d56c6c66efa55ec6570ee4e71", size = 13054082, upload-time = "2025-11-21T14:25:58.625Z" }, + { url = "https://files.pythonhosted.org/packages/66/25/906ee6a0464c3125c8d673c589771a974965c2be1a1e28b5c3b96cb6ef88/ruff-0.14.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:efea3c0f21901a685fff4befda6d61a1bf4cb43de16da87e8226a281d614350b", size = 13303354, upload-time = "2025-11-21T14:26:01.816Z" }, + { url = "https://files.pythonhosted.org/packages/4c/58/60577569e198d56922b7ead07b465f559002b7b11d53f40937e95067ca1c/ruff-0.14.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:344d97172576d75dc6afc0e9243376dbe1668559c72de1864439c4fc95f78185", size = 14054487, upload-time = "2025-11-21T14:26:05.058Z" }, + { url = "https://files.pythonhosted.org/packages/67/0b/8e4e0639e4cc12547f41cb771b0b44ec8225b6b6a93393176d75fe6f7d40/ruff-0.14.6-py3-none-win32.whl", hash = "sha256:00169c0c8b85396516fdd9ce3446c7ca20c2a8f90a77aa945ba6b8f2bfe99e85", size = 13013361, upload-time = "2025-11-21T14:26:08.152Z" }, + { url = "https://files.pythonhosted.org/packages/fb/02/82240553b77fd1341f80ebb3eaae43ba011c7a91b4224a9f317d8e6591af/ruff-0.14.6-py3-none-win_amd64.whl", hash = "sha256:390e6480c5e3659f8a4c8d6a0373027820419ac14fa0d2713bd8e6c3e125b8b9", size = 14432087, upload-time = "2025-11-21T14:26:10.891Z" }, + { url = "https://files.pythonhosted.org/packages/a5/1f/93f9b0fad9470e4c829a5bb678da4012f0c710d09331b860ee555216f4ea/ruff-0.14.6-py3-none-win_arm64.whl", hash = "sha256:d43c81fbeae52cfa8728d8766bbf46ee4298c888072105815b392da70ca836b2", size = 13520930, upload-time = "2025-11-21T14:26:13.951Z" }, +] diff --git a/scripts/addLicense.sh b/scripts/addLicense.sh index e6afdea..ceac578 100755 --- a/scripts/addLicense.sh +++ b/scripts/addLicense.sh @@ -1,4 +1,4 @@ -for i in $(find test/ include/ scripts/mstd_cpp_checks -regex ".*\.\(hpp\|cpp\|c\|h\|py\)$"); do +for i in $(find test/ include/ -regex ".*\.\(hpp\|cpp\|c\|h\)$"); do if ! grep -q Copyright $i; then diff --git a/scripts/mstd_cpp_checks/cpp_checks.py b/scripts/mstd_cpp_checks/cpp_checks.py deleted file mode 100644 index 4c7fcef..0000000 --- a/scripts/mstd_cpp_checks/cpp_checks.py +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************** - - - mstd library - Copyright (C) 2025-now Jakob Gamper - - This program 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. - - This program 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 . - - -******************************************************************************/ - -"""Module defining C++ check rules.""" - -import logging -import sys - -from cpp_rules import cpp_rules -from enums import FileType -from files import __BASE_DIR__, get_files_in_dirs, get_staged_files -from rules import check_file - -__CPP_DIRS__ = ["include", "test"] -__OTHER_DIRS__ = ["scripts"] -__EXCLUDE_DIRS__ = ["__pycache__", ".ruff_cache"] -__EXCLUDE_FILES__ = [".gitignore"] - -__DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ - -cpp_check_logger = logging.getLogger("mstd_cpp_checks") - - -def run_checks(rules: list[set[FileType], callable]) -> None: - - if "full" in sys.argv: - cpp_check_logger.info("Running full checks...") - dirs = [__BASE_DIR__ / dir_name for dir_name in __DIRS__] - files = get_files_in_dirs(dirs, __EXCLUDE_DIRS__, __EXCLUDE_FILES__) - else: - cpp_check_logger.info("Running checks on staged files...") - files = get_staged_files() - - for filename in files: - check_file(filename, rules) - - -if __name__ == "__main__": - run_checks(cpp_rules) diff --git a/scripts/mstd_cpp_checks/cpp_rules.py b/scripts/mstd_cpp_checks/cpp_rules.py deleted file mode 100644 index 146f28d..0000000 --- a/scripts/mstd_cpp_checks/cpp_rules.py +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** - - - mstd library - Copyright (C) 2025-now Jakob Gamper - - This program 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. - - This program 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 . - - -******************************************************************************/ - -from cpp_types import ResultType -from enums import FileType, check_key_sequence_ordered - - -def static_constexpr_inline_rule(line: str) -> ResultType: - """Check for usage of static, constexpr, and inline in variable declarations. - - Parameters - ---------- - line: str - The line of code to check. - - Returns - ------- - cpp_types.ResultType: - Result of the check, Warning if all keywords are not present, Ok otherwise - - """ - key_sequence = ["static", "inline", "constexpr"] - return check_key_sequence_ordered(key_sequence, line) - - -cpp_rules = [] -cpp_rules.append( - [ - {FileType.CPPHeader, FileType.CPPSource}, - static_constexpr_inline_rule - ] -) diff --git a/scripts/mstd_cpp_checks/cpp_types.py b/scripts/mstd_cpp_checks/cpp_types.py deleted file mode 100644 index a729478..0000000 --- a/scripts/mstd_cpp_checks/cpp_types.py +++ /dev/null @@ -1,81 +0,0 @@ -/***************************************************************************** - - - mstd library - Copyright (C) 2025-now Jakob Gamper - - This program 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. - - This program 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 . - - -******************************************************************************/ - -"""Module defining C++ type checking utilities.""" - -from __future__ import annotations - -from enums import ResultTypeEnum - - -class ResultType: - """Class representing the result of a C++ type check.""" - - def __init__( - self, - value: ResultTypeEnum, - description: str | None = None - ) -> None: - """Initialize ResultType with a value and optional description.""" - self.value = value - self.description = description - - -def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType: - """Check if keys in key_sequence appear in order on the given line. - - Parameters - ---------- - key_sequence: list[str] - The sequence of keys to check for order. - line: str - The line of text to check. - filename: str - The name of the file containing the line. - linenumber: int - The line number in the file. - - Returns - ------- - ResultType: - Result of the check, Warning if keys are out of order, Ok otherwise - - """ - if not isinstance(key_sequence, list): - msg = f"key_sequence {key_sequence} must be a list" - raise TypeError(msg) - - line_elements = line.split() - indices = [ - line_elements.index(key) - for key in key_sequence - if key in line_elements - ] - - if len(indices) == len(key_sequence) and sorted(indices) != indices: - return ResultType( - ResultTypeEnum.Warning, - f"key_sequence {key_sequence} not ordered correctly " - f"in line {line}." - ) - - return ResultType(ResultTypeEnum.Ok) diff --git a/scripts/mstd_cpp_checks/enums.py b/scripts/mstd_cpp_checks/enums.py deleted file mode 100644 index f382489..0000000 --- a/scripts/mstd_cpp_checks/enums.py +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - - - mstd library - Copyright (C) 2025-now Jakob Gamper - - This program 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. - - This program 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 . - - -******************************************************************************/ - -"""Module defining enumerations used in C++ checks.""" - -from enum import Enum - - -class FileType(Enum): - """Enumeration of file types for C++ checks.""" - - UNKNOWN = 0 - CPPHeader = 1 - CPPSource = 2 - CMakeLists = 3 - - -class ResultTypeEnum(Enum): - """Enumeration of result types for C++ type checks.""" - - Ok = 0 - Warning = 1 - Error = 2 From 37ab7936884a92d2c63ef05beab9bba56ba5c562 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 23 Nov 2025 11:16:32 +0100 Subject: [PATCH 008/115] refactor: cleanup checks package --- checks/src/checks/__init__.py | 7 +++++++ checks/src/checks/files/__init__.py | 15 ++++++++++++--- checks/src/checks/files/files.py | 5 +++-- checks/src/checks/logger/__init__.py | 5 +++++ checks/src/checks/logger/logger.py | 6 ++++++ checks/src/checks/scripts/__init__.py | 1 + checks/src/checks/scripts/cpp_checks.py | 11 +++++------ 7 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 checks/src/checks/logger/__init__.py create mode 100644 checks/src/checks/logger/logger.py diff --git a/checks/src/checks/__init__.py b/checks/src/checks/__init__.py index e69de29..2f5cd90 100644 --- a/checks/src/checks/__init__.py +++ b/checks/src/checks/__init__.py @@ -0,0 +1,7 @@ +"""Top level package for mstd checks.""" + +from pathlib import Path + +__BASE_DIR__ = Path(__file__).resolve().parent.parent + +__all__ = ["__BASE_DIR__"] diff --git a/checks/src/checks/files/__init__.py b/checks/src/checks/files/__init__.py index 3ef7576..da756dc 100644 --- a/checks/src/checks/files/__init__.py +++ b/checks/src/checks/files/__init__.py @@ -1,6 +1,15 @@ """Top level package for file operations in mstd checks.""" -from .files import __BASE_DIR__, FileType, get_files_in_dirs, get_staged_files, determine_file_type +from pathlib import Path -__all__ = ["__BASE_DIR__", "FileType", "get_files_in_dirs", - "get_staged_files", "determine_file_type"] +from .files import FileType, determine_file_type, get_files_in_dirs, get_staged_files + +__EXECUTION_DIR__ = Path.cwd() + +__all__ = [ + "__EXECUTION_DIR__", + "FileType", + "determine_file_type", + "get_files_in_dirs", + "get_staged_files" +] diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index 2239f9a..514b12d 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -3,10 +3,11 @@ from __future__ import annotations import subprocess +import typing from enum import Enum -from pathlib import Path -__BASE_DIR__ = Path(__file__).parent.parent.parent.resolve() +if typing.TYPE_CHECKING: + from pathlib import Path class FileType(Enum): diff --git a/checks/src/checks/logger/__init__.py b/checks/src/checks/logger/__init__.py new file mode 100644 index 0000000..fadd0d0 --- /dev/null +++ b/checks/src/checks/logger/__init__.py @@ -0,0 +1,5 @@ +"""Top level package for logger in mstd checks.""" + +from .logger import cpp_check_logger + +__all__ = ["cpp_check_logger"] diff --git a/checks/src/checks/logger/logger.py b/checks/src/checks/logger/logger.py new file mode 100644 index 0000000..9311a2d --- /dev/null +++ b/checks/src/checks/logger/logger.py @@ -0,0 +1,6 @@ +"""Module initializing logger for mstd checks.""" +import logging + +logging.basicConfig(level=logging.INFO) + +cpp_check_logger = logging.getLogger("cpp_checks") diff --git a/checks/src/checks/scripts/__init__.py b/checks/src/checks/scripts/__init__.py index e69de29..458a2da 100644 --- a/checks/src/checks/scripts/__init__.py +++ b/checks/src/checks/scripts/__init__.py @@ -0,0 +1 @@ +"""Top level package for script operations in mstd checks.""" diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index 54f7edd..e42f8ed 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -1,11 +1,11 @@ """Module defining C++ check rules.""" -import logging import sys from checks.cpp_rules import cpp_rules from checks.enums import FileType -from checks.files import __BASE_DIR__, get_files_in_dirs, get_staged_files +from checks.files import __EXECUTION_DIR__, get_files_in_dirs, get_staged_files +from checks.logger import cpp_check_logger from checks.rules import check_file __CPP_DIRS__ = ["include", "test"] @@ -15,14 +15,12 @@ __DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ -cpp_check_logger = logging.getLogger("mstd_cpp_checks") - def run_checks(rules: list[set[FileType], callable]) -> None: - + """Run C++ checks based on the provided rules.""" if "full" in sys.argv: cpp_check_logger.info("Running full checks...") - dirs = [__BASE_DIR__ / dir_name for dir_name in __DIRS__] + dirs = [__EXECUTION_DIR__ / dir_name for dir_name in __DIRS__] files = get_files_in_dirs(dirs, __EXCLUDE_DIRS__, __EXCLUDE_FILES__) else: cpp_check_logger.info("Running checks on staged files...") @@ -33,4 +31,5 @@ def run_checks(rules: list[set[FileType], callable]) -> None: def main() -> None: + """Run C++ checks.""" run_checks(cpp_rules) From ad5459623ec8a47497bff3346bd015bc70c88229 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 23 Nov 2025 11:33:28 +0100 Subject: [PATCH 009/115] refactor: remove egg-info metadata files for checks package --- checks/src/checks.egg-info/PKG-INFO | 7 ------- checks/src/checks.egg-info/SOURCES.txt | 14 -------------- checks/src/checks.egg-info/dependency_links.txt | 1 - checks/src/checks.egg-info/entry_points.txt | 2 -- checks/src/checks.egg-info/requires.txt | 1 - checks/src/checks.egg-info/top_level.txt | 1 - 6 files changed, 26 deletions(-) delete mode 100644 checks/src/checks.egg-info/PKG-INFO delete mode 100644 checks/src/checks.egg-info/SOURCES.txt delete mode 100644 checks/src/checks.egg-info/dependency_links.txt delete mode 100644 checks/src/checks.egg-info/entry_points.txt delete mode 100644 checks/src/checks.egg-info/requires.txt delete mode 100644 checks/src/checks.egg-info/top_level.txt diff --git a/checks/src/checks.egg-info/PKG-INFO b/checks/src/checks.egg-info/PKG-INFO deleted file mode 100644 index 24f04e4..0000000 --- a/checks/src/checks.egg-info/PKG-INFO +++ /dev/null @@ -1,7 +0,0 @@ -Metadata-Version: 2.4 -Name: checks -Version: 0.1.0 -Summary: This package handles commit and CI checks for mstd -Requires-Python: >=3.12 -Description-Content-Type: text/markdown -Requires-Dist: ruff>=0.14.6 diff --git a/checks/src/checks.egg-info/SOURCES.txt b/checks/src/checks.egg-info/SOURCES.txt deleted file mode 100644 index 9a51d49..0000000 --- a/checks/src/checks.egg-info/SOURCES.txt +++ /dev/null @@ -1,14 +0,0 @@ -README.md -pyproject.toml -src/checks.egg-info/PKG-INFO -src/checks.egg-info/SOURCES.txt -src/checks.egg-info/dependency_links.txt -src/checks.egg-info/entry_points.txt -src/checks.egg-info/requires.txt -src/checks.egg-info/top_level.txt -src/checks/mstd_cpp_checks/cpp_rules.py -src/checks/mstd_cpp_checks/cpp_types.py -src/checks/mstd_cpp_checks/enums.py -src/checks/mstd_cpp_checks/files.py -src/checks/mstd_cpp_checks/rules.py -src/checks/scripts/cpp_checks.py \ No newline at end of file diff --git a/checks/src/checks.egg-info/dependency_links.txt b/checks/src/checks.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/checks/src/checks.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/checks/src/checks.egg-info/entry_points.txt b/checks/src/checks.egg-info/entry_points.txt deleted file mode 100644 index cd68e03..0000000 --- a/checks/src/checks.egg-info/entry_points.txt +++ /dev/null @@ -1,2 +0,0 @@ -[console_scripts] -cpp_checks = checks.scripts.cpp_checks:main diff --git a/checks/src/checks.egg-info/requires.txt b/checks/src/checks.egg-info/requires.txt deleted file mode 100644 index 656cdc8..0000000 --- a/checks/src/checks.egg-info/requires.txt +++ /dev/null @@ -1 +0,0 @@ -ruff>=0.14.6 diff --git a/checks/src/checks.egg-info/top_level.txt b/checks/src/checks.egg-info/top_level.txt deleted file mode 100644 index 7780991..0000000 --- a/checks/src/checks.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -checks From 3e5df2ee7af27eb6ff7415f8582c2e2df899e454 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 23 Nov 2025 11:34:47 +0100 Subject: [PATCH 010/115] feat: update .gitignore, add pytest dependency, and implement FileType enumeration with tests --- .gitignore | 2 + checks/.gitignore | 2 + checks/pyproject.toml | 3 +- checks/src/checks/files/files.py | 12 ++++++ checks/src/checks/rules/__init__.py | 1 + checks/src/checks/rules/rules.py | 23 ++++++++++ checks/tests/__init__.py | 1 + checks/tests/files/__init__.py | 1 + checks/tests/files/test_files.py | 16 +++++++ checks/uv.lock | 67 ++++++++++++++++++++++++++++- 10 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 checks/src/checks/rules/__init__.py create mode 100644 checks/src/checks/rules/rules.py create mode 100644 checks/tests/__init__.py create mode 100644 checks/tests/files/__init__.py create mode 100644 checks/tests/files/test_files.py diff --git a/.gitignore b/.gitignore index ce61daa..39cc78e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .build build .cache +checks.egg-info/ +__pycache__/ diff --git a/checks/.gitignore b/checks/.gitignore index faf1d67..7f92207 100644 --- a/checks/.gitignore +++ b/checks/.gitignore @@ -2,3 +2,5 @@ __pycache__ *.pyc .ruff_cache .venv/ +dist/ +build/ diff --git a/checks/pyproject.toml b/checks/pyproject.toml index 40a3d2b..9c0ca11 100644 --- a/checks/pyproject.toml +++ b/checks/pyproject.toml @@ -5,8 +5,9 @@ description = "This package handles commit and CI checks for mstd" readme = "README.md" requires-python = ">=3.12" dependencies = [ + "pytest>=9.0.1", "ruff>=0.14.6", ] [project.scripts] -cpp_checks = "checks.scripts.cpp_checks:main" \ No newline at end of file +cpp_checks = "checks.scripts.cpp_checks:main" diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index 514b12d..5e37f4e 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -18,6 +18,18 @@ class FileType(Enum): CPPSource = 2 CMakeLists = 3 + @classmethod + def all_types(cls) -> set[FileType]: + """Get a set of all defined file types. + + Returns + ------- + set[FileType]: + A set containing all file types. + + """ + return set(cls) + def determine_file_type(filename: str | Path) -> FileType: """Determine the file type based on the filename extension. diff --git a/checks/src/checks/rules/__init__.py b/checks/src/checks/rules/__init__.py new file mode 100644 index 0000000..bdc6416 --- /dev/null +++ b/checks/src/checks/rules/__init__.py @@ -0,0 +1 @@ +"""Top level package for rules in mstd checks.""" diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py new file mode 100644 index 0000000..4b5db56 --- /dev/null +++ b/checks/src/checks/rules/rules.py @@ -0,0 +1,23 @@ +"""Module defining rules for mstd checks.""" +from __future__ import annotations + +from checks.files import FileType + + +class Rule: + """Base class for defining a rule.""" + + def __init__( + self, + name: str, + file_types: set[FileType] | None = None, + description: str | None = None + ) -> None: + """Initialize Rule with a name and optional description.""" + self.name = name + self.description = description + + if file_types is None: + self.file_types = FileType.all_types() + + self.file_types = file_types diff --git a/checks/tests/__init__.py b/checks/tests/__init__.py new file mode 100644 index 0000000..6cf7a62 --- /dev/null +++ b/checks/tests/__init__.py @@ -0,0 +1 @@ +"""Top level package for tests in mstd checks.""" diff --git a/checks/tests/files/__init__.py b/checks/tests/files/__init__.py new file mode 100644 index 0000000..41a6e13 --- /dev/null +++ b/checks/tests/files/__init__.py @@ -0,0 +1 @@ +"""Package for file-related tests in mstd checks.""" diff --git a/checks/tests/files/test_files.py b/checks/tests/files/test_files.py new file mode 100644 index 0000000..66e3136 --- /dev/null +++ b/checks/tests/files/test_files.py @@ -0,0 +1,16 @@ +"""Unit tests for file-related functionality in mstd checks.""" + + +def test_get_all_file_types(): + from checks.files import FileType + + expected_types = { + FileType.CPPHeader, + FileType.CPPSource, + FileType.UNKNOWN, + FileType.CMakeLists + } + + actual_types = FileType.all_types() + + assert actual_types == expected_types, "FileType enum does not match expected types." diff --git a/checks/uv.lock b/checks/uv.lock index 8e3cf63..b4677f6 100644 --- a/checks/uv.lock +++ b/checks/uv.lock @@ -7,11 +7,76 @@ name = "checks" version = "0.1.0" source = { virtual = "." } dependencies = [ + { name = "pytest" }, { name = "ruff" }, ] [package.metadata] -requires-dist = [{ name = "ruff", specifier = ">=0.14.6" }] +requires-dist = [ + { name = "pytest", specifier = ">=9.0.1" }, + { name = "ruff", specifier = ">=0.14.6" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/07/56/f013048ac4bc4c1d9be45afd4ab209ea62822fb1598f40687e6bf45dcea4/pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8", size = 1564125, upload-time = "2025-11-12T13:05:09.333Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, +] [[package]] name = "ruff" From bb16326c50ec7627a3b23020182816a4ff4f8190 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 23 Nov 2025 21:30:02 +0100 Subject: [PATCH 011/115] refactor: reorganize result types and rules, update logging configuration, and enhance cpp checks --- checks/src/checks/cpp_rules.py | 2 +- checks/src/checks/enums/__init__.py | 5 +++++ checks/src/checks/enums/base.py | 22 +++++++++++++++++++ checks/src/checks/logger/logger.py | 10 ++++++++- checks/src/checks/results/__init__.py | 5 ----- checks/src/checks/rules/__init__.py | 3 +++ .../checks/{results => rules}/result_type.py | 0 checks/src/checks/rules/rules.py | 21 ++++++++++++++++++ checks/src/checks/scripts/cpp_checks.py | 17 ++++++++++---- checks/src/checks/utils/utils.py | 2 +- 10 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 checks/src/checks/enums/__init__.py create mode 100644 checks/src/checks/enums/base.py delete mode 100644 checks/src/checks/results/__init__.py rename checks/src/checks/{results => rules}/result_type.py (100%) diff --git a/checks/src/checks/cpp_rules.py b/checks/src/checks/cpp_rules.py index 098c3b1..3312e34 100644 --- a/checks/src/checks/cpp_rules.py +++ b/checks/src/checks/cpp_rules.py @@ -1,7 +1,7 @@ """C++ rules for mstd checks.""" from checks.files import FileType -from checks.results import ResultType +from checks.rules import ResultType from checks.utils import check_key_sequence_ordered diff --git a/checks/src/checks/enums/__init__.py b/checks/src/checks/enums/__init__.py new file mode 100644 index 0000000..5d116e5 --- /dev/null +++ b/checks/src/checks/enums/__init__.py @@ -0,0 +1,5 @@ +"""Top level package for enums in mstd checks.""" + +from .base import StrEnum + +__all__ = ["StrEnum"] diff --git a/checks/src/checks/enums/base.py b/checks/src/checks/enums/base.py new file mode 100644 index 0000000..62b9daa --- /dev/null +++ b/checks/src/checks/enums/base.py @@ -0,0 +1,22 @@ +"""Base enumerations for mstd checks.""" + +from __future__ import annotations + +from enum import Enum + + +class StrEnum(Enum): + """Base class for string enumerations.""" + + def __str__(self) -> str: + """Return the string representation of the enumeration value.""" + return self.value.upper() + + @classmethod + def _missing_(cls, value: object) -> StrEnum | None: + """Handle missing enumeration values in a case-insensitive manner.""" + if isinstance(value, str): + for member in cls: + if member.value.upper() == value.upper(): + return member + return None diff --git a/checks/src/checks/logger/logger.py b/checks/src/checks/logger/logger.py index 9311a2d..1815672 100644 --- a/checks/src/checks/logger/logger.py +++ b/checks/src/checks/logger/logger.py @@ -1,6 +1,14 @@ """Module initializing logger for mstd checks.""" import logging +import os -logging.basicConfig(level=logging.INFO) +__DEBUG_MSTD_CHECKS__ = os.getenv("DEBUG_MSTD_CHECKS", "0") + +# TODO(97gamjak): centralize env logic if needed elsewhere +# https://github.com/97gamjak/mstd/issues/26 +if int(__DEBUG_MSTD_CHECKS__) > 0: + logging.basicConfig(level=logging.DEBUG) +else: + logging.basicConfig(level=logging.INFO) cpp_check_logger = logging.getLogger("cpp_checks") diff --git a/checks/src/checks/results/__init__.py b/checks/src/checks/results/__init__.py deleted file mode 100644 index 52468e1..0000000 --- a/checks/src/checks/results/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Top level package for check result types.""" - -from .result_type import ResultType, ResultTypeEnum - -__all__ = ["ResultType", "ResultTypeEnum"] diff --git a/checks/src/checks/rules/__init__.py b/checks/src/checks/rules/__init__.py index bdc6416..b83312b 100644 --- a/checks/src/checks/rules/__init__.py +++ b/checks/src/checks/rules/__init__.py @@ -1 +1,4 @@ """Top level package for rules in mstd checks.""" +from .result_type import ResultType, ResultTypeEnum + +__all__ = ["ResultType", "ResultTypeEnum"] diff --git a/checks/src/checks/results/result_type.py b/checks/src/checks/rules/result_type.py similarity index 100% rename from checks/src/checks/results/result_type.py rename to checks/src/checks/rules/result_type.py diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 4b5db56..bf55fd8 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -1,8 +1,21 @@ """Module defining rules for mstd checks.""" from __future__ import annotations +import typing + +from checks.enums import StrEnum from checks.files import FileType +if typing.TYPE_CHECKING: + from .result_type import ResultType + + +class RuleType(StrEnum): + """Enumeration of rule types for mstd checks.""" + + GENERAL = "GENERAL" + CPP_STYLE = "CPP_STYLE" + class Rule: """Base class for defining a rule.""" @@ -10,14 +23,22 @@ class Rule: def __init__( self, name: str, + func: callable, + rule_type: RuleType = RuleType.GENERAL, file_types: set[FileType] | None = None, description: str | None = None ) -> None: """Initialize Rule with a name and optional description.""" self.name = name self.description = description + self.func = func + self.rule_type = rule_type if file_types is None: self.file_types = FileType.all_types() self.file_types = file_types + + def apply(self, kwargs: dict[str, typing.Any]) -> ResultType: + """Apply the rule on a specific line.""" + return self.func(**kwargs) diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index e42f8ed..2a5df51 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -3,10 +3,13 @@ import sys from checks.cpp_rules import cpp_rules -from checks.enums import FileType -from checks.files import __EXECUTION_DIR__, get_files_in_dirs, get_staged_files +from checks.files import ( + __EXECUTION_DIR__, + FileType, + get_files_in_dirs, + get_staged_files, +) from checks.logger import cpp_check_logger -from checks.rules import check_file __CPP_DIRS__ = ["include", "test"] __OTHER_DIRS__ = ["scripts"] @@ -20,14 +23,20 @@ def run_checks(rules: list[set[FileType], callable]) -> None: """Run C++ checks based on the provided rules.""" if "full" in sys.argv: cpp_check_logger.info("Running full checks...") + cpp_check_logger.debug(f"Checking directories: {__DIRS__}") dirs = [__EXECUTION_DIR__ / dir_name for dir_name in __DIRS__] files = get_files_in_dirs(dirs, __EXCLUDE_DIRS__, __EXCLUDE_FILES__) else: cpp_check_logger.info("Running checks on staged files...") files = get_staged_files() + if not files: + cpp_check_logger.warning("No files to check.") + return + for filename in files: - check_file(filename, rules) + cpp_check_logger.info( + f"Checking file: {filename}, rules: {len(rules)}") def main() -> None: diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index c0be335..c29f023 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -2,7 +2,7 @@ from __future__ import annotations -from checks.results import ResultType, ResultTypeEnum +from checks.rules import ResultType, ResultTypeEnum def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType: From 56b718a96bb96ab113e5dc43b72022bb1f0c816f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Mon, 24 Nov 2025 17:27:43 +0100 Subject: [PATCH 012/115] refactor: enhance C++ rule checks, improve key sequence validation, and update file type handling --- checks/src/checks/cpp_rules.py | 36 +++++++++++-------------- checks/src/checks/files/files.py | 5 ++++ checks/src/checks/rules/__init__.py | 3 ++- checks/src/checks/rules/rules.py | 27 ++++++++++++++++++- checks/src/checks/scripts/cpp_checks.py | 7 ++++- checks/src/checks/utils/utils.py | 22 +++++++-------- scripts/.gitignore | 1 - 7 files changed, 65 insertions(+), 36 deletions(-) delete mode 100644 scripts/.gitignore diff --git a/checks/src/checks/cpp_rules.py b/checks/src/checks/cpp_rules.py index 3312e34..1db17b7 100644 --- a/checks/src/checks/cpp_rules.py +++ b/checks/src/checks/cpp_rules.py @@ -1,32 +1,26 @@ """C++ rules for mstd checks.""" -from checks.files import FileType -from checks.rules import ResultType +from checks.rules import Rule, RuleInputType, RuleType from checks.utils import check_key_sequence_ordered -def static_constexpr_inline_rule(line: str) -> ResultType: - """Check for usage of static, constexpr, and inline in variable declarations. +class CheckKeySeqOrder(Rule): + def __init__(self, key_sequence: str) -> None: + super().__init__( + name=key_sequence, + func=lambda line: check_key_sequence_ordered( + key_sequence, + line + ), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + description=f'Use "{key_sequence}" only in this given order.' + ) - Parameters - ---------- - line: str - The line of code to check. - - Returns - ------- - cpp_types.ResultType: - Result of the check, Warning if all keywords are not present, Ok otherwise - - """ - key_sequence = ["static", "inline", "constexpr"] - return check_key_sequence_ordered(key_sequence, line) +rule01 = CheckKeySeqOrder("static inline constexpr") cpp_rules = [] cpp_rules.append( - [ - {FileType.CPPHeader, FileType.CPPSource}, - static_constexpr_inline_rule - ] + rule01 ) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index 5e37f4e..1a3326a 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -30,6 +30,11 @@ def all_types(cls) -> set[FileType]: """ return set(cls) + @classmethod + def cpp_types(cls) -> set[FileType]: + """Get a set of all CPP related file types.""" + return set(FileType.CPPHeader, FileType.CPPSource) + def determine_file_type(filename: str | Path) -> FileType: """Determine the file type based on the filename extension. diff --git a/checks/src/checks/rules/__init__.py b/checks/src/checks/rules/__init__.py index b83312b..2c27cc8 100644 --- a/checks/src/checks/rules/__init__.py +++ b/checks/src/checks/rules/__init__.py @@ -1,4 +1,5 @@ """Top level package for rules in mstd checks.""" from .result_type import ResultType, ResultTypeEnum +from .rules import Rule, RuleInputType, RuleType -__all__ = ["ResultType", "ResultTypeEnum"] +__all__ = ["ResultType", "ResultTypeEnum", "Rule", "RuleInputType", "RuleType"] diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index bf55fd8..0ee298b 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -16,6 +16,18 @@ class RuleType(StrEnum): GENERAL = "GENERAL" CPP_STYLE = "CPP_STYLE" + @classmethod + def cpp_rules(cls) -> set[RuleType]: + return set(RuleType.CPP_STYLE) + + +class RuleInputType(StrEnum): + """Enumeration of rule input types for mstd checks.""" + + NONE = "NONE" + LINE = "LINE" + FILE = "FILE" + class Rule: """Base class for defining a rule.""" @@ -25,6 +37,7 @@ def __init__( name: str, func: callable, rule_type: RuleType = RuleType.GENERAL, + rule_input_type: RuleInputType = RuleInputType.NONE, file_types: set[FileType] | None = None, description: str | None = None ) -> None: @@ -33,8 +46,12 @@ def __init__( self.description = description self.func = func self.rule_type = rule_type + self.rule_input_type = rule_input_type - if file_types is None: + if file_types is None and rule_type == RuleType.CPP_STYLE: + # use only cpp file types if user gives explicit CPP_STYLE rule + self.file_types = FileType.cpp_types() + elif file_types is None: self.file_types = FileType.all_types() self.file_types = file_types @@ -42,3 +59,11 @@ def __init__( def apply(self, kwargs: dict[str, typing.Any]) -> ResultType: """Apply the rule on a specific line.""" return self.func(**kwargs) + + +def filter_cpp_rules(rules: list[Rule]) -> list[Rule]: + return [rule for rule in rules if rule.rule_type in RuleType.cpp_rules()] + + +def filter_line_rules(rules: list[Rule]) -> list[Rule]: + return [rule for rule in rules if rule.rule_input_type == RuleInputType.LINE] diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index 2a5df51..4f58181 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -10,6 +10,7 @@ get_staged_files, ) from checks.logger import cpp_check_logger +from checks.rules import Rule, filter_line_rules __CPP_DIRS__ = ["include", "test"] __OTHER_DIRS__ = ["scripts"] @@ -19,7 +20,11 @@ __DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ -def run_checks(rules: list[set[FileType], callable]) -> None: +def run_line_checks(rules: list[Rule]) -> None: + line_rules = filter_line_rules(rules) + + +def run_checks(rules: list[Rule]) -> None: """Run C++ checks based on the provided rules.""" if "full" in sys.argv: cpp_check_logger.info("Running full checks...") diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index c29f023..8c95c17 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -5,19 +5,21 @@ from checks.rules import ResultType, ResultTypeEnum -def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType: +def check_key_sequence_ordered( + key_sequence: str, + line: str, + key_delimiter: str = " " +) -> ResultType: """Check if keys in key_sequence appear in order on the given line. Parameters ---------- - key_sequence: list[str] - The sequence of keys to check for order. + key_sequence: str + The sequence of keys to check for order as a string. line: str The line of text to check. - filename: str - The name of the file containing the line. - linenumber: int - The line number in the file. + key_delimiter: str + The delimiter used to find the keys Returns ------- @@ -25,11 +27,9 @@ def check_key_sequence_ordered(key_sequence: list[str], line: str) -> ResultType Result of the check, Warning if keys are out of order, Ok otherwise """ - if not isinstance(key_sequence, list): - msg = f"key_sequence {key_sequence} must be a list" - raise TypeError(msg) + key_sequence = key_sequence.split(key_delimiter) - line_elements = line.split() + line_elements = line.split(key_delimiter) indices = [ line_elements.index(key) for key in key_sequence diff --git a/scripts/.gitignore b/scripts/.gitignore deleted file mode 100644 index 9b2e9dc..0000000 --- a/scripts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -singularity_test From 66b3ab9de69f2aa14e9f6eb2d4e1a5db507c900c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Mon, 24 Nov 2025 22:41:02 +0100 Subject: [PATCH 013/115] refactor: remove unused C++ rules, enhance file type handling, and improve rule filtering logic --- checks/src/checks/cpp/__init__.py | 6 + .../{cpp_rules.py => cpp/style_rules.py} | 14 ++- checks/src/checks/files/files.py | 2 +- checks/src/checks/ruff.toml | 1 + checks/src/checks/rules/__init__.py | 5 +- checks/src/checks/rules/rules.py | 118 +++++++++++++++++- checks/src/checks/scripts/cpp_checks.py | 32 ++++- 7 files changed, 163 insertions(+), 15 deletions(-) create mode 100644 checks/src/checks/cpp/__init__.py rename checks/src/checks/{cpp_rules.py => cpp/style_rules.py} (67%) diff --git a/checks/src/checks/cpp/__init__.py b/checks/src/checks/cpp/__init__.py new file mode 100644 index 0000000..de38dd3 --- /dev/null +++ b/checks/src/checks/cpp/__init__.py @@ -0,0 +1,6 @@ +"""Package defining C++ check rules.""" + +from .style_rules import cpp_style_rules + +cpp_rules = cpp_style_rules +__all__ = ["cpp_rules"] diff --git a/checks/src/checks/cpp_rules.py b/checks/src/checks/cpp/style_rules.py similarity index 67% rename from checks/src/checks/cpp_rules.py rename to checks/src/checks/cpp/style_rules.py index 1db17b7..c28f2db 100644 --- a/checks/src/checks/cpp_rules.py +++ b/checks/src/checks/cpp/style_rules.py @@ -5,7 +5,17 @@ class CheckKeySeqOrder(Rule): + """Rule to check that a specific key sequence appears only in a given order.""" + def __init__(self, key_sequence: str) -> None: + """Initialize CheckKeySeqOrder with the given key sequence. + + Parameters + ---------- + key_sequence: str + The key sequence to check. + + """ super().__init__( name=key_sequence, func=lambda line: check_key_sequence_ordered( @@ -20,7 +30,7 @@ def __init__(self, key_sequence: str) -> None: rule01 = CheckKeySeqOrder("static inline constexpr") -cpp_rules = [] -cpp_rules.append( +cpp_style_rules = [] +cpp_style_rules.append( rule01 ) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index 1a3326a..c2ee6f1 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -33,7 +33,7 @@ def all_types(cls) -> set[FileType]: @classmethod def cpp_types(cls) -> set[FileType]: """Get a set of all CPP related file types.""" - return set(FileType.CPPHeader, FileType.CPPSource) + return {FileType.CPPHeader, FileType.CPPSource} def determine_file_type(filename: str | Path) -> FileType: diff --git a/checks/src/checks/ruff.toml b/checks/src/checks/ruff.toml index 0a18c6e..53d4003 100644 --- a/checks/src/checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -7,3 +7,4 @@ ignore = [ "FIX002", # missing TODO - already solved by other rules which force linking author and github issue "S607", # relative paths are not allowed by this rule in subprocess commands ] +pylint.max-args = 6 # TODO: remove this in future versions diff --git a/checks/src/checks/rules/__init__.py b/checks/src/checks/rules/__init__.py index 2c27cc8..192f7a3 100644 --- a/checks/src/checks/rules/__init__.py +++ b/checks/src/checks/rules/__init__.py @@ -1,5 +1,6 @@ """Top level package for rules in mstd checks.""" from .result_type import ResultType, ResultTypeEnum -from .rules import Rule, RuleInputType, RuleType +from .rules import Rule, RuleInputType, RuleType, filter_line_rules -__all__ = ["ResultType", "ResultTypeEnum", "Rule", "RuleInputType", "RuleType"] +__all__ = ["ResultType", "ResultTypeEnum"] +__all__ += ["Rule", "RuleInputType", "RuleType", "filter_line_rules"] diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 0ee298b..507b9fa 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -18,6 +18,14 @@ class RuleType(StrEnum): @classmethod def cpp_rules(cls) -> set[RuleType]: + """Get a set of C++ related rule types. + + Returns + ------- + set[RuleType] + A set containing the C++ related rule types. + + """ return set(RuleType.CPP_STYLE) @@ -32,6 +40,64 @@ class RuleInputType(StrEnum): class Rule: """Base class for defining a rule.""" + cpp_style_rule_counter = 0 + general_rule_counter = 0 + + @classmethod + def increment_rule_counter(cls, rule_type: RuleType) -> tuple[str, int]: + """Increment the rule counter based on the rule type. + + Parameters + ---------- + rule_type: RuleType + The type of the rule. + + Returns + ------- + tuple[str, int] + A string representing the rule type and the updated counter. + + Raises + ------ + ValueError + If the rule type is unknown. + + """ + if rule_type == RuleType.CPP_STYLE: + return "STYLE", cls.increment_style_rule_counter() + + if rule_type == RuleType.GENERAL: + return "GENERAL", cls.increment_general_rule_counter() + + msg = f"Unknown rule type: {rule_type}" + raise ValueError(msg) + + @classmethod + def increment_style_rule_counter(cls) -> int: + """Increment the C++ style rule counter. + + Returns + ------- + int + The updated C++ style rule counter. + + """ + cls.cpp_style_rule_counter += 1 + return cls.cpp_style_rule_counter + + @classmethod + def increment_general_rule_counter(cls) -> int: + """Increment the general rule counter. + + Returns + ------- + int + The updated general rule counter. + + """ + cls.general_rule_counter += 1 + return cls.general_rule_counter + def __init__( self, name: str, @@ -50,20 +116,62 @@ def __init__( if file_types is None and rule_type == RuleType.CPP_STYLE: # use only cpp file types if user gives explicit CPP_STYLE rule - self.file_types = FileType.cpp_types() + file_types = FileType.cpp_types() elif file_types is None: - self.file_types = FileType.all_types() + file_types = FileType.all_types() self.file_types = file_types - def apply(self, kwargs: dict[str, typing.Any]) -> ResultType: - """Apply the rule on a specific line.""" - return self.func(**kwargs) + self.rule_identifier = Rule.increment_rule_counter(rule_type) + + def apply(self, args: tuple) -> ResultType: + """Apply the rule on a specific line. + + Parameters + ---------- + args: tuple + The arguments to pass to the rule function. + + Returns + ------- + ResultType + The result of applying the rule. + + """ + if type(args) is str: + args = (args,) + return self.func(*args) def filter_cpp_rules(rules: list[Rule]) -> list[Rule]: + """Filter and return only C++ related rules. + + Parameters + ---------- + rules: list[Rule] + The list of rules to filter. + + Returns + ------- + list[Rule] + A list of C++ related rules. + + """ return [rule for rule in rules if rule.rule_type in RuleType.cpp_rules()] def filter_line_rules(rules: list[Rule]) -> list[Rule]: + """Filter and return only line related rules. + + Parameters + ---------- + rules: list[Rule] + The list of rules to filter. + + Returns + ------- + list[Rule] + A list of line related rules. + + """ return [rule for rule in rules if rule.rule_input_type == RuleInputType.LINE] diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index 4f58181..eac43b5 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -1,11 +1,12 @@ """Module defining C++ check rules.""" import sys +from pathlib import Path -from checks.cpp_rules import cpp_rules +from checks.cpp import cpp_rules from checks.files import ( __EXECUTION_DIR__, - FileType, + determine_file_type, get_files_in_dirs, get_staged_files, ) @@ -20,8 +21,29 @@ __DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ -def run_line_checks(rules: list[Rule]) -> None: +def run_line_checks(rules: list[Rule], file: Path) -> None: + """Run line-based C++ checks on a given file. + + Parameters + ---------- + rules: list[Rule] + The list of rules to apply. + file: Path + The file to check. + + """ line_rules = filter_line_rules(rules) + with Path(file).open("r", encoding="utf-8") as f: + for line in f: + for rule in line_rules: + if determine_file_type(file) not in rule.file_types: + continue + + result = rule.apply(line) + if result.value: + cpp_check_logger.info( + f"Line check result in {file}: {result.description}" + ) def run_checks(rules: list[Rule]) -> None: @@ -40,8 +62,8 @@ def run_checks(rules: list[Rule]) -> None: return for filename in files: - cpp_check_logger.info( - f"Checking file: {filename}, rules: {len(rules)}") + cpp_check_logger.debug(f"Checking file: {filename}") + run_line_checks(rules, filename) def main() -> None: From f28ba1f903f2647a71705511edd03925ff9e8db8 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Tue, 25 Nov 2025 18:39:20 +0100 Subject: [PATCH 014/115] refactor: update run_line_checks to return results and improve logging structure --- checks/src/checks/scripts/cpp_checks.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index eac43b5..b6b8f9d 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -11,7 +11,7 @@ get_staged_files, ) from checks.logger import cpp_check_logger -from checks.rules import Rule, filter_line_rules +from checks.rules import ResultType, Rule, filter_line_rules __CPP_DIRS__ = ["include", "test"] __OTHER_DIRS__ = ["scripts"] @@ -21,7 +21,7 @@ __DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ -def run_line_checks(rules: list[Rule], file: Path) -> None: +def run_line_checks(rules: list[Rule], file: Path) -> list[ResultType]: """Run line-based C++ checks on a given file. Parameters @@ -31,19 +31,24 @@ def run_line_checks(rules: list[Rule], file: Path) -> None: file: Path The file to check. + Returns + ------- + list[ResultType] + The list of results from the checks. + """ - line_rules = filter_line_rules(rules) with Path(file).open("r", encoding="utf-8") as f: + line_rules = filter_line_rules(rules) + results = [] for line in f: for rule in line_rules: if determine_file_type(file) not in rule.file_types: continue result = rule.apply(line) - if result.value: - cpp_check_logger.info( - f"Line check result in {file}: {result.description}" - ) + results.append(result) + + return results def run_checks(rules: list[Rule]) -> None: From 05299cbb56a7ddc25d56bd1ecfdd4a8d28fa72ff Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Tue, 25 Nov 2025 18:59:32 +0100 Subject: [PATCH 015/115] feat: first working solution of cpp line checks with static inline constexpr --- checks/src/checks/scripts/cpp_checks.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index b6b8f9d..87ffc9f 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -11,7 +11,7 @@ get_staged_files, ) from checks.logger import cpp_check_logger -from checks.rules import ResultType, Rule, filter_line_rules +from checks.rules import ResultType, ResultTypeEnum, Rule, filter_line_rules __CPP_DIRS__ = ["include", "test"] __OTHER_DIRS__ = ["scripts"] @@ -37,18 +37,18 @@ def run_line_checks(rules: list[Rule], file: Path) -> list[ResultType]: The list of results from the checks. """ + results = [] + with Path(file).open("r", encoding="utf-8") as f: line_rules = filter_line_rules(rules) - results = [] for line in f: for rule in line_rules: if determine_file_type(file) not in rule.file_types: continue - result = rule.apply(line) - results.append(result) + results.append(rule.apply(line)) - return results + return results def run_checks(rules: list[Rule]) -> None: @@ -68,7 +68,18 @@ def run_checks(rules: list[Rule]) -> None: for filename in files: cpp_check_logger.debug(f"Checking file: {filename}") - run_line_checks(rules, filename) + file_results = run_line_checks(rules, filename) + if any(result.value != ResultTypeEnum.Ok for result in file_results): + filtered_results = [ + res + for res in file_results + if res.value != ResultTypeEnum.Ok + ] + for res in filtered_results: + cpp_check_logger.error( + f"Line check result in {filename}: {res.description}" + ) + return def main() -> None: From 602e1f9ecc71ae889e7c8e43dbe45947db2fd751 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Tue, 25 Nov 2025 23:09:32 +0100 Subject: [PATCH 016/115] refactor: adjust cpow function declaration to have correct keyword sequence --- include/mstd/math/power.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mstd/math/power.hpp b/include/mstd/math/power.hpp index 530bc78..d6b57b0 100644 --- a/include/mstd/math/power.hpp +++ b/include/mstd/math/power.hpp @@ -40,7 +40,7 @@ namespace mstd * @param base value raised to the power @p N. */ template - inline static constexpr T cpow(const T base) + static inline constexpr T cpow(const T base) { if constexpr (N < 0) return static_cast(1) / cpow<-N>(base); From fcda5603997e5d3359158a5858e09c3fc19c6e8c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Tue, 25 Nov 2025 23:11:58 +0100 Subject: [PATCH 017/115] docs: update changelog with new MSTD-CHECKS features and cpp rule additions --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca54ad6..7e0f599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. ## Next Release +### MSTD-CHECKS + +- add checks python library first version for all kind of custom static code analysis +- add "static inline constexpr" as key sequence order cpp rule + ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From f28f0a68cbe38c35c3880ff4cebd3490642554ae Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 08:17:09 +0100 Subject: [PATCH 018/115] Update checks/src/checks/rules/rules.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/rules/rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 507b9fa..167870d 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -26,7 +26,7 @@ def cpp_rules(cls) -> set[RuleType]: A set containing the C++ related rule types. """ - return set(RuleType.CPP_STYLE) + return {RuleType.CPP_STYLE} class RuleInputType(StrEnum): From 2e1729641d5628624fdc13dba6c9869efe6da64a Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 08:18:50 +0100 Subject: [PATCH 019/115] Update checks/src/checks/ruff.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/ruff.toml b/checks/src/checks/ruff.toml index 53d4003..d758a0c 100644 --- a/checks/src/checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -3,7 +3,7 @@ select = ["ALL"] ignore = [ "D203", # blank line before docstring of class (conflict with other rule) "D213", # multiline summary second line (conflict with other rule) - "COM812", # trailing comma missing (conflict with other rule) + "COM812", # trailing comma missing (conflict with other rule). "FIX002", # missing TODO - already solved by other rules which force linking author and github issue "S607", # relative paths are not allowed by this rule in subprocess commands ] From 2070438c8420520f7fd43c0ca3e744ad23f2f73c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 08:19:51 +0100 Subject: [PATCH 020/115] Update checks/src/checks/enums.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/enums.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/checks/src/checks/enums.py b/checks/src/checks/enums.py index 5f4ee4a..1a96117 100644 --- a/checks/src/checks/enums.py +++ b/checks/src/checks/enums.py @@ -3,15 +3,6 @@ from enum import Enum -class FileType(Enum): - """Enumeration of file types for C++ checks.""" - - UNKNOWN = 0 - CPPHeader = 1 - CPPSource = 2 - CMakeLists = 3 - - class ResultTypeEnum(Enum): """Enumeration of result types for C++ type checks.""" From 5651a1846e9920008752551cf62148e5a1fba6d4 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 08:22:18 +0100 Subject: [PATCH 021/115] Update checks/src/checks/rules/rules.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/rules/rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 167870d..ec81cf2 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -138,7 +138,7 @@ def apply(self, args: tuple) -> ResultType: The result of applying the rule. """ - if type(args) is str: + if isinstance(args, str): args = (args,) return self.func(*args) From 630408fa422f7a9cb0a70c499758ad0e2e9bcdf3 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 18:39:27 +0100 Subject: [PATCH 022/115] fix: correct type hint for func parameter in Rule class constructor --- checks/src/checks/rules/rules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index ec81cf2..8fe79e1 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -7,6 +7,8 @@ from checks.files import FileType if typing.TYPE_CHECKING: + from typing import Callable + from .result_type import ResultType @@ -101,7 +103,7 @@ def increment_general_rule_counter(cls) -> int: def __init__( self, name: str, - func: callable, + func: Callable, rule_type: RuleType = RuleType.GENERAL, rule_input_type: RuleInputType = RuleInputType.NONE, file_types: set[FileType] | None = None, From e00eb657a9719bc95a362f6db846c636502f9396 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 18:39:58 +0100 Subject: [PATCH 023/115] refactor: remove unused enums module for C++ checks --- checks/src/checks/enums.py | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 checks/src/checks/enums.py diff --git a/checks/src/checks/enums.py b/checks/src/checks/enums.py deleted file mode 100644 index 1a96117..0000000 --- a/checks/src/checks/enums.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Module defining enumerations used in C++ checks.""" - -from enum import Enum - - -class ResultTypeEnum(Enum): - """Enumeration of result types for C++ type checks.""" - - Ok = 0 - Warning = 1 - Error = 2 From 2d9f7e2a5533cfc680b3c6fa6f6fce25980d1054 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 18:42:24 +0100 Subject: [PATCH 024/115] fix: remove trailing period from comments in ruff.toml --- checks/src/checks/ruff.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/src/checks/ruff.toml b/checks/src/checks/ruff.toml index d758a0c..c767d63 100644 --- a/checks/src/checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -2,8 +2,8 @@ select = ["ALL"] ignore = [ "D203", # blank line before docstring of class (conflict with other rule) - "D213", # multiline summary second line (conflict with other rule) - "COM812", # trailing comma missing (conflict with other rule). + "D213", # multiline summary second line (conflict with other rule) + "COM812", # trailing comma missing (conflict with other rule) "FIX002", # missing TODO - already solved by other rules which force linking author and github issue "S607", # relative paths are not allowed by this rule in subprocess commands ] From 70a15aabb8d95e30896b43b94f5d649c606e2fe4 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 18:46:01 +0100 Subject: [PATCH 025/115] fix: optimize file type determination in run_line_checks function --- checks/src/checks/rules.py | 45 ------------------------- checks/src/checks/scripts/cpp_checks.py | 3 +- 2 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 checks/src/checks/rules.py diff --git a/checks/src/checks/rules.py b/checks/src/checks/rules.py deleted file mode 100644 index 516b363..0000000 --- a/checks/src/checks/rules.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Module defining how to handle rules for C++ checks.""" - -import logging -from pathlib import Path - -from checks.files import FileType, determine_file_type -from checks.results import ResultTypeEnum - -rule_logger = logging.getLogger("mstd_cpp_checks.rules") - - -def check_file(filename: str, rules: list[set[FileType], callable]) -> None: - """Perform checks based on the file type. - - Parameters - ---------- - filename: str - The name of the file to check. - rules: list[callable] - List of rule functions to apply. - - Returns - ------- - None - - """ - file_type = determine_file_type(filename) - - with Path(filename).open("r", encoding="utf-8") as f: - lines = f.readlines() - - for linenumber, line in enumerate(lines): - for file_types, rule in rules: - if file_types and file_type not in file_types: - continue - - result = rule(line) - if result.value == ResultTypeEnum.Warning: - rule_logger.warning( - "Warning in %s:%s: %s", filename, linenumber, result.description - ) - elif result.value == ResultTypeEnum.Error: - rule_logger.error( - "Error in %s:%s: %s", filename, linenumber, result.description - ) diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index 87ffc9f..66c1b95 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -38,12 +38,13 @@ def run_line_checks(rules: list[Rule], file: Path) -> list[ResultType]: """ results = [] + file_type = determine_file_type(file) with Path(file).open("r", encoding="utf-8") as f: line_rules = filter_line_rules(rules) for line in f: for rule in line_rules: - if determine_file_type(file) not in rule.file_types: + if file_type not in rule.file_types: continue results.append(rule.apply(line)) From e0ca8a3121ed64ad4a0744207717088e784002cd Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 26 Nov 2025 23:22:15 +0100 Subject: [PATCH 026/115] fix: make check_key_sequence_ordered function more robust and add utils_logger --- checks/src/checks/logger/__init__.py | 4 +- checks/src/checks/logger/logger.py | 9 ++++- checks/src/checks/ruff.toml | 3 +- checks/src/checks/utils/utils.py | 60 ++++++++++++++++++++++++---- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/checks/src/checks/logger/__init__.py b/checks/src/checks/logger/__init__.py index fadd0d0..f3b21b2 100644 --- a/checks/src/checks/logger/__init__.py +++ b/checks/src/checks/logger/__init__.py @@ -1,5 +1,5 @@ """Top level package for logger in mstd checks.""" -from .logger import cpp_check_logger +from .logger import cpp_check_logger, utils_logger -__all__ = ["cpp_check_logger"] +__all__ = ["cpp_check_logger", "utils_logger"] diff --git a/checks/src/checks/logger/logger.py b/checks/src/checks/logger/logger.py index 1815672..e4d985b 100644 --- a/checks/src/checks/logger/logger.py +++ b/checks/src/checks/logger/logger.py @@ -3,6 +3,7 @@ import os __DEBUG_MSTD_CHECKS__ = os.getenv("DEBUG_MSTD_CHECKS", "0") +__DEBUG_MSTD_UTILS__ = os.getenv("DEBUG_MSTD_UTILS", "0") # TODO(97gamjak): centralize env logic if needed elsewhere # https://github.com/97gamjak/mstd/issues/26 @@ -11,4 +12,10 @@ else: logging.basicConfig(level=logging.INFO) -cpp_check_logger = logging.getLogger("cpp_checks") +cpp_check_logger = logging.getLogger("mstd_cpp_checks") +utils_logger = logging.getLogger("mstd_utils") + +if int(__DEBUG_MSTD_UTILS__) > 0: + utils_logger.setLevel(logging.DEBUG) +else: + utils_logger.setLevel(logging.INFO) diff --git a/checks/src/checks/ruff.toml b/checks/src/checks/ruff.toml index c767d63..67ca12d 100644 --- a/checks/src/checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -6,5 +6,6 @@ ignore = [ "COM812", # trailing comma missing (conflict with other rule) "FIX002", # missing TODO - already solved by other rules which force linking author and github issue "S607", # relative paths are not allowed by this rule in subprocess commands + "ANN401", # allow Any type annotations for now ] -pylint.max-args = 6 # TODO: remove this in future versions +pylint.max-args = 6 # TODO: remove this in future versions \ No newline at end of file diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index 8c95c17..3910371 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -2,8 +2,33 @@ from __future__ import annotations +import typing + +from checks.logger import utils_logger from checks.rules import ResultType, ResultTypeEnum +if typing.TYPE_CHECKING: + from typing import Any + + +def find_indices(list_to_search: list[Any], element: Any) -> list[int]: + """Find all indices of an element in a list. + + Parameters + ---------- + list_to_search: list[Any] + The list to search through. + element: Any + The element to find in the list. + + Returns + ------- + list[int] + A list of indices where the element is found. + + """ + return [index for index, value in enumerate(list_to_search) if value == element] + def check_key_sequence_ordered( key_sequence: str, @@ -30,17 +55,36 @@ def check_key_sequence_ordered( key_sequence = key_sequence.split(key_delimiter) line_elements = line.split(key_delimiter) + + # If not all keys are present, return Ok + if (set(key_sequence).union(set(line_elements)) != set(key_sequence)): + return ResultType(ResultTypeEnum.Ok) + indices = [ - line_elements.index(key) + find_indices(line_elements, key) for key in key_sequence - if key in line_elements ] - if len(indices) == len(key_sequence) and sorted(indices) != indices: - return ResultType( - ResultTypeEnum.Warning, - f"key_sequence {key_sequence} not ordered correctly " - f"in line {line}." + found_indices = 1 + for index in indices[0]: + for i in range(1, len(indices)): + if index+i in indices[i]: + found_indices += 1 + continue + found_indices = 1 + break + + if found_indices == len(key_sequence): + utils_logger.debug( + "All keys from key_sequence %s are present " + "in line %s and ordered correctly.", + key_sequence, + line ) + return ResultType(ResultTypeEnum.Ok) - return ResultType(ResultTypeEnum.Ok) + return ResultType( + ResultTypeEnum.Warning, + f"key_sequence {key_sequence} not ordered correctly " + f"in line {line}." + ) From b0044db61cd722a84e4378fa705c0ca225bf1105 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 27 Nov 2025 08:03:24 +0100 Subject: [PATCH 027/115] fix: bugfix for new check_order_sequence function --- checks/src/checks/utils/utils.py | 5 ++--- checks/tests/utils/__init__.py | 1 + checks/tests/utils/test_utils.py | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 checks/tests/utils/__init__.py create mode 100644 checks/tests/utils/test_utils.py diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index 3910371..6461d8a 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -53,11 +53,10 @@ def check_key_sequence_ordered( """ key_sequence = key_sequence.split(key_delimiter) - line_elements = line.split(key_delimiter) # If not all keys are present, return Ok - if (set(key_sequence).union(set(line_elements)) != set(key_sequence)): + if (set(key_sequence).intersection(set(line_elements)) != set(key_sequence)): return ResultType(ResultTypeEnum.Ok) indices = [ @@ -84,7 +83,7 @@ def check_key_sequence_ordered( return ResultType(ResultTypeEnum.Ok) return ResultType( - ResultTypeEnum.Warning, + ResultTypeEnum.Error, f"key_sequence {key_sequence} not ordered correctly " f"in line {line}." ) diff --git a/checks/tests/utils/__init__.py b/checks/tests/utils/__init__.py new file mode 100644 index 0000000..5ba146d --- /dev/null +++ b/checks/tests/utils/__init__.py @@ -0,0 +1 @@ +"""Package for testing utility functions in mstd checks.""" diff --git a/checks/tests/utils/test_utils.py b/checks/tests/utils/test_utils.py new file mode 100644 index 0000000..1cf58d4 --- /dev/null +++ b/checks/tests/utils/test_utils.py @@ -0,0 +1,13 @@ +from checks.utils import check_key_sequence_ordered +from checks.rules import ResultTypeEnum + + +def test_check_key_sequence_ordered(): + keys = "static inline constexpr" + line = "static inline constexpr int x = 42;" + result = check_key_sequence_ordered(keys, line) + assert result.value == ResultTypeEnum.Ok + + line = "inline static constexpr int x = 42;" + result = check_key_sequence_ordered(keys, line) + assert result.value == ResultTypeEnum.Error From c0ff89482026cfdc2dee60c4006006e62f0f9eee Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 27 Nov 2025 08:17:55 +0100 Subject: [PATCH 028/115] fix: remove unused Callable import in rules.py --- checks/src/checks/rules/rules.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 8fe79e1..7ceeb9e 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -7,8 +7,6 @@ from checks.files import FileType if typing.TYPE_CHECKING: - from typing import Callable - from .result_type import ResultType From 91a28bec06d1933aa5ec0ed9be2388ae3f457265 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 21:28:52 +0000 Subject: [PATCH 029/115] Initial plan From 9d5e36abcbfd0bda23355f5a1809e731a2f89dfe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 21:29:14 +0000 Subject: [PATCH 030/115] Initial plan From 8fb9990f454c615c62c3a6cfbddb08e3f48e9efe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 21:32:33 +0000 Subject: [PATCH 031/115] test: add comprehensive tests for CheckKeySeqOrder and C++ style rules Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- checks/tests/cpp/__init__.py | 1 + checks/tests/cpp/test_style_rules.py | 128 +++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 checks/tests/cpp/__init__.py create mode 100644 checks/tests/cpp/test_style_rules.py diff --git a/checks/tests/cpp/__init__.py b/checks/tests/cpp/__init__.py new file mode 100644 index 0000000..004410d --- /dev/null +++ b/checks/tests/cpp/__init__.py @@ -0,0 +1 @@ +"""Test module for C++ style rules.""" diff --git a/checks/tests/cpp/test_style_rules.py b/checks/tests/cpp/test_style_rules.py new file mode 100644 index 0000000..74e59ca --- /dev/null +++ b/checks/tests/cpp/test_style_rules.py @@ -0,0 +1,128 @@ +"""Unit tests for C++ style rules in mstd checks.""" + +from checks.cpp.style_rules import CheckKeySeqOrder, cpp_style_rules, rule01 +from checks.rules import ResultTypeEnum, RuleInputType, RuleType + + +class TestCheckKeySeqOrder: + """Test suite for CheckKeySeqOrder rule class.""" + + def test_rule_initialization(self): + """Test that CheckKeySeqOrder is initialized correctly.""" + rule = CheckKeySeqOrder("static inline constexpr") + + assert rule.name == "static inline constexpr" + assert rule.rule_type == RuleType.CPP_STYLE + assert rule.rule_input_type == RuleInputType.LINE + assert rule.description == 'Use "static inline constexpr" only in this given order.' + + def test_rule_initialization_custom_key_sequence(self): + """Test CheckKeySeqOrder with a different key sequence.""" + rule = CheckKeySeqOrder("const static") + + assert rule.name == "const static" + assert rule.rule_type == RuleType.CPP_STYLE + assert rule.rule_input_type == RuleInputType.LINE + assert rule.description == 'Use "const static" only in this given order.' + + def test_apply_correct_order(self): + """Test that rule passes when keys are in correct order.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("static inline constexpr int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + def test_apply_incorrect_order(self): + """Test that rule fails when keys are out of order.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("inline static constexpr int x = 42;") + + assert result.value == ResultTypeEnum.Error + + def test_apply_partial_keys_present(self): + """Test that rule passes when only some keys are present.""" + rule = CheckKeySeqOrder("static inline constexpr") + # Only "static" and "constexpr" are present, missing "inline" + result = rule.apply("static constexpr int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + def test_apply_no_keys_present(self): + """Test that rule passes when no keys are present.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + def test_apply_single_key_present(self): + """Test that rule passes when only a single key is present.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("static int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + +class TestStaticInlineConstexprRule: + """Test suite for the 'static inline constexpr' rule (rule01).""" + + def test_rule01_exists_and_configured(self): + """Test that rule01 is properly configured.""" + assert rule01 is not None + assert rule01.name == "static inline constexpr" + assert rule01.rule_type == RuleType.CPP_STYLE + assert rule01.rule_input_type == RuleInputType.LINE + + def test_rule01_in_cpp_style_rules(self): + """Test that rule01 is in the cpp_style_rules list.""" + assert rule01 in cpp_style_rules + assert len(cpp_style_rules) >= 1 + + def test_static_inline_constexpr_correct_order(self): + """Test static inline constexpr in correct order.""" + result = rule01.apply("static inline constexpr int value = 10;") + assert result.value == ResultTypeEnum.Ok + + def test_static_inline_constexpr_wrong_order_inline_first(self): + """Test inline static constexpr (wrong order).""" + result = rule01.apply("inline static constexpr int value = 10;") + assert result.value == ResultTypeEnum.Error + + def test_static_inline_constexpr_wrong_order_constexpr_first(self): + """Test constexpr static inline (wrong order).""" + result = rule01.apply("constexpr static inline int value = 10;") + assert result.value == ResultTypeEnum.Error + + def test_static_inline_constexpr_wrong_order_constexpr_inline_static(self): + """Test constexpr inline static (wrong order).""" + result = rule01.apply("constexpr inline static int value = 10;") + assert result.value == ResultTypeEnum.Error + + def test_static_constexpr_only(self): + """Test static constexpr without inline (should pass - not all keys present).""" + result = rule01.apply("static constexpr int value = 10;") + assert result.value == ResultTypeEnum.Ok + + def test_inline_constexpr_only(self): + """Test inline constexpr without static (should pass - not all keys present).""" + result = rule01.apply("inline constexpr int value = 10;") + assert result.value == ResultTypeEnum.Ok + + def test_no_keywords(self): + """Test line with no relevant keywords.""" + result = rule01.apply("int value = 10;") + assert result.value == ResultTypeEnum.Ok + + def test_with_template(self): + """Test static inline constexpr in a template context.""" + result = rule01.apply("template static inline constexpr T default_value{};") + assert result.value == ResultTypeEnum.Ok + + def test_in_function_declaration(self): + """Test static inline constexpr in a function declaration.""" + result = rule01.apply("static inline constexpr auto compute() -> int { return 42; }") + assert result.value == ResultTypeEnum.Ok + + def test_wrong_order_in_function(self): + """Test wrong order in function declaration.""" + result = rule01.apply("inline static constexpr auto compute() -> int { return 42; }") + assert result.value == ResultTypeEnum.Error From d27105ab7d9876d27b6f1a856a2c62d82a9c88f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 21:34:13 +0000 Subject: [PATCH 032/115] feat: add comprehensive tests for Rule class and C++ style rules Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- checks/src/checks/rules/__init__.py | 16 +- checks/tests/cpp/__init__.py | 1 + checks/tests/cpp/test_style_rules.py | 135 ++++++++++++++ checks/tests/rules/__init__.py | 1 + checks/tests/rules/test_rules.py | 259 +++++++++++++++++++++++++++ 5 files changed, 410 insertions(+), 2 deletions(-) create mode 100644 checks/tests/cpp/__init__.py create mode 100644 checks/tests/cpp/test_style_rules.py create mode 100644 checks/tests/rules/__init__.py create mode 100644 checks/tests/rules/test_rules.py diff --git a/checks/src/checks/rules/__init__.py b/checks/src/checks/rules/__init__.py index 192f7a3..046e47e 100644 --- a/checks/src/checks/rules/__init__.py +++ b/checks/src/checks/rules/__init__.py @@ -1,6 +1,18 @@ """Top level package for rules in mstd checks.""" from .result_type import ResultType, ResultTypeEnum -from .rules import Rule, RuleInputType, RuleType, filter_line_rules +from .rules import ( + Rule, + RuleInputType, + RuleType, + filter_cpp_rules, + filter_line_rules, +) __all__ = ["ResultType", "ResultTypeEnum"] -__all__ += ["Rule", "RuleInputType", "RuleType", "filter_line_rules"] +__all__ += [ + "Rule", + "RuleInputType", + "RuleType", + "filter_cpp_rules", + "filter_line_rules", +] diff --git a/checks/tests/cpp/__init__.py b/checks/tests/cpp/__init__.py new file mode 100644 index 0000000..b08b281 --- /dev/null +++ b/checks/tests/cpp/__init__.py @@ -0,0 +1 @@ +"""Unit tests for cpp module.""" diff --git a/checks/tests/cpp/test_style_rules.py b/checks/tests/cpp/test_style_rules.py new file mode 100644 index 0000000..2f48f24 --- /dev/null +++ b/checks/tests/cpp/test_style_rules.py @@ -0,0 +1,135 @@ +"""Unit tests for C++ style rules.""" + +from checks.cpp.style_rules import CheckKeySeqOrder, cpp_style_rules, rule01 +from checks.files import FileType +from checks.rules import ResultTypeEnum, Rule, RuleInputType, RuleType + + +class TestCheckKeySeqOrder: + """Tests for CheckKeySeqOrder rule.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_check_key_seq_order_creation(self): + """Test CheckKeySeqOrder rule creation.""" + rule = CheckKeySeqOrder("static inline constexpr") + assert rule.name == "static inline constexpr" + assert rule.rule_type == RuleType.CPP_STYLE + assert rule.rule_input_type == RuleInputType.LINE + assert rule.description == 'Use "static inline constexpr" only in this given order.' + assert rule.file_types == FileType.cpp_types() + + def test_check_key_seq_order_correct_order(self): + """Test CheckKeySeqOrder returns Ok for correct order.""" + rule = CheckKeySeqOrder("static inline constexpr") + line = "static inline constexpr int x = 42;" + result = rule.apply(line) + assert result.value == ResultTypeEnum.Ok + + def test_check_key_seq_order_incorrect_order(self): + """Test CheckKeySeqOrder returns Error for incorrect order.""" + rule = CheckKeySeqOrder("static inline constexpr") + line = "inline static constexpr int x = 42;" + result = rule.apply(line) + assert result.value == ResultTypeEnum.Error + + def test_check_key_seq_order_missing_keys(self): + """Test CheckKeySeqOrder returns Ok when keys are missing.""" + rule = CheckKeySeqOrder("static inline constexpr") + line = "int x = 42;" + result = rule.apply(line) + assert result.value == ResultTypeEnum.Ok + + def test_check_key_seq_order_partial_keys(self): + """Test CheckKeySeqOrder returns Ok when only some keys are present.""" + rule = CheckKeySeqOrder("static inline constexpr") + line = "static int x = 42;" + result = rule.apply(line) + assert result.value == ResultTypeEnum.Ok + + def test_check_key_seq_order_different_sequence(self): + """Test CheckKeySeqOrder with different key sequence.""" + rule = CheckKeySeqOrder("const int") + line = "const int x = 42;" + result = rule.apply(line) + assert result.value == ResultTypeEnum.Ok + + line = "int const x = 42;" + result = rule.apply(line) + assert result.value == ResultTypeEnum.Error + + +class TestCppStyleRulesModule: + """Tests for cpp_style_rules module.""" + + def test_rule01_is_check_key_seq_order(self): + """Test that rule01 is a CheckKeySeqOrder instance.""" + assert isinstance(rule01, CheckKeySeqOrder) + + def test_rule01_checks_static_inline_constexpr(self): + """Test that rule01 checks for static inline constexpr ordering.""" + assert rule01.name == "static inline constexpr" + + def test_cpp_style_rules_list_not_empty(self): + """Test that cpp_style_rules list is not empty.""" + assert len(cpp_style_rules) > 0 + + def test_cpp_style_rules_contains_rule01(self): + """Test that cpp_style_rules contains rule01.""" + assert rule01 in cpp_style_rules + + def test_all_cpp_style_rules_are_cpp_style_type(self): + """Test that all rules in cpp_style_rules have CPP_STYLE type.""" + for rule in cpp_style_rules: + assert rule.rule_type == RuleType.CPP_STYLE + + +class TestStaticInlineConstexprRule: + """Tests for static inline constexpr ordering rule.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_static_inline_constexpr_correct(self): + """Test correct static inline constexpr order.""" + rule = CheckKeySeqOrder("static inline constexpr") + test_cases = [ + "static inline constexpr int x = 42;", + " static inline constexpr auto value = 10;", + "static inline constexpr double PI = 3.14159;", + ] + for line in test_cases: + result = rule.apply(line) + assert result.value == ResultTypeEnum.Ok, f"Failed for: {line}" + + def test_static_inline_constexpr_wrong_order(self): + """Test wrong static inline constexpr order returns Error.""" + rule = CheckKeySeqOrder("static inline constexpr") + test_cases = [ + "inline static constexpr int x = 42;", + "constexpr static inline int x = 42;", + "constexpr inline static int x = 42;", + "inline constexpr static int x = 42;", + ] + for line in test_cases: + result = rule.apply(line) + assert result.value == ResultTypeEnum.Error, f"Expected Error for: {line}" + + def test_static_inline_constexpr_partial_present(self): + """Test lines with only some keywords present.""" + rule = CheckKeySeqOrder("static inline constexpr") + test_cases = [ + "static int x = 42;", + "inline void func();", + "constexpr int y = 10;", + "static constexpr int z = 5;", + "inline constexpr int w = 3;", + ] + for line in test_cases: + result = rule.apply(line) + assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: {line}" diff --git a/checks/tests/rules/__init__.py b/checks/tests/rules/__init__.py new file mode 100644 index 0000000..dbbb144 --- /dev/null +++ b/checks/tests/rules/__init__.py @@ -0,0 +1 @@ +"""Unit tests for rules module.""" diff --git a/checks/tests/rules/test_rules.py b/checks/tests/rules/test_rules.py new file mode 100644 index 0000000..27e73c1 --- /dev/null +++ b/checks/tests/rules/test_rules.py @@ -0,0 +1,259 @@ +"""Unit tests for Rule class and related functionality.""" + +from checks.files import FileType +from checks.rules import ( + ResultType, + ResultTypeEnum, + Rule, + RuleInputType, + RuleType, + filter_cpp_rules, + filter_line_rules, +) + + +class TestRuleType: + """Tests for RuleType enumeration.""" + + def test_rule_type_values(self): + """Test that RuleType has expected values.""" + assert RuleType.GENERAL.value == "GENERAL" + assert RuleType.CPP_STYLE.value == "CPP_STYLE" + + def test_cpp_rules(self): + """Test that cpp_rules returns correct set.""" + cpp_rules = RuleType.cpp_rules() + assert isinstance(cpp_rules, set) + assert RuleType.CPP_STYLE in cpp_rules + assert RuleType.GENERAL not in cpp_rules + + +class TestRuleInputType: + """Tests for RuleInputType enumeration.""" + + def test_rule_input_type_values(self): + """Test that RuleInputType has expected values.""" + assert RuleInputType.NONE.value == "NONE" + assert RuleInputType.LINE.value == "LINE" + assert RuleInputType.FILE.value == "FILE" + + +class TestRuleCreation: + """Tests for Rule class creation.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_rule_creation_with_defaults(self): + """Test Rule creation with default parameters.""" + rule = Rule( + name="test_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + ) + assert rule.name == "test_rule" + assert rule.rule_type == RuleType.GENERAL + assert rule.rule_input_type == RuleInputType.NONE + assert rule.file_types == FileType.all_types() + assert rule.description is None + + def test_rule_creation_cpp_style(self): + """Test Rule creation with CPP_STYLE type.""" + rule = Rule( + name="cpp_style_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + ) + assert rule.rule_type == RuleType.CPP_STYLE + assert rule.file_types == FileType.cpp_types() + + def test_rule_creation_with_custom_file_types(self): + """Test Rule creation with custom file types.""" + custom_types = {FileType.CPPHeader} + rule = Rule( + name="custom_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + file_types=custom_types, + ) + assert rule.file_types == custom_types + + def test_rule_creation_with_description(self): + """Test Rule creation with description.""" + rule = Rule( + name="described_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + description="Test description", + ) + assert rule.description == "Test description" + + def test_rule_creation_line_input_type(self): + """Test Rule creation with LINE input type.""" + rule = Rule( + name="line_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_input_type=RuleInputType.LINE, + ) + assert rule.rule_input_type == RuleInputType.LINE + + +class TestRuleCounters: + """Tests for Rule counter functionality.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_general_rule_counter_increment(self): + """Test that general rule counter increments correctly.""" + initial_counter = Rule.general_rule_counter + rule = Rule( + name="general_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.GENERAL, + ) + assert rule.rule_identifier == ("GENERAL", initial_counter + 1) + assert Rule.general_rule_counter == initial_counter + 1 + + def test_cpp_style_rule_counter_increment(self): + """Test that cpp style rule counter increments correctly.""" + initial_counter = Rule.cpp_style_rule_counter + rule = Rule( + name="cpp_style_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + ) + assert rule.rule_identifier == ("STYLE", initial_counter + 1) + assert Rule.cpp_style_rule_counter == initial_counter + 1 + + def test_multiple_rules_increment_counters(self): + """Test that multiple rules increment counters correctly.""" + Rule( + name="rule1", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.GENERAL, + ) + Rule( + name="rule2", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.GENERAL, + ) + assert Rule.general_rule_counter == 2 + + Rule( + name="rule3", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + ) + assert Rule.cpp_style_rule_counter == 1 + + +class TestRuleApplication: + """Tests for Rule apply method.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_apply_with_string_arg(self): + """Test Rule apply with string argument.""" + def check_func(line): + if "hello" in line: + return ResultType(ResultTypeEnum.Ok) + return ResultType(ResultTypeEnum.Error, "No hello found") + + rule = Rule(name="hello_check", func=check_func) + result = rule.apply("hello world") + assert result.value == ResultTypeEnum.Ok + + result = rule.apply("goodbye world") + assert result.value == ResultTypeEnum.Error + + def test_apply_with_tuple_arg(self): + """Test Rule apply with tuple argument.""" + def check_func(a, b): + if a == b: + return ResultType(ResultTypeEnum.Ok) + return ResultType(ResultTypeEnum.Error, "Values don't match") + + rule = Rule(name="match_check", func=check_func) + result = rule.apply(("test", "test")) + assert result.value == ResultTypeEnum.Ok + + result = rule.apply(("test1", "test2")) + assert result.value == ResultTypeEnum.Error + + +class TestRuleFiltering: + """Tests for rule filtering functions.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_filter_cpp_rules(self): + """Test filter_cpp_rules returns only C++ related rules.""" + cpp_rule = Rule( + name="cpp_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + ) + general_rule = Rule( + name="general_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.GENERAL, + ) + rules = [cpp_rule, general_rule] + + filtered = filter_cpp_rules(rules) + assert len(filtered) == 1 + assert cpp_rule in filtered + assert general_rule not in filtered + + def test_filter_cpp_rules_empty_list(self): + """Test filter_cpp_rules with empty list.""" + filtered = filter_cpp_rules([]) + assert filtered == [] + + def test_filter_cpp_rules_no_matches(self): + """Test filter_cpp_rules when no rules match.""" + general_rule = Rule( + name="general_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.GENERAL, + ) + filtered = filter_cpp_rules([general_rule]) + assert filtered == [] + + def test_filter_line_rules(self): + """Test filter_line_rules returns only line input rules.""" + line_rule = Rule( + name="line_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_input_type=RuleInputType.LINE, + ) + file_rule = Rule( + name="file_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_input_type=RuleInputType.FILE, + ) + none_rule = Rule( + name="none_rule", + func=lambda x: ResultType(ResultTypeEnum.Ok), + rule_input_type=RuleInputType.NONE, + ) + rules = [line_rule, file_rule, none_rule] + + filtered = filter_line_rules(rules) + assert len(filtered) == 1 + assert line_rule in filtered + assert file_rule not in filtered + assert none_rule not in filtered + + def test_filter_line_rules_empty_list(self): + """Test filter_line_rules with empty list.""" + filtered = filter_line_rules([]) + assert filtered == [] From 838701e1f9c3ceded40183c9d9493af1aa166ad8 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 27 Nov 2025 22:49:27 +0100 Subject: [PATCH 033/115] fix: import Callable for type checking in rules module --- checks/src/checks/rules/rules.py | 2 + checks/tests/cpp/test_style_rules.py | 116 +++++++++++++-------------- 2 files changed, 56 insertions(+), 62 deletions(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 7ceeb9e..7611a54 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -7,6 +7,8 @@ from checks.files import FileType if typing.TYPE_CHECKING: + from collections.abc import Callable + from .result_type import ResultType diff --git a/checks/tests/cpp/test_style_rules.py b/checks/tests/cpp/test_style_rules.py index e527a84..8a3a33c 100644 --- a/checks/tests/cpp/test_style_rules.py +++ b/checks/tests/cpp/test_style_rules.py @@ -61,6 +61,60 @@ def test_check_key_seq_order_different_sequence(self): result = rule.apply(line) assert result.value == ResultTypeEnum.Error + def test_rule_initialization(self): + """Test that CheckKeySeqOrder is initialized correctly.""" + rule = CheckKeySeqOrder("static inline constexpr") + + assert rule.name == "static inline constexpr" + assert rule.rule_type == RuleType.CPP_STYLE + assert rule.rule_input_type == RuleInputType.LINE + assert rule.description == 'Use "static inline constexpr" only in this given order.' + + def test_rule_initialization_custom_key_sequence(self): + """Test CheckKeySeqOrder with a different key sequence.""" + rule = CheckKeySeqOrder("const static") + + assert rule.name == "const static" + assert rule.rule_type == RuleType.CPP_STYLE + assert rule.rule_input_type == RuleInputType.LINE + assert rule.description == 'Use "const static" only in this given order.' + + def test_apply_correct_order(self): + """Test that rule passes when keys are in correct order.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("static inline constexpr int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + def test_apply_incorrect_order(self): + """Test that rule fails when keys are out of order.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("inline static constexpr int x = 42;") + + assert result.value == ResultTypeEnum.Error + + def test_apply_partial_keys_present(self): + """Test that rule passes when only some keys are present.""" + rule = CheckKeySeqOrder("static inline constexpr") + # Only "static" and "constexpr" are present, missing "inline" + result = rule.apply("static constexpr int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + def test_apply_no_keys_present(self): + """Test that rule passes when no keys are present.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("int x = 42;") + + assert result.value == ResultTypeEnum.Ok + + def test_apply_single_key_present(self): + """Test that rule passes when only a single key is present.""" + rule = CheckKeySeqOrder("static inline constexpr") + result = rule.apply("static int x = 42;") + + assert result.value == ResultTypeEnum.Ok + class TestCppStyleRulesModule: """Tests for cpp_style_rules module.""" @@ -136,68 +190,6 @@ def test_static_inline_constexpr_partial_present(self): assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: { line}" - -class TestCheckKeySeqOrder: - """Test suite for CheckKeySeqOrder rule class.""" - - def test_rule_initialization(self): - """Test that CheckKeySeqOrder is initialized correctly.""" - rule = CheckKeySeqOrder("static inline constexpr") - - assert rule.name == "static inline constexpr" - assert rule.rule_type == RuleType.CPP_STYLE - assert rule.rule_input_type == RuleInputType.LINE - assert rule.description == 'Use "static inline constexpr" only in this given order.' - - def test_rule_initialization_custom_key_sequence(self): - """Test CheckKeySeqOrder with a different key sequence.""" - rule = CheckKeySeqOrder("const static") - - assert rule.name == "const static" - assert rule.rule_type == RuleType.CPP_STYLE - assert rule.rule_input_type == RuleInputType.LINE - assert rule.description == 'Use "const static" only in this given order.' - - def test_apply_correct_order(self): - """Test that rule passes when keys are in correct order.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("static inline constexpr int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - def test_apply_incorrect_order(self): - """Test that rule fails when keys are out of order.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("inline static constexpr int x = 42;") - - assert result.value == ResultTypeEnum.Error - - def test_apply_partial_keys_present(self): - """Test that rule passes when only some keys are present.""" - rule = CheckKeySeqOrder("static inline constexpr") - # Only "static" and "constexpr" are present, missing "inline" - result = rule.apply("static constexpr int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - def test_apply_no_keys_present(self): - """Test that rule passes when no keys are present.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - def test_apply_single_key_present(self): - """Test that rule passes when only a single key is present.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("static int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - -class TestStaticInlineConstexprRule: - """Test suite for the 'static inline constexpr' rule (rule01).""" - def test_rule01_exists_and_configured(self): """Test that rule01 is properly configured.""" assert rule01 is not None From c77507c6197ba6528d182f5d4942a2ee0aee6ea6 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:37:46 +0100 Subject: [PATCH 034/115] Update checks/src/checks/files/files.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/files/files.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index c2ee6f1..dda2320 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -118,9 +118,6 @@ def get_staged_files() -> list[str]: check=True ) - if result.returncode != 0: - msg = "Failed to get staged files from git." - raise RuntimeError(msg) files = result.stdout.strip().split("\n") return [file for file in files if file] From c0554462efbe5798c581d7cbc1adbd1e5d7a3fed Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:39:40 +0100 Subject: [PATCH 035/115] Update checks/src/checks/utils/utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index 6461d8a..e8092b0 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -56,7 +56,7 @@ def check_key_sequence_ordered( line_elements = line.split(key_delimiter) # If not all keys are present, return Ok - if (set(key_sequence).intersection(set(line_elements)) != set(key_sequence)): + if set(key_sequence).intersection(set(line_elements)) != set(key_sequence): return ResultType(ResultTypeEnum.Ok) indices = [ From df813b6a7de1c0973f5ad09c39d8c4b943729cf0 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:43:21 +0100 Subject: [PATCH 036/115] Update checks/src/checks/ruff.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/ruff.toml b/checks/src/checks/ruff.toml index 67ca12d..fb706af 100644 --- a/checks/src/checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -8,4 +8,4 @@ ignore = [ "S607", # relative paths are not allowed by this rule in subprocess commands "ANN401", # allow Any type annotations for now ] -pylint.max-args = 6 # TODO: remove this in future versions \ No newline at end of file +pylint.max-args = 6 # TODO(97gamjak): remove this in future versions # https://github.com/97gamjak/mstd/issues/XX \ No newline at end of file From df251a3dd2a0d2697090e6007fb401f8ef914d1c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:44:33 +0100 Subject: [PATCH 037/115] Update checks/src/checks/utils/utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index e8092b0..ac22928 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -49,7 +49,7 @@ def check_key_sequence_ordered( Returns ------- ResultType: - Result of the check, Warning if keys are out of order, Ok otherwise + Result of the check, Error if keys are out of order, Ok otherwise """ key_sequence = key_sequence.split(key_delimiter) From 434ccabde7fb68e53d57c895d3e207d796f6a2be Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:45:10 +0100 Subject: [PATCH 038/115] Update checks/src/checks/rules/rules.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/rules/rules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 7611a54..de00dc9 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -142,7 +142,9 @@ def apply(self, args: tuple) -> ResultType: """ if isinstance(args, str): args = (args,) - return self.func(*args) + if len(args) > 1: + raise TypeError("Rule function expects at most one argument, but got multiple.") + return self.func(args[0]) if args else self.func() def filter_cpp_rules(rules: list[Rule]) -> list[Rule]: From e8262b4c494f5f88150c890a4b0aff6e5d565e86 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:45:25 +0100 Subject: [PATCH 039/115] Update checks/src/checks/utils/utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index ac22928..be12313 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -67,7 +67,7 @@ def check_key_sequence_ordered( found_indices = 1 for index in indices[0]: for i in range(1, len(indices)): - if index+i in indices[i]: + if index + i in indices[i]: found_indices += 1 continue found_indices = 1 From 42eca125406f80b0684b2cb103e90f930c36668f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:45:43 +0100 Subject: [PATCH 040/115] Update checks/tests/files/test_files.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/tests/files/test_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/tests/files/test_files.py b/checks/tests/files/test_files.py index 66e3136..77c955e 100644 --- a/checks/tests/files/test_files.py +++ b/checks/tests/files/test_files.py @@ -1,8 +1,8 @@ """Unit tests for file-related functionality in mstd checks.""" +from checks.files import FileType def test_get_all_file_types(): - from checks.files import FileType expected_types = { FileType.CPPHeader, From cd8f2944e8eb585b8cafe95c4064dbf1611c33bb Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:46:25 +0100 Subject: [PATCH 041/115] Update checks/src/checks/cpp/style_rules.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/cpp/style_rules.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/checks/src/checks/cpp/style_rules.py b/checks/src/checks/cpp/style_rules.py index c28f2db..e5caae0 100644 --- a/checks/src/checks/cpp/style_rules.py +++ b/checks/src/checks/cpp/style_rules.py @@ -30,7 +30,4 @@ def __init__(self, key_sequence: str) -> None: rule01 = CheckKeySeqOrder("static inline constexpr") -cpp_style_rules = [] -cpp_style_rules.append( - rule01 -) +cpp_style_rules = [rule01] From 38860c9f62a2513cc092185fb85b3740074f229f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:53:44 +0100 Subject: [PATCH 042/115] refactor: get_staged_files should return list[Path] instead of list[str] --- checks/src/checks/files/files.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index dda2320..e1ea576 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -102,12 +102,12 @@ def get_files_in_dirs( return all_files -def get_staged_files() -> list[str]: +def get_staged_files() -> list[Path]: """Get the list of staged files in the git repository. Returns ------- - list[str]: + list[Path]: List of staged file paths. """ @@ -118,6 +118,5 @@ def get_staged_files() -> list[str]: check=True ) - files = result.stdout.strip().split("\n") - return [file for file in files if file] + return [Path(file) for file in files if file] From 0dc6fa2503b9646e3366ed6c5e504dec34af513c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 07:56:55 +0100 Subject: [PATCH 043/115] fix: add max_recursion parameter to get_files_in_dirs for better control over directory traversal --- checks/src/checks/files/files.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index e1ea576..38d9ba5 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -65,7 +65,8 @@ def determine_file_type(filename: str | Path) -> FileType: def get_files_in_dirs( paths: list[Path], exclude_dirs: list[str] | None = None, - exclude_files: list[str] | None = None + exclude_files: list[str] | None = None, + max_recursion: int = 20 ) -> list[Path]: """Get all files in the specified directories. @@ -77,6 +78,9 @@ def get_files_in_dirs( List of directory names to exclude from the search. Defaults to None. exclude_files: list[str] | None List of file names to exclude from the search. Defaults to None. + max_recursion: int + Number of maximum recursion through dirs to avoid infinite recursion, + default 10 Returns ------- @@ -91,10 +95,19 @@ def get_files_in_dirs( exclude_files = [] all_files = [] + + if max_recursion == 0: + return all_files + for path in paths: if path.is_dir() and path.name not in exclude_dirs: all_files.extend( - get_files_in_dirs(path.iterdir(), exclude_dirs, exclude_files) + get_files_in_dirs( + path.iterdir(), + exclude_dirs, + exclude_files, + max_recursion - 1 + ) ) elif path.is_file() and path.name not in exclude_files: all_files.append(path) From 3a9f2489cca65d9e116d1c9009f62c83c180cb2c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 08:00:11 +0100 Subject: [PATCH 044/115] doc: enhance docstring in run_checks for clarity on parameters and behavior --- checks/src/checks/scripts/cpp_checks.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/checks/src/checks/scripts/cpp_checks.py b/checks/src/checks/scripts/cpp_checks.py index 66c1b95..825bfb9 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/checks/src/checks/scripts/cpp_checks.py @@ -53,7 +53,16 @@ def run_line_checks(rules: list[Rule], file: Path) -> list[ResultType]: def run_checks(rules: list[Rule]) -> None: - """Run C++ checks based on the provided rules.""" + """Run C++ checks based on the provided rules. + + Returns immediately after encountering the first file with errors. + + Parameters + ---------- + rules: list[Rule] + The list of rules to apply. + + """ if "full" in sys.argv: cpp_check_logger.info("Running full checks...") cpp_check_logger.debug(f"Checking directories: {__DIRS__}") From 00417557150051f6891f7e49aec454e3340439e9 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 22:21:11 +0100 Subject: [PATCH 045/115] Update checks/tests/cpp/test_style_rules.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/tests/cpp/test_style_rules.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/checks/tests/cpp/test_style_rules.py b/checks/tests/cpp/test_style_rules.py index 8a3a33c..4c1efa4 100644 --- a/checks/tests/cpp/test_style_rules.py +++ b/checks/tests/cpp/test_style_rules.py @@ -172,8 +172,7 @@ def test_static_inline_constexpr_wrong_order(self): ] for line in test_cases: result = rule.apply(line) - assert result.value == ResultTypeEnum.Error, f"Expected Error for: { - line}" + assert result.value == ResultTypeEnum.Error, f"Expected Error for: {line}" def test_static_inline_constexpr_partial_present(self): """Test lines with only some keywords present.""" From 3342e26e1bf710172eac788112eec7dda9aa8d45 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 22:21:22 +0100 Subject: [PATCH 046/115] Update checks/tests/cpp/test_style_rules.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/tests/cpp/test_style_rules.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/checks/tests/cpp/test_style_rules.py b/checks/tests/cpp/test_style_rules.py index 4c1efa4..ad3081b 100644 --- a/checks/tests/cpp/test_style_rules.py +++ b/checks/tests/cpp/test_style_rules.py @@ -186,8 +186,7 @@ def test_static_inline_constexpr_partial_present(self): ] for line in test_cases: result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: { - line}" + assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: {line}" def test_rule01_exists_and_configured(self): """Test that rule01 is properly configured.""" From 6396e853087689d272bc6a7b5f2197263b5a54a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:53:00 +0000 Subject: [PATCH 047/115] Initial plan From f843aa479c9ef32cfe7d6b0e8a4c9f593d3b46e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:57:00 +0000 Subject: [PATCH 048/115] feat: add comprehensive tests for cpp_checks script functions Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- checks/tests/scripts/__init__.py | 1 + checks/tests/scripts/test_cpp_checks.py | 282 ++++++++++++++++++++++++ 2 files changed, 283 insertions(+) create mode 100644 checks/tests/scripts/__init__.py create mode 100644 checks/tests/scripts/test_cpp_checks.py diff --git a/checks/tests/scripts/__init__.py b/checks/tests/scripts/__init__.py new file mode 100644 index 0000000..20399b4 --- /dev/null +++ b/checks/tests/scripts/__init__.py @@ -0,0 +1 @@ +"""Tests for script modules in mstd checks.""" diff --git a/checks/tests/scripts/test_cpp_checks.py b/checks/tests/scripts/test_cpp_checks.py new file mode 100644 index 0000000..d5b37ed --- /dev/null +++ b/checks/tests/scripts/test_cpp_checks.py @@ -0,0 +1,282 @@ +"""Unit tests for cpp_checks script module.""" + +from unittest.mock import patch + +from checks.files import FileType +from checks.rules import ResultType, ResultTypeEnum, Rule, RuleInputType, RuleType +from checks.scripts.cpp_checks import main, run_checks, run_line_checks + + +class TestRunLineChecks: + """Tests for run_line_checks function.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + def test_run_line_checks_with_matching_rule(self, tmp_path): + """Test run_line_checks applies rule to matching file type.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("static inline constexpr int x = 42;\n") + + rule = Rule( + name="test_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + results = run_line_checks([rule], test_file) + assert len(results) == 1 + assert results[0].value == ResultTypeEnum.Ok + + def test_run_line_checks_with_non_matching_file_type(self, tmp_path): + """Test run_line_checks skips rule when file type doesn't match.""" + test_file = tmp_path / "test.txt" + test_file.write_text("test content\n") + + rule = Rule( + name="cpp_only_rule", + func=lambda line: ResultType(ResultTypeEnum.Error, "Should not run"), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + file_types={FileType.CPPSource}, + ) + + results = run_line_checks([rule], test_file) + assert len(results) == 0 + + def test_run_line_checks_multiple_lines(self, tmp_path): + """Test run_line_checks processes all lines.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("line1\nline2\nline3\n") + + rule = Rule( + name="count_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + results = run_line_checks([rule], test_file) + assert len(results) == 3 + + def test_run_line_checks_multiple_rules(self, tmp_path): + """Test run_line_checks applies multiple rules.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("test line\n") + + rule1 = Rule( + name="rule1", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + rule2 = Rule( + name="rule2", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + results = run_line_checks([rule1, rule2], test_file) + assert len(results) == 2 + + def test_run_line_checks_filters_non_line_rules(self, tmp_path): + """Test run_line_checks only applies LINE input type rules.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("test line\n") + + line_rule = Rule( + name="line_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + file_rule = Rule( + name="file_rule", + func=lambda line: ResultType(ResultTypeEnum.Error, "Should not run"), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.FILE, + ) + + results = run_line_checks([line_rule, file_rule], test_file) + assert len(results) == 1 + assert results[0].value == ResultTypeEnum.Ok + + def test_run_line_checks_empty_file(self, tmp_path): + """Test run_line_checks handles empty files.""" + test_file = tmp_path / "empty.cpp" + test_file.write_text("") + + rule = Rule( + name="test_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + results = run_line_checks([rule], test_file) + assert len(results) == 0 + + def test_run_line_checks_no_rules(self, tmp_path): + """Test run_line_checks with no rules.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("test content\n") + + results = run_line_checks([], test_file) + assert len(results) == 0 + + +class TestRunChecks: + """Tests for run_checks function.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + @patch("checks.scripts.cpp_checks.get_staged_files") + @patch("checks.scripts.cpp_checks.cpp_check_logger") + def test_run_checks_no_files(self, mock_logger, mock_get_staged): + """Test run_checks logs warning when no files to check.""" + mock_get_staged.return_value = [] + + rules = [ + Rule( + name="test_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_input_type=RuleInputType.LINE, + ) + ] + + run_checks(rules) + + mock_logger.warning.assert_called_once_with("No files to check.") + + @patch("checks.scripts.cpp_checks.get_staged_files") + @patch("checks.scripts.cpp_checks.cpp_check_logger") + def test_run_checks_staged_mode(self, mock_logger, mock_get_staged, tmp_path): + """Test run_checks in staged files mode.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("test content\n") + mock_get_staged.return_value = [test_file] + + rule = Rule( + name="test_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + with patch.object(Rule, "cpp_style_rule_counter", 0): + with patch.object(Rule, "general_rule_counter", 0): + run_checks([rule]) + + mock_logger.info.assert_called_with("Running checks on staged files...") + + @patch("checks.scripts.cpp_checks.get_files_in_dirs") + @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("sys.argv", ["cpp_checks", "full"]) + def test_run_checks_full_mode(self, mock_logger, mock_get_files, tmp_path): + """Test run_checks in full mode.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("test content\n") + mock_get_files.return_value = [test_file] + + rule = Rule( + name="test_rule", + func=lambda line: ResultType(ResultTypeEnum.Ok), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + with patch.object(Rule, "cpp_style_rule_counter", 0): + with patch.object(Rule, "general_rule_counter", 0): + run_checks([rule]) + + mock_logger.info.assert_called_with("Running full checks...") + + @patch("checks.scripts.cpp_checks.get_staged_files") + @patch("checks.scripts.cpp_checks.cpp_check_logger") + def test_run_checks_with_errors(self, mock_logger, mock_get_staged, tmp_path): + """Test run_checks logs errors when rule fails.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("bad code\n") + mock_get_staged.return_value = [test_file] + + rule = Rule( + name="failing_rule", + func=lambda line: ResultType(ResultTypeEnum.Error, "Error found"), + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + with patch.object(Rule, "cpp_style_rule_counter", 0): + with patch.object(Rule, "general_rule_counter", 0): + run_checks([rule]) + + assert mock_logger.error.called + + @patch("checks.scripts.cpp_checks.get_staged_files") + @patch("checks.scripts.cpp_checks.cpp_check_logger") + def test_run_checks_stops_on_first_file_with_errors( + self, mock_logger, mock_get_staged, tmp_path + ): + """Test run_checks returns after first file with errors.""" + file1 = tmp_path / "test1.cpp" + file1.write_text("bad code\n") + file2 = tmp_path / "test2.cpp" + file2.write_text("more code\n") + mock_get_staged.return_value = [file1, file2] + + call_count = [0] + + def counting_func(line): + call_count[0] += 1 + return ResultType(ResultTypeEnum.Error, "Error") + + rule = Rule( + name="counting_rule", + func=counting_func, + rule_type=RuleType.CPP_STYLE, + rule_input_type=RuleInputType.LINE, + ) + + with patch.object(Rule, "cpp_style_rule_counter", 0): + with patch.object(Rule, "general_rule_counter", 0): + run_checks([rule]) + + # Should stop after first file + assert call_count[0] == 1 + + +class TestMain: + """Tests for main function.""" + + def setup_method(self): + """Reset rule counters before each test.""" + Rule.cpp_style_rule_counter = 0 + Rule.general_rule_counter = 0 + + @patch("checks.scripts.cpp_checks.run_checks") + def test_main_calls_run_checks(self, mock_run_checks): + """Test main function calls run_checks with cpp_rules.""" + from checks.cpp import cpp_rules + + main() + + mock_run_checks.assert_called_once_with(cpp_rules) + + @patch("checks.scripts.cpp_checks.get_staged_files") + @patch("checks.scripts.cpp_checks.cpp_check_logger") + def test_main_integration(self, mock_logger, mock_get_staged, tmp_path): + """Test main function integration.""" + test_file = tmp_path / "test.cpp" + test_file.write_text("static inline constexpr int x = 42;\n") + mock_get_staged.return_value = [test_file] + + main() + + mock_logger.info.assert_called() From 640fc0bf98cd476379951756353f2ecddff882dc Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 23:20:14 +0100 Subject: [PATCH 049/115] fix: simplify argument handling in Rule.apply method --- checks/src/checks/rules/rules.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index de00dc9..9e033cb 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -142,9 +142,8 @@ def apply(self, args: tuple) -> ResultType: """ if isinstance(args, str): args = (args,) - if len(args) > 1: - raise TypeError("Rule function expects at most one argument, but got multiple.") - return self.func(args[0]) if args else self.func() + + return self.func(*args) if args else self.func() def filter_cpp_rules(rules: list[Rule]) -> list[Rule]: From b4e86c51073991439f800a905b89f295a87314e3 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Fri, 28 Nov 2025 23:21:07 +0100 Subject: [PATCH 050/115] fix: initialize found_indices variable within the loop in check_key_sequence_ordered function --- checks/src/checks/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index be12313..955a0d4 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -64,8 +64,8 @@ def check_key_sequence_ordered( for key in key_sequence ] - found_indices = 1 for index in indices[0]: + found_indices = 1 for i in range(1, len(indices)): if index + i in indices[i]: found_indices += 1 From 4c26c8e0d25750a29b97b4f25e7fd228e84ad358 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:09:10 +0100 Subject: [PATCH 051/115] Update checks/tests/files/test_files.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/tests/files/test_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/tests/files/test_files.py b/checks/tests/files/test_files.py index 77c955e..5d74f56 100644 --- a/checks/tests/files/test_files.py +++ b/checks/tests/files/test_files.py @@ -2,7 +2,7 @@ from checks.files import FileType -def test_get_all_file_types(): +def test_all_types(): expected_types = { FileType.CPPHeader, From b786604538692905f2b69ef2919faa708b872fd6 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:09:37 +0100 Subject: [PATCH 052/115] Update CHANGELOG.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0f599..912a495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ All notable changes to this project will be documented in this file. ### MSTD-CHECKS -- add checks python library first version for all kind of custom static code analysis -- add "static inline constexpr" as key sequence order cpp rule +- Add checks python library first version for all kind of custom static code analysis +- Add "static inline constexpr" as key sequence order cpp rule ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From 52bbbad461a3aeea535e2207dcefe4723ef68f34 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:10:06 +0100 Subject: [PATCH 053/115] Update checks/src/checks/files/files.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/files/files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index 38d9ba5..caec133 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -80,7 +80,7 @@ def get_files_in_dirs( List of file names to exclude from the search. Defaults to None. max_recursion: int Number of maximum recursion through dirs to avoid infinite recursion, - default 10 + default 20 Returns ------- From fccf2f6db503064ea9bf0b0c3fbc86ddb5e462dd Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:10:34 +0100 Subject: [PATCH 054/115] Update checks/src/checks/utils/utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index 955a0d4..46a47a0 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -44,7 +44,7 @@ def check_key_sequence_ordered( line: str The line of text to check. key_delimiter: str - The delimiter used to find the keys + The delimiter used to find the keys. Returns ------- From 3a80c3f9517590978e2b3182dd3b47c98d508067 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:17:03 +0100 Subject: [PATCH 055/115] feat: add error handling in check_key_sequence_ordered and include issue reporting link --- checks/src/checks/config.py | 4 ++++ checks/src/checks/utils/utils.py | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 checks/src/checks/config.py diff --git a/checks/src/checks/config.py b/checks/src/checks/config.py new file mode 100644 index 0000000..61a68f1 --- /dev/null +++ b/checks/src/checks/config.py @@ -0,0 +1,4 @@ +"""Module defining configuration settings for mstd checks.""" + +__MSTD_GITHUB_REPO__ = "https://github.com/97gamjak/mstd" +__MSTD_ISSUES_PAGE__ = f"{__MSTD_GITHUB_REPO__}/issues" diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index 46a47a0..e7e0ded 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -6,6 +6,7 @@ from checks.logger import utils_logger from checks.rules import ResultType, ResultTypeEnum +from checks.config import __MSTD_ISSUES_PAGE__ if typing.TYPE_CHECKING: from typing import Any @@ -64,6 +65,13 @@ def check_key_sequence_ordered( for key in key_sequence ] + if len(indices) != len(key_sequence): + msg = f"Expected {len(key_sequence)} indices, but got {len(indices)}. " + msg += "This indicates an internal error. " + msg += f"Please report this issue at {__MSTD_ISSUES_PAGE__}." + raise ValueError(msg) + + found_indices = 0 for index in indices[0]: found_indices = 1 for i in range(1, len(indices)): From 2fadb6ac7737a42a424a7a74754d21e9ee554762 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:18:03 +0100 Subject: [PATCH 056/115] fix: correct logic in check_key_sequence_ordered to properly track found indices --- checks/src/checks/utils/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index e7e0ded..f9507d7 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -78,7 +78,6 @@ def check_key_sequence_ordered( if index + i in indices[i]: found_indices += 1 continue - found_indices = 1 break if found_indices == len(key_sequence): From 49cdbfd1dc9d8323e349f2aca5df5b83361d975f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:18:54 +0100 Subject: [PATCH 057/115] fix: remove TODO comment from pylint.max-args in ruff.toml --- checks/src/checks/ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/ruff.toml b/checks/src/checks/ruff.toml index fb706af..e2b672d 100644 --- a/checks/src/checks/ruff.toml +++ b/checks/src/checks/ruff.toml @@ -8,4 +8,4 @@ ignore = [ "S607", # relative paths are not allowed by this rule in subprocess commands "ANN401", # allow Any type annotations for now ] -pylint.max-args = 6 # TODO(97gamjak): remove this in future versions # https://github.com/97gamjak/mstd/issues/XX \ No newline at end of file +pylint.max-args = 6 \ No newline at end of file From d56c7ee2f221cce4f0cb9512b4ae572c125ebd0a Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:23:47 +0100 Subject: [PATCH 058/115] refactor: update type hints for paths in get_files_in_dirs and determine_file_type functions --- checks/src/checks/files/files.py | 12 +++++++++--- checks/src/checks/utils/utils.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index caec133..e8d9286 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -5,9 +5,10 @@ import subprocess import typing from enum import Enum +from pathlib import Path if typing.TYPE_CHECKING: - from pathlib import Path + from collections.abc import Iterable class FileType(Enum): @@ -63,7 +64,7 @@ def determine_file_type(filename: str | Path) -> FileType: def get_files_in_dirs( - paths: list[Path], + paths: Iterable[Path], exclude_dirs: list[str] | None = None, exclude_files: list[str] | None = None, max_recursion: int = 20 @@ -72,7 +73,7 @@ def get_files_in_dirs( Parameters ---------- - paths: list[Path] + paths: Iterable[Path] List of directory paths to search for files. exclude_dirs: list[str] | None List of directory names to exclude from the search. Defaults to None. @@ -123,6 +124,11 @@ def get_staged_files() -> list[Path]: list[Path]: List of staged file paths. + Raises + ------ + subprocess.CalledProcessError + If the git command fails. + """ result = subprocess.run( ["git", "diff", "--name-only", "--cached"], diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index f9507d7..0b2d45f 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -4,9 +4,9 @@ import typing +from checks.config import __MSTD_ISSUES_PAGE__ from checks.logger import utils_logger from checks.rules import ResultType, ResultTypeEnum -from checks.config import __MSTD_ISSUES_PAGE__ if typing.TYPE_CHECKING: from typing import Any From 9b79b54bd808ceda92607f8b0c4e983d9a4f70c2 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:24:43 +0100 Subject: [PATCH 059/115] fix: update apply method signature to accept variable arguments --- checks/src/checks/rules/rules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index 9e033cb..cfeb1f8 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -126,12 +126,12 @@ def __init__( self.rule_identifier = Rule.increment_rule_counter(rule_type) - def apply(self, args: tuple) -> ResultType: + def apply(self, *args: typing.Any) -> ResultType: """Apply the rule on a specific line. Parameters ---------- - args: tuple + args: typing.Any The arguments to pass to the rule function. Returns From 3fd8956b1246d1cf1c2e3470c8591d2932968f57 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 13:26:41 +0100 Subject: [PATCH 060/115] fix: update apply method signature to accept a tuple for arguments --- checks/src/checks/rules/rules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/src/checks/rules/rules.py b/checks/src/checks/rules/rules.py index cfeb1f8..9e033cb 100644 --- a/checks/src/checks/rules/rules.py +++ b/checks/src/checks/rules/rules.py @@ -126,12 +126,12 @@ def __init__( self.rule_identifier = Rule.increment_rule_counter(rule_type) - def apply(self, *args: typing.Any) -> ResultType: + def apply(self, args: tuple) -> ResultType: """Apply the rule on a specific line. Parameters ---------- - args: typing.Any + args: tuple The arguments to pass to the rule function. Returns From 6aca49818196118a45ff4aa060e642a5a2f1c473 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 29 Nov 2025 12:27:22 +0000 Subject: [PATCH 061/115] Initial plan From beb2be7ae6e3f7b99aabc5d2be9f7a194bf9e76c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 29 Nov 2025 12:29:53 +0000 Subject: [PATCH 062/115] feat: add comprehensive test cases for check_key_sequence_ordered Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- checks/tests/utils/test_utils.py | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/checks/tests/utils/test_utils.py b/checks/tests/utils/test_utils.py index 1cf58d4..c8a048d 100644 --- a/checks/tests/utils/test_utils.py +++ b/checks/tests/utils/test_utils.py @@ -11,3 +11,77 @@ def test_check_key_sequence_ordered(): line = "inline static constexpr int x = 42;" result = check_key_sequence_ordered(keys, line) assert result.value == ResultTypeEnum.Error + + +def test_check_key_sequence_ordered_first_key_not_in_line(): + """Test when the first key doesn't appear in the line.""" + keys = "static inline constexpr" + # Line doesn't contain 'static' (first key) + line = "inline constexpr int x = 42;" + result = check_key_sequence_ordered(keys, line) + # Should return Ok since not all keys are present + assert result.value == ResultTypeEnum.Ok + + +def test_check_key_sequence_ordered_no_keys_in_line(): + """Test when none of the keys appear in the line.""" + keys = "static inline constexpr" + line = "int x = 42;" + result = check_key_sequence_ordered(keys, line) + assert result.value == ResultTypeEnum.Ok + + +def test_check_key_sequence_ordered_keys_multiple_positions(): + """Test when keys appear multiple times in different positions.""" + keys = "static inline" + # 'static' appears twice, second occurrence is followed by 'inline' + line = "static int static inline foo();" + result = check_key_sequence_ordered(keys, line) + # Should be Ok because the sequence 'static inline' exists in the line + assert result.value == ResultTypeEnum.Ok + + +def test_check_key_sequence_ordered_keys_multiple_positions_wrong_order(): + """Test when keys appear multiple times but never in correct sequence.""" + keys = "static inline constexpr" + # Multiple occurrences but never the correct consecutive sequence + line = "inline static inline constexpr static int x;" + result = check_key_sequence_ordered(keys, line) + # Should be Error because the exact sequence isn't in correct consecutive order + assert result.value == ResultTypeEnum.Error + + +def test_check_key_sequence_ordered_correct_order_not_consecutive(): + """Test when keys appear in correct order but not consecutively.""" + keys = "static inline constexpr" + # Keys in order but with other tokens between them + line = "static int inline float constexpr x = 42;" + result = check_key_sequence_ordered(keys, line) + # Should be Error because keys are not consecutively in order + assert result.value == ResultTypeEnum.Error + + +def test_check_key_sequence_ordered_single_key(): + """Test with a single key.""" + keys = "static" + line = "static int x = 42;" + result = check_key_sequence_ordered(keys, line) + assert result.value == ResultTypeEnum.Ok + + +def test_check_key_sequence_ordered_single_key_not_present(): + """Test with a single key that's not present.""" + keys = "static" + line = "int x = 42;" + result = check_key_sequence_ordered(keys, line) + assert result.value == ResultTypeEnum.Ok + + +def test_check_key_sequence_ordered_partial_keys_present(): + """Test when only some keys from the sequence are present.""" + keys = "static inline constexpr" + # Only 'static' and 'constexpr' are present, 'inline' is missing + line = "static constexpr int x = 42;" + result = check_key_sequence_ordered(keys, line) + # Should return Ok since not all keys are present + assert result.value == ResultTypeEnum.Ok From e94b415afb758790663cc0dede747a8f68c5760c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 29 Nov 2025 12:30:46 +0000 Subject: [PATCH 063/115] fix: correct test case for keys appearing multiple times Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- checks/tests/utils/test_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/checks/tests/utils/test_utils.py b/checks/tests/utils/test_utils.py index c8a048d..897e359 100644 --- a/checks/tests/utils/test_utils.py +++ b/checks/tests/utils/test_utils.py @@ -44,8 +44,9 @@ def test_check_key_sequence_ordered_keys_multiple_positions(): def test_check_key_sequence_ordered_keys_multiple_positions_wrong_order(): """Test when keys appear multiple times but never in correct sequence.""" keys = "static inline constexpr" - # Multiple occurrences but never the correct consecutive sequence - line = "inline static inline constexpr static int x;" + # 'static' at positions 0, 3; 'inline' at 1; 'constexpr' at 4 + # No consecutive sequence of 'static inline constexpr' exists + line = "static inline int static constexpr x;" result = check_key_sequence_ordered(keys, line) # Should be Error because the exact sequence isn't in correct consecutive order assert result.value == ResultTypeEnum.Error From 1ba9a3d5d359ee56fc303b26ec7006b57517d7d8 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:26:53 +0100 Subject: [PATCH 064/115] feat: add github module to mstd checks --- checks/src/checks/config.py | 4 ---- checks/src/checks/github.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) delete mode 100644 checks/src/checks/config.py create mode 100644 checks/src/checks/github.py diff --git a/checks/src/checks/config.py b/checks/src/checks/config.py deleted file mode 100644 index 61a68f1..0000000 --- a/checks/src/checks/config.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Module defining configuration settings for mstd checks.""" - -__MSTD_GITHUB_REPO__ = "https://github.com/97gamjak/mstd" -__MSTD_ISSUES_PAGE__ = f"{__MSTD_GITHUB_REPO__}/issues" diff --git a/checks/src/checks/github.py b/checks/src/checks/github.py new file mode 100644 index 0000000..2bcf588 --- /dev/null +++ b/checks/src/checks/github.py @@ -0,0 +1,32 @@ +"""Module for GitHub-related constants and functions.""" + +import os + +__GITHUB_REPO__ = "https://github.com" +__MSTD_GITHUB_REPO__ = "https://github.com/97gamjak/mstd" +__MSTD_ISSUES_PAGE__ = f"{__MSTD_GITHUB_REPO__}/issues" + + +class MSTDGithubError(Exception): + """Exception raised for GitHub-related errors in mstd checks.""" + + def __init__(self, message: str) -> None: + """Initialize the exception with a message.""" + super().__init__(f"MSTDGithubError: {message}") + self.message = message + + +def get_github_repo() -> str: + """Get the current GitHub repository URL. + + Returns + ------- + str + The GitHub repository URL. + + """ + repo = os.getenv("GITHUB_REPOSITORY", "repo/owner") + # TODO(97gamjak): centralize env logic if needed elsewhere + # https://github.com/97gamjak/mstd/issues/26 + + return f"{__GITHUB_REPO__}/{repo}" From 73afc0c46c6b66a78f3745c672bf73f7bd1e865e Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:27:24 +0100 Subject: [PATCH 065/115] chore: update uv.lock and .gitignore for python packaging and adding typer dependency --- .gitignore | 1 + checks/uv.lock | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/.gitignore b/.gitignore index 39cc78e..1186515 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build .cache checks.egg-info/ __pycache__/ +.venv diff --git a/checks/uv.lock b/checks/uv.lock index b4677f6..e189042 100644 --- a/checks/uv.lock +++ b/checks/uv.lock @@ -9,12 +9,26 @@ source = { virtual = "." } dependencies = [ { name = "pytest" }, { name = "ruff" }, + { name = "typer" }, ] [package.metadata] requires-dist = [ { name = "pytest", specifier = ">=9.0.1" }, { name = "ruff", specifier = ">=0.14.6" }, + { name = "typer", specifier = ">=0.20.0" }, +] + +[[package]] +name = "click" +version = "8.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" }, ] [[package]] @@ -35,6 +49,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "markdown-it-py" +version = "4.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + [[package]] name = "packaging" version = "25.0" @@ -78,6 +113,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, ] +[[package]] +name = "rich" +version = "14.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" }, +] + [[package]] name = "ruff" version = "0.14.6" @@ -103,3 +151,36 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fb/02/82240553b77fd1341f80ebb3eaae43ba011c7a91b4224a9f317d8e6591af/ruff-0.14.6-py3-none-win_amd64.whl", hash = "sha256:390e6480c5e3659f8a4c8d6a0373027820419ac14fa0d2713bd8e6c3e125b8b9", size = 14432087, upload-time = "2025-11-21T14:26:10.891Z" }, { url = "https://files.pythonhosted.org/packages/a5/1f/93f9b0fad9470e4c829a5bb678da4012f0c710d09331b860ee555216f4ea/ruff-0.14.6-py3-none-win_arm64.whl", hash = "sha256:d43c81fbeae52cfa8728d8766bbf46ee4298c888072105815b392da70ca836b2", size = 13520930, upload-time = "2025-11-21T14:26:13.951Z" }, ] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + +[[package]] +name = "typer" +version = "0.20.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "rich" }, + { name = "shellingham" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8f/28/7c85c8032b91dbe79725b6f17d2fffc595dff06a35c7a30a37bef73a1ab4/typer-0.20.0.tar.gz", hash = "sha256:1aaf6494031793e4876fb0bacfa6a912b551cf43c1e63c800df8b1a866720c37", size = 106492, upload-time = "2025-10-20T17:03:49.445Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/64/7713ffe4b5983314e9d436a90d5bd4f63b6054e2aca783a3cfc44cb95bbf/typer-0.20.0-py3-none-any.whl", hash = "sha256:5b463df6793ec1dca6213a3cf4c0f03bc6e322ac5e16e13ddd622a889489784a", size = 47028, upload-time = "2025-10-20T17:03:47.617Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] From 3c7594707bb33a0e93c180f22c38c553fef0cc03 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:27:59 +0100 Subject: [PATCH 066/115] feat: add general file settings config - for now only default encoding --- checks/src/checks/files/config.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 checks/src/checks/files/config.py diff --git a/checks/src/checks/files/config.py b/checks/src/checks/files/config.py new file mode 100644 index 0000000..30323a0 --- /dev/null +++ b/checks/src/checks/files/config.py @@ -0,0 +1,3 @@ +"""Module for configurations settings for mstd file operations.""" + +__DEFAULT_ENCODING__ = "utf-8" From 9419a5003591203c13bf0d4ba955e1209e6eda7b Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:28:34 +0100 Subject: [PATCH 067/115] feat: add option for rich printing --- checks/src/checks/utils/__init__.py | 2 ++ checks/src/checks/utils/rich.py | 5 +++++ checks/src/checks/utils/utils.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 checks/src/checks/utils/rich.py diff --git a/checks/src/checks/utils/__init__.py b/checks/src/checks/utils/__init__.py index 767e0fa..be10864 100644 --- a/checks/src/checks/utils/__init__.py +++ b/checks/src/checks/utils/__init__.py @@ -1,5 +1,7 @@ """Top level package for utility functions in mstd checks.""" +from .rich import mstd_print from .utils import check_key_sequence_ordered __all__ = ["check_key_sequence_ordered"] +__all__ += ["mstd_print"] diff --git a/checks/src/checks/utils/rich.py b/checks/src/checks/utils/rich.py new file mode 100644 index 0000000..edf8a2d --- /dev/null +++ b/checks/src/checks/utils/rich.py @@ -0,0 +1,5 @@ +"""Utility module for rich text printing.""" + +from rich import print as mstd_print + +__all__ = ["mstd_print"] diff --git a/checks/src/checks/utils/utils.py b/checks/src/checks/utils/utils.py index 0b2d45f..f89340a 100644 --- a/checks/src/checks/utils/utils.py +++ b/checks/src/checks/utils/utils.py @@ -4,7 +4,7 @@ import typing -from checks.config import __MSTD_ISSUES_PAGE__ +from checks.github import __MSTD_ISSUES_PAGE__ from checks.logger import utils_logger from checks.rules import ResultType, ResultTypeEnum From 7d82703b1e88d61b9dae5bb8cdb88ccf3f4951ab Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:29:11 +0100 Subject: [PATCH 068/115] refactor: clean up a bit general logging debug handling --- checks/src/checks/logger/logger.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/checks/src/checks/logger/logger.py b/checks/src/checks/logger/logger.py index e4d985b..4fbcfaf 100644 --- a/checks/src/checks/logger/logger.py +++ b/checks/src/checks/logger/logger.py @@ -7,12 +7,14 @@ # TODO(97gamjak): centralize env logic if needed elsewhere # https://github.com/97gamjak/mstd/issues/26 + +cpp_check_logger = logging.getLogger("mstd_cpp_checks") + if int(__DEBUG_MSTD_CHECKS__) > 0: - logging.basicConfig(level=logging.DEBUG) + cpp_check_logger.setLevel(logging.DEBUG) else: - logging.basicConfig(level=logging.INFO) + cpp_check_logger.setLevel(logging.INFO) -cpp_check_logger = logging.getLogger("mstd_cpp_checks") utils_logger = logging.getLogger("mstd_utils") if int(__DEBUG_MSTD_UTILS__) > 0: From da4cf8dfeca30408222c7c1cc9aae9e61c4fb41c Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:29:29 +0100 Subject: [PATCH 069/115] feat: add MSTDFileNotFoundError exception for handling missing files --- checks/src/checks/files/files.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/checks/src/checks/files/files.py b/checks/src/checks/files/files.py index e8d9286..d00c985 100644 --- a/checks/src/checks/files/files.py +++ b/checks/src/checks/files/files.py @@ -11,6 +11,15 @@ from collections.abc import Iterable +class MSTDFileNotFoundError(Exception): + """Exception raised when a specified file is not found.""" + + def __init__(self, filepath: Path) -> None: + """Initialize the exception with the missing file path.""" + super().__init__(f"File not found: {filepath}") + self.filepath = filepath + + class FileType(Enum): """Enumeration of file types for mstd checks.""" From e84f582e4292c826b44013392f827fc4d94297b0 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:29:36 +0100 Subject: [PATCH 070/115] feat: implement changelog update functionality with command-line interface --- checks/pyproject.toml | 6 +- checks/src/checks/files/update_changelog.py | 76 +++++++++++++++++++ checks/src/checks/scripts/update_changelog.py | 32 ++++++++ 3 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 checks/src/checks/files/update_changelog.py create mode 100644 checks/src/checks/scripts/update_changelog.py diff --git a/checks/pyproject.toml b/checks/pyproject.toml index 9c0ca11..70c5cb6 100644 --- a/checks/pyproject.toml +++ b/checks/pyproject.toml @@ -4,10 +4,8 @@ version = "0.1.0" description = "This package handles commit and CI checks for mstd" readme = "README.md" requires-python = ">=3.12" -dependencies = [ - "pytest>=9.0.1", - "ruff>=0.14.6", -] +dependencies = ["pytest>=9.0.1", "ruff>=0.14.6", "typer>=0.20.0"] [project.scripts] cpp_checks = "checks.scripts.cpp_checks:main" +update_changelog = "checks.scripts.update_changelog:app" diff --git a/checks/src/checks/files/update_changelog.py b/checks/src/checks/files/update_changelog.py new file mode 100644 index 0000000..9865046 --- /dev/null +++ b/checks/src/checks/files/update_changelog.py @@ -0,0 +1,76 @@ +"""Module for updating the changelog file.""" + +import re +from datetime import UTC, datetime +from pathlib import Path + +from checks.files.files import MSTDFileNotFoundError +from checks.github import get_github_repo + +from .config import __DEFAULT_ENCODING__ + +__CHANGELOG_PATH__ = Path("CHANGELOG.md") +__CHANGELOG_INSERTION_MARKER__ = "" + + +class MSTDChangelogError(Exception): + """Base class for changelog related errors.""" + + def __init__(self, message: str) -> None: + """Initialize the exception with a message.""" + super().__init__(f"MSTDChangelogError: {message}") + self.message = message + + +def update_changelog(version: str, changelog_path: Path = __CHANGELOG_PATH__) -> None: + """Update the changelog file with a new version entry. + + Parameters + ---------- + version: str + The new version to add to the changelog. + changelog_path: Path + The path to the changelog file. + + Raises + ------ + MSTDFileNotFoundError + If the changelog file does not exist. + MSTDChangelogError + If the "## Next Release" marker is not found in the changelog. + + """ + if not changelog_path.is_file(): + raise MSTDFileNotFoundError(changelog_path) + + with changelog_path.open("r", encoding=__DEFAULT_ENCODING__) as f: + content = f.readlines() + + repo = get_github_repo() + today = datetime.now(tz=UTC).date().isoformat() + new_entry = f"## [{version}]({repo}/releases/tag/{version}) - {today}" + + updated = [] + marker_moved = False + + for line in content: + # Find the "## Next Release" heading + if not marker_moved and re.match(r"^##\s+Next Release", line): + # Ensure marker comes right after "Next Release" + updated.append(line + "\n") + updated.append(__CHANGELOG_INSERTION_MARKER__ + "\n") + updated.append(new_entry + "\n") + marker_moved = True + + # Skip the old insertion marker wherever it was + elif __CHANGELOG_INSERTION_MARKER__ in line and marker_moved: + continue + + else: + updated.append(line) + + if not marker_moved: + msg = "Could not find '## Next Release' in CHANGELOG.md" + raise MSTDChangelogError(msg) + + changelog_path.write_text("".join(updated) + "\n", encoding="utf-8") diff --git a/checks/src/checks/scripts/update_changelog.py b/checks/src/checks/scripts/update_changelog.py new file mode 100644 index 0000000..132adbe --- /dev/null +++ b/checks/src/checks/scripts/update_changelog.py @@ -0,0 +1,32 @@ +"""Script for updating the changelog file.""" + +import sys + +import typer + +from checks.files import update_changelog +from checks.files.update_changelog import MSTDChangelogError +from checks.utils import mstd_print + +app = typer.Typer() + + +@app.command() +def main(version: str) -> None: + """Update the changelog file with a new version entry. + + Parameters + ---------- + version: str + The new version to add to the changelog. + + """ + try: + update_changelog.update_changelog(version) + mstd_print(f"✅ CHANGELOG.md updated for version {version}") + except MSTDChangelogError as e: + mstd_print(f"❌ Error updating changelog: {e}") + sys.exit(1) + +if __name__ == "__main__": + app() From ab3b84a5efbbe747315235ca592d77378f301e4f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:37:15 +0100 Subject: [PATCH 071/115] docs: update CHANGELOG.md and add update_changelog.py info --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 912a495..c03b713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - Add checks python library first version for all kind of custom static code analysis - Add "static inline constexpr" as key sequence order cpp rule +- Add script to update CHANGELOG.md automatically based on version input ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From 9c00f15ef6af8bac6b4f1336f20c379b6480ca56 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:37:24 +0100 Subject: [PATCH 072/115] docs: clarify description of update_changelog.py in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c03b713..e3381b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. - Add checks python library first version for all kind of custom static code analysis - Add "static inline constexpr" as key sequence order cpp rule -- Add script to update CHANGELOG.md automatically based on version input +- Add "update_changelog.py" script to update CHANGELOG.md automatically based on version input ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From 0397432c9d72f0cda98050886b06236d219646cd Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:43:47 +0100 Subject: [PATCH 073/115] Update checks/src/checks/files/update_changelog.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/files/update_changelog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/files/update_changelog.py b/checks/src/checks/files/update_changelog.py index 9865046..45f2a5d 100644 --- a/checks/src/checks/files/update_changelog.py +++ b/checks/src/checks/files/update_changelog.py @@ -63,7 +63,7 @@ def update_changelog(version: str, changelog_path: Path = __CHANGELOG_PATH__) -> marker_moved = True # Skip the old insertion marker wherever it was - elif __CHANGELOG_INSERTION_MARKER__ in line and marker_moved: + elif __CHANGELOG_INSERTION_MARKER__ in line: continue else: From 5e54a21a8b17617092fc30268768e6d94b81d648 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:46:16 +0100 Subject: [PATCH 074/115] chore: add clarifying comment why update_changelog need new lines --- checks/src/checks/files/update_changelog.py | 1 + 1 file changed, 1 insertion(+) diff --git a/checks/src/checks/files/update_changelog.py b/checks/src/checks/files/update_changelog.py index 9865046..97c1b4d 100644 --- a/checks/src/checks/files/update_changelog.py +++ b/checks/src/checks/files/update_changelog.py @@ -57,6 +57,7 @@ def update_changelog(version: str, changelog_path: Path = __CHANGELOG_PATH__) -> # Find the "## Next Release" heading if not marker_moved and re.match(r"^##\s+Next Release", line): # Ensure marker comes right after "Next Release" + # For formatting consistency, add newline characters to all appended lines updated.append(line + "\n") updated.append(__CHANGELOG_INSERTION_MARKER__ + "\n") updated.append(new_entry + "\n") From 1430855d9542d6bd09c137d1e9818327aa710abc Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:46:57 +0100 Subject: [PATCH 075/115] Update checks/src/checks/files/update_changelog.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/src/checks/files/update_changelog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/src/checks/files/update_changelog.py b/checks/src/checks/files/update_changelog.py index 2c5270d..04cce7b 100644 --- a/checks/src/checks/files/update_changelog.py +++ b/checks/src/checks/files/update_changelog.py @@ -74,4 +74,4 @@ def update_changelog(version: str, changelog_path: Path = __CHANGELOG_PATH__) -> msg = "Could not find '## Next Release' in CHANGELOG.md" raise MSTDChangelogError(msg) - changelog_path.write_text("".join(updated) + "\n", encoding="utf-8") + changelog_path.write_text("".join(updated) + "\n", encoding=__DEFAULT_ENCODING__) From 73f653e1ee70598cdd00004754e7c7c17930215e Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 29 Nov 2025 22:48:18 +0100 Subject: [PATCH 076/115] Revert "refactor: clean up a bit general logging debug handling" This reverts commit 7d82703b1e88d61b9dae5bb8cdb88ccf3f4951ab. --- checks/src/checks/logger/logger.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/checks/src/checks/logger/logger.py b/checks/src/checks/logger/logger.py index 4fbcfaf..e4d985b 100644 --- a/checks/src/checks/logger/logger.py +++ b/checks/src/checks/logger/logger.py @@ -7,14 +7,12 @@ # TODO(97gamjak): centralize env logic if needed elsewhere # https://github.com/97gamjak/mstd/issues/26 - -cpp_check_logger = logging.getLogger("mstd_cpp_checks") - if int(__DEBUG_MSTD_CHECKS__) > 0: - cpp_check_logger.setLevel(logging.DEBUG) + logging.basicConfig(level=logging.DEBUG) else: - cpp_check_logger.setLevel(logging.INFO) + logging.basicConfig(level=logging.INFO) +cpp_check_logger = logging.getLogger("mstd_cpp_checks") utils_logger = logging.getLogger("mstd_utils") if int(__DEBUG_MSTD_UTILS__) > 0: From 899a1fb82f765d6c9852c459233f945480f02376 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 29 Nov 2025 21:49:14 +0000 Subject: [PATCH 077/115] Initial plan From a882def3f94614b9bbfa86442c333b6ce653c589 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 29 Nov 2025 21:52:43 +0000 Subject: [PATCH 078/115] test: add comprehensive tests for update_changelog module Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- checks/tests/files/test_update_changelog.py | 252 ++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 checks/tests/files/test_update_changelog.py diff --git a/checks/tests/files/test_update_changelog.py b/checks/tests/files/test_update_changelog.py new file mode 100644 index 0000000..a0b9adf --- /dev/null +++ b/checks/tests/files/test_update_changelog.py @@ -0,0 +1,252 @@ +"""Unit tests for changelog update functionality in mstd checks.""" + +from datetime import UTC, datetime +from unittest.mock import patch + +import pytest + +from checks.files.files import MSTDFileNotFoundError +from checks.files.update_changelog import ( + MSTDChangelogError, + __CHANGELOG_INSERTION_MARKER__, + update_changelog, +) + + +class TestMSTDChangelogError: + """Tests for MSTDChangelogError exception class.""" + + def test_changelog_error_message(self): + """Test that MSTDChangelogError formats message correctly.""" + error = MSTDChangelogError("test error message") + assert str(error) == "MSTDChangelogError: test error message" + assert error.message == "test error message" + + def test_changelog_error_is_exception(self): + """Test that MSTDChangelogError is a proper exception.""" + error = MSTDChangelogError("test") + assert isinstance(error, Exception) + + +class TestUpdateChangelog: + """Tests for update_changelog function.""" + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_success(self, mock_get_repo, tmp_path): + """Test successful changelog update with new version.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## Next Release\n" + "\n" + "- Some change\n" + "\n" + "\n" + "\n" + "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" + "\n" + "- Initial release\n" + ) + + update_changelog("1.1.0", changelog) + + content = changelog.read_text() + assert "## [1.1.0](https://github.com/test/repo/releases/tag/1.1.0)" in content + assert "## Next Release" in content + # Marker should be after Next Release now + next_release_pos = content.find("## Next Release") + marker_pos = content.find(__CHANGELOG_INSERTION_MARKER__) + new_version_pos = content.find("## [1.1.0]") + assert next_release_pos < marker_pos < new_version_pos + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_with_date(self, mock_get_repo, tmp_path): + """Test that changelog entry includes today's date.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## Next Release\n" + "\n" + "- New feature\n" + "\n" + "\n" + ) + + update_changelog("2.0.0", changelog) + + content = changelog.read_text() + today = datetime.now(tz=UTC).date().isoformat() + assert f"## [2.0.0](https://github.com/test/repo/releases/tag/2.0.0) - {today}" in content + + def test_update_changelog_file_not_found(self, tmp_path): + """Test that MSTDFileNotFoundError is raised when file doesn't exist.""" + non_existent = tmp_path / "does_not_exist.md" + + with pytest.raises(MSTDFileNotFoundError) as exc_info: + update_changelog("1.0.0", non_existent) + + assert exc_info.value.filepath == non_existent + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_missing_next_release(self, mock_get_repo, tmp_path): + """Test that MSTDChangelogError is raised when Next Release marker missing.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" + "\n" + "- Initial release\n" + ) + + with pytest.raises(MSTDChangelogError) as exc_info: + update_changelog("1.1.0", changelog) + + assert "Next Release" in exc_info.value.message + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_removes_old_marker(self, mock_get_repo, tmp_path): + """Test that old insertion marker is removed and new one is placed.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## Next Release\n" + "\n" + "- New change\n" + "\n" + "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" + "\n" + "\n" + "\n" + "## [0.9.0](https://github.com/test/repo/releases/tag/0.9.0) - 2023-12-01\n" + ) + + update_changelog("1.1.0", changelog) + + content = changelog.read_text() + # Should have exactly one marker + assert content.count(__CHANGELOG_INSERTION_MARKER__) == 1 + # Marker should be right after Next Release section heading + next_release_pos = content.find("## Next Release") + marker_pos = content.find(__CHANGELOG_INSERTION_MARKER__) + assert next_release_pos < marker_pos + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_no_existing_marker(self, mock_get_repo, tmp_path): + """Test changelog update when no insertion marker exists.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## Next Release\n" + "\n" + "- Feature A\n" + "\n" + "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" + ) + + update_changelog("1.1.0", changelog) + + content = changelog.read_text() + assert __CHANGELOG_INSERTION_MARKER__ in content + assert "## [1.1.0]" in content + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_preserves_content(self, mock_get_repo, tmp_path): + """Test that changelog update preserves existing content.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + original_content = ( + "# Changelog\n" + "\n" + "All notable changes to this project.\n" + "\n" + "## Next Release\n" + "\n" + "### Added\n" + "- New feature\n" + "\n" + "### Fixed\n" + "- Bug fix\n" + "\n" + "\n" + "\n" + "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" + "\n" + "### Added\n" + "- Initial release\n" + ) + changelog.write_text(original_content) + + update_changelog("1.1.0", changelog) + + content = changelog.read_text() + # Check original sections are preserved + assert "# Changelog" in content + assert "All notable changes to this project." in content + assert "### Added" in content + assert "- New feature" in content + assert "### Fixed" in content + assert "- Bug fix" in content + assert "- Initial release" in content + assert "## [1.0.0]" in content + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_next_release_regex_variations( + self, mock_get_repo, tmp_path + ): + """Test that regex matches various Next Release formats.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + # Test with extra spaces + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## Next Release\n" + "\n" + "- Change\n" + "\n" + "\n" + ) + + update_changelog("1.0.0", changelog) + + content = changelog.read_text() + assert "## [1.0.0]" in content + + @patch("checks.files.update_changelog.get_github_repo") + def test_update_changelog_empty_next_release(self, mock_get_repo, tmp_path): + """Test changelog update when Next Release section is empty.""" + mock_get_repo.return_value = "https://github.com/test/repo" + + changelog = tmp_path / "CHANGELOG.md" + changelog.write_text( + "# Changelog\n" + "\n" + "## Next Release\n" + "\n" + "\n" + "\n" + "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" + ) + + update_changelog("1.1.0", changelog) + + content = changelog.read_text() + assert "## [1.1.0]" in content + assert "## [1.0.0]" in content From fdff7f180c2e685d78d637529ccf33fe65c4cb19 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 19:32:29 +0000 Subject: [PATCH 079/115] Initial plan From a5a4ac7268e683fcb6811b31b66c843e039f00cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 19:39:17 +0000 Subject: [PATCH 080/115] Add Doxygen documentation support Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- .gitignore | 1 + CMakeLists.txt | 17 ++++ docs/Doxyfile | 242 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 260 insertions(+) create mode 100644 docs/Doxyfile diff --git a/.gitignore b/.gitignore index 1186515..2a23e7d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build checks.egg-info/ __pycache__/ .venv +docs/output/ diff --git a/CMakeLists.txt b/CMakeLists.txt index c263e94..50977f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ project(mstd ) option(MSTD_BUILD_TESTS "Build mstd test" ON) +option(MSTD_BUILD_DOCS "Build mstd documentation" OFF) add_library(mstd INTERFACE) target_include_directories(mstd @@ -28,3 +29,19 @@ if(MSTD_BUILD_TESTS) else() message(STATUS "Tests are disabled. Set MSTD_BUILD_TESTS to ON to enable them.") endif() + +if(MSTD_BUILD_DOCS) + find_package(Doxygen REQUIRED) + if(DOXYGEN_FOUND) + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile) + add_custom_target(docs + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_IN} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM + ) + message(STATUS "Doxygen found. Use 'make docs' to build documentation.") + endif() +else() + message(STATUS "Documentation is disabled. Set MSTD_BUILD_DOCS to ON to enable it.") +endif() diff --git a/docs/Doxyfile b/docs/Doxyfile new file mode 100644 index 0000000..88ee01b --- /dev/null +++ b/docs/Doxyfile @@ -0,0 +1,242 @@ +# Doxyfile for mstd library +# Doxygen configuration file for generating API documentation + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +PROJECT_NAME = "mstd" +PROJECT_NUMBER = "0.1.0" +PROJECT_BRIEF = "mstd - header-only C++ library" +PROJECT_LOGO = +OUTPUT_DIRECTORY = docs/output +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = include +STRIP_FROM_INC_PATH = include + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES +SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +INPUT = include +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.hpp \ + *.h \ + *.cpp \ + *.c \ + *.md +RECURSIVE = YES +EXCLUDE = external +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = */test/* \ + */external/* +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +ALPHABETICAL_INDEX = YES +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_SECTIONS = YES +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +GENERATE_HTMLHELP = NO +GENERATE_QHP = NO +GENERATE_ECLIPSEHELP = NO +DISABLE_INDEX = NO +GENERATE_TREEVIEW = YES +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +GENERATE_LATEX = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +GENERATE_RTF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +GENERATE_MAN = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +GENERATE_XML = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +GENERATE_DOCBOOK = NO + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = include +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- + +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +CLASS_DIAGRAMS = YES +DIA_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = svg +INTERACTIVE_SVG = YES +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES From 8d24bc584dc5d8a88a63e67ad91ba7f235a67fb1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 19:40:30 +0000 Subject: [PATCH 081/115] Remove redundant DOXYGEN_FOUND check in CMakeLists.txt Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- CMakeLists.txt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50977f5..e2478bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,16 +32,14 @@ endif() if(MSTD_BUILD_DOCS) find_package(Doxygen REQUIRED) - if(DOXYGEN_FOUND) - set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile) - add_custom_target(docs - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_IN} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Generating API documentation with Doxygen" - VERBATIM - ) - message(STATUS "Doxygen found. Use 'make docs' to build documentation.") - endif() + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile) + add_custom_target(docs + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_IN} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM + ) + message(STATUS "Doxygen found. Use 'make docs' to build documentation.") else() message(STATUS "Documentation is disabled. Set MSTD_BUILD_DOCS to ON to enable it.") endif() From e8ebd129559a703e0307e4c6f2f07f6bc42fb554 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:20:12 +0000 Subject: [PATCH 082/115] Initial plan From 3e8d51e5b613e860716e4c39effe80472e19802d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:26:18 +0000 Subject: [PATCH 083/115] Add cppcheck and clang-tidy static analysis workflow Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- .github/workflows/static-analysis.yml | 54 +++ compile_commands.json | 675 +++++++++++++++++++++++++- 2 files changed, 728 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/static-analysis.yml mode change 120000 => 100644 compile_commands.json diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..7b53e1d --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,54 @@ +name: Static Analysis + +on: + pull_request: + branches: + - '*' + workflow_dispatch: + +jobs: + cppcheck: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install cppcheck + run: | + sudo apt update + sudo apt install -y cppcheck + + - name: Run cppcheck + run: | + cppcheck --enable=all \ + --error-exitcode=1 \ + --suppressions-list=.cppcheck.suppress \ + --inline-suppr \ + -I include \ + include test + + clang-tidy: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install clang-tidy and dependencies + run: | + sudo apt update + sudo apt install -y clang-tidy cmake g++ + + - name: Generate compile_commands.json + run: | + cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + test -f build/compile_commands.json && cp build/compile_commands.json . + + - name: Run clang-tidy on test directory + run: | + find test -name '*.cpp' -not -path '*/external/*' | xargs -r clang-tidy -p . --warnings-as-errors='*' + + - name: Run clang-tidy on include directory + run: | + find include -name '*.hpp' | xargs -r clang-tidy -p . --warnings-as-errors='*' diff --git a/compile_commands.json b/compile_commands.json deleted file mode 120000 index 4503a4b..0000000 --- a/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -.build/compile_commands.json \ No newline at end of file diff --git a/compile_commands.json b/compile_commands.json new file mode 100644 index 0000000..f5cc630 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1,674 @@ +[ +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/catch_chronometer.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/catch_chronometer.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/catch_chronometer.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/catch_chronometer.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_analyse.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_analyse.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_benchmark_function.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_benchmark_function.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_run_for_at_least.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_run_for_at_least.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_stats.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_stats.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_stats.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_stats.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/generators/catch_generator_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generator_exception.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generator_exception.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/generators/catch_generator_exception.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/generators/catch_generators.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/generators/catch_generators.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/generators/catch_generators_random.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators_random.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators_random.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/generators/catch_generators_random.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_automake.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_automake.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_automake.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_automake.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_common_base.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_common_base.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_compact.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_compact.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_compact.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_compact.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_console.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_console.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_console.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_console.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_cumulative_base.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_cumulative_base.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_event_listener.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_event_listener.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_helpers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_helpers.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_json.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_json.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_json.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_json.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_junit.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_junit.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_junit.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_junit.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_multi.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_multi.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_multi.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_multi.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_registrars.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_registrars.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_sonarqube.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_sonarqube.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_streaming_base.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_streaming_base.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_tap.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_tap.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_tap.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_tap.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_teamcity.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_teamcity.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_xml.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_xml.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_xml.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_xml.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_capture.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_capture.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_config.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_config.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_exception.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_generatortracker.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_generatortracker.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_registry_hub.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_registry_hub.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter_factory.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter_factory.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_testcase.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_testcase.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_approx.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_approx.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_approx.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_approx.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_assertion_result.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_assertion_result.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_assertion_result.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_assertion_result.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_config.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_config.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_config.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_config.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_get_random_seed.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_get_random_seed.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_get_random_seed.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_get_random_seed.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_message.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_message.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_message.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_message.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_registry_hub.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_registry_hub.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_registry_hub.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_registry_hub.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_session.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_session.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_session.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_session.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_tag_alias_autoregistrar.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_tag_alias_autoregistrar.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_test_case_info.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_case_info.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_case_info.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_test_case_info.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_test_spec.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_spec.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_spec.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_test_spec.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_timer.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_timer.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_timer.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_timer.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_tostring.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tostring.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tostring.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_tostring.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_totals.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_totals.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_totals.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_totals.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_translate_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_translate_exception.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_translate_exception.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_translate_exception.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_version.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_version.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_version.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_version.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_assertion_handler.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_assertion_handler.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_assertion_handler.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_assertion_handler.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_clara.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_clara.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_commandline.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_commandline.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_commandline.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_commandline.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_console_colour.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_console_colour.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_console_colour.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_console_colour.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_context.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_context.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_context.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_context.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_debug_console.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debug_console.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debug_console.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_debug_console.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_debugger.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debugger.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debugger.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_debugger.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_decomposer.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_decomposer.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_decomposer.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_decomposer.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_enforce.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enforce.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enforce.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enforce.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enum_values_registry.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enum_values_registry.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_errno_guard.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_errno_guard.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_errno_guard.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_errno_guard.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_exception_translator_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_exception_translator_registry.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_fatal_condition_handler.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_fatal_condition_handler.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_floating_point_helpers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_floating_point_helpers.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_getenv.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_getenv.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_getenv.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_getenv.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_istream.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_istream.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_istream.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_istream.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_jsonwriter.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_jsonwriter.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_jsonwriter.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_jsonwriter.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_lazy_expr.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_lazy_expr.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_lazy_expr.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_lazy_expr.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_leak_detector.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_leak_detector.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_leak_detector.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_leak_detector.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_list.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_list.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_list.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_list.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_message_info.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_message_info.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_message_info.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_message_info.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_output_redirect.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_output_redirect.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_output_redirect.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_output_redirect.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_parse_numbers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_parse_numbers.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_parse_numbers.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_parse_numbers.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_polyfills.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_polyfills.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_polyfills.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_polyfills.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_random_number_generator.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_number_generator.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_number_generator.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_random_number_generator.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_random_seed_generation.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_seed_generation.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_seed_generation.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_random_seed_generation.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_registry.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_registry.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_registry.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_spec_parser.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_spec_parser.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_reusable_string_stream.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_reusable_string_stream.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_run_context.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_run_context.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_run_context.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_run_context.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_section.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_section.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_section.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_section.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_singletons.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_singletons.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_singletons.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_singletons.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_source_line_info.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_source_line_info.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_source_line_info.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_source_line_info.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_startup_exception_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_startup_exception_registry.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_stdstreams.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stdstreams.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stdstreams.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_stdstreams.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_string_manip.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_string_manip.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_string_manip.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_string_manip.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_stringref.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stringref.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stringref.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_stringref.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_tag_alias_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_tag_alias_registry.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_info_hasher.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_info_hasher.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_registry_impl.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_registry_impl.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_tracker.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_tracker.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_tracker.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_tracker.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_failure_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_failure_exception.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_failure_exception.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_failure_exception.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_registry.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_registry.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_registry.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_spec_parser.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_spec_parser.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_spec_parser.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_spec_parser.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_textflow.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_textflow.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_textflow.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_textflow.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_uncaught_exceptions.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_uncaught_exceptions.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_wildcard_pattern.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_wildcard_pattern.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_wildcard_pattern.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_wildcard_pattern.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_xmlwriter.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_xmlwriter.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_xmlwriter.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_xmlwriter.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_container_properties.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_container_properties.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_exception.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_exception.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_exception.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_floating_point.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_floating_point.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_predicate.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_predicate.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_quantifiers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_quantifiers.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_string.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_string.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_string.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_string.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_templated.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_templated.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_templated.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_templated.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/internal/catch_matchers_impl.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/internal/catch_matchers_impl.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2WithMain.dir/catch2/internal/catch_main.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_main.cpp", + "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_main.cpp", + "output": "test/external/Catch2/src/CMakeFiles/Catch2WithMain.dir/catch2/internal/catch_main.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/math", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_math.dir/test_cpow.cpp.o -c /home/runner/work/mstd/mstd/test/math/test_cpow.cpp", + "file": "/home/runner/work/mstd/mstd/test/math/test_cpow.cpp", + "output": "test/math/CMakeFiles/mstd_tests_math.dir/test_cpow.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/physics", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_physics.dir/test_lie_potential.cpp.o -c /home/runner/work/mstd/mstd/test/physics/test_lie_potential.cpp", + "file": "/home/runner/work/mstd/mstd/test/physics/test_lie_potential.cpp", + "output": "test/physics/CMakeFiles/mstd_tests_physics.dir/test_lie_potential.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/quantity", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/compile_dummy.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/compile_dummy.cpp", + "file": "/home/runner/work/mstd/mstd/test/quantity/compile_dummy.cpp", + "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/compile_dummy.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/quantity", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/test_dimension.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/test_dimension.cpp", + "file": "/home/runner/work/mstd/mstd/test/quantity/test_dimension.cpp", + "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/test_dimension.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/quantity", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/test_quantity.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/test_quantity.cpp", + "file": "/home/runner/work/mstd/mstd/test/quantity/test_quantity.cpp", + "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/test_quantity.cpp.o" +}, +{ + "directory": "/home/runner/work/mstd/mstd/build/test/quantity", + "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/test_traits.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/test_traits.cpp", + "file": "/home/runner/work/mstd/mstd/test/quantity/test_traits.cpp", + "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/test_traits.cpp.o" +} +] \ No newline at end of file From 4d7641684051e65f5249b8a9e47344d938a18598 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:26:50 +0000 Subject: [PATCH 084/115] Restore compile_commands.json symlink Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- compile_commands.json | 675 +----------------------------------------- 1 file changed, 1 insertion(+), 674 deletions(-) mode change 100644 => 120000 compile_commands.json diff --git a/compile_commands.json b/compile_commands.json deleted file mode 100644 index f5cc630..0000000 --- a/compile_commands.json +++ /dev/null @@ -1,674 +0,0 @@ -[ -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/catch_chronometer.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/catch_chronometer.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/catch_chronometer.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/catch_chronometer.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_analyse.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_analyse.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_benchmark_function.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_benchmark_function.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_run_for_at_least.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_run_for_at_least.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_stats.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_stats.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/benchmark/detail/catch_stats.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/benchmark/detail/catch_stats.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/generators/catch_generator_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generator_exception.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generator_exception.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/generators/catch_generator_exception.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/generators/catch_generators.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/generators/catch_generators.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/generators/catch_generators_random.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators_random.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/generators/catch_generators_random.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/generators/catch_generators_random.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_automake.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_automake.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_automake.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_automake.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_common_base.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_common_base.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_compact.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_compact.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_compact.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_compact.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_console.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_console.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_console.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_console.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_cumulative_base.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_cumulative_base.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_event_listener.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_event_listener.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_helpers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_helpers.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_json.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_json.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_json.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_json.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_junit.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_junit.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_junit.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_junit.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_multi.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_multi.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_multi.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_multi.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_registrars.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_registrars.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_sonarqube.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_sonarqube.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_streaming_base.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_streaming_base.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_tap.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_tap.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_tap.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_tap.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_teamcity.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_teamcity.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_xml.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_xml.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/reporters/catch_reporter_xml.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_xml.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_capture.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_capture.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_config.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_config.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_exception.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_generatortracker.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_generatortracker.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_registry_hub.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_registry_hub.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter_factory.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter_factory.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_testcase.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_testcase.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_approx.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_approx.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_approx.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_approx.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_assertion_result.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_assertion_result.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_assertion_result.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_assertion_result.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_config.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_config.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_config.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_config.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_get_random_seed.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_get_random_seed.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_get_random_seed.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_get_random_seed.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_message.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_message.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_message.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_message.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_registry_hub.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_registry_hub.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_registry_hub.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_registry_hub.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_session.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_session.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_session.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_session.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_tag_alias_autoregistrar.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_tag_alias_autoregistrar.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_test_case_info.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_case_info.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_case_info.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_test_case_info.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_test_spec.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_spec.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_test_spec.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_test_spec.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_timer.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_timer.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_timer.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_timer.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_tostring.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tostring.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_tostring.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_tostring.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_totals.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_totals.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_totals.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_totals.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_translate_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_translate_exception.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_translate_exception.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_translate_exception.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/catch_version.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_version.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/catch_version.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/catch_version.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_assertion_handler.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_assertion_handler.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_assertion_handler.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_assertion_handler.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_clara.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_clara.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_commandline.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_commandline.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_commandline.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_commandline.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_console_colour.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_console_colour.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_console_colour.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_console_colour.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_context.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_context.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_context.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_context.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_debug_console.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debug_console.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debug_console.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_debug_console.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_debugger.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debugger.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_debugger.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_debugger.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_decomposer.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_decomposer.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_decomposer.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_decomposer.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_enforce.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enforce.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enforce.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enforce.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enum_values_registry.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_enum_values_registry.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_errno_guard.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_errno_guard.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_errno_guard.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_errno_guard.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_exception_translator_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_exception_translator_registry.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_fatal_condition_handler.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_fatal_condition_handler.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_floating_point_helpers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_floating_point_helpers.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_getenv.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_getenv.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_getenv.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_getenv.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_istream.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_istream.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_istream.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_istream.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_jsonwriter.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_jsonwriter.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_jsonwriter.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_jsonwriter.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_lazy_expr.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_lazy_expr.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_lazy_expr.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_lazy_expr.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_leak_detector.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_leak_detector.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_leak_detector.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_leak_detector.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_list.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_list.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_list.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_list.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_message_info.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_message_info.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_message_info.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_message_info.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_output_redirect.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_output_redirect.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_output_redirect.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_output_redirect.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_parse_numbers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_parse_numbers.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_parse_numbers.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_parse_numbers.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_polyfills.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_polyfills.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_polyfills.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_polyfills.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_random_number_generator.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_number_generator.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_number_generator.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_random_number_generator.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_random_seed_generation.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_seed_generation.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_random_seed_generation.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_random_seed_generation.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_registry.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_registry.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_registry.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_spec_parser.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_reporter_spec_parser.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_reusable_string_stream.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_reusable_string_stream.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_run_context.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_run_context.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_run_context.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_run_context.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_section.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_section.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_section.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_section.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_singletons.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_singletons.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_singletons.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_singletons.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_source_line_info.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_source_line_info.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_source_line_info.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_source_line_info.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_startup_exception_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_startup_exception_registry.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_stdstreams.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stdstreams.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stdstreams.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_stdstreams.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_string_manip.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_string_manip.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_string_manip.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_string_manip.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_stringref.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stringref.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_stringref.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_stringref.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_tag_alias_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_tag_alias_registry.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_info_hasher.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_info_hasher.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_registry_impl.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_registry_impl.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_tracker.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_tracker.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_case_tracker.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_case_tracker.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_failure_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_failure_exception.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_failure_exception.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_failure_exception.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_registry.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_registry.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_registry.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_registry.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_test_spec_parser.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_spec_parser.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_test_spec_parser.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_test_spec_parser.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_textflow.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_textflow.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_textflow.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_textflow.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_uncaught_exceptions.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_uncaught_exceptions.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_wildcard_pattern.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_wildcard_pattern.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_wildcard_pattern.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_wildcard_pattern.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/internal/catch_xmlwriter.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_xmlwriter.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_xmlwriter.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_xmlwriter.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_container_properties.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_container_properties.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_exception.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_exception.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_exception.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_exception.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_floating_point.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_floating_point.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_predicate.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_predicate.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_quantifiers.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_quantifiers.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_string.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_string.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_string.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_string.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_templated.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_templated.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/catch_matchers_templated.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_templated.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2.dir/catch2/matchers/internal/catch_matchers_impl.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2.dir/catch2/matchers/internal/catch_matchers_impl.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/external/Catch2/src", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -ffile-prefix-map=/home/runner/work/mstd/mstd/external/Catch2/= -o CMakeFiles/Catch2WithMain.dir/catch2/internal/catch_main.cpp.o -c /home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_main.cpp", - "file": "/home/runner/work/mstd/mstd/external/Catch2/src/catch2/internal/catch_main.cpp", - "output": "test/external/Catch2/src/CMakeFiles/Catch2WithMain.dir/catch2/internal/catch_main.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/math", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_math.dir/test_cpow.cpp.o -c /home/runner/work/mstd/mstd/test/math/test_cpow.cpp", - "file": "/home/runner/work/mstd/mstd/test/math/test_cpow.cpp", - "output": "test/math/CMakeFiles/mstd_tests_math.dir/test_cpow.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/physics", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_physics.dir/test_lie_potential.cpp.o -c /home/runner/work/mstd/mstd/test/physics/test_lie_potential.cpp", - "file": "/home/runner/work/mstd/mstd/test/physics/test_lie_potential.cpp", - "output": "test/physics/CMakeFiles/mstd_tests_physics.dir/test_lie_potential.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/quantity", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/compile_dummy.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/compile_dummy.cpp", - "file": "/home/runner/work/mstd/mstd/test/quantity/compile_dummy.cpp", - "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/compile_dummy.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/quantity", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/test_dimension.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/test_dimension.cpp", - "file": "/home/runner/work/mstd/mstd/test/quantity/test_dimension.cpp", - "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/test_dimension.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/quantity", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/test_quantity.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/test_quantity.cpp", - "file": "/home/runner/work/mstd/mstd/test/quantity/test_quantity.cpp", - "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/test_quantity.cpp.o" -}, -{ - "directory": "/home/runner/work/mstd/mstd/build/test/quantity", - "command": "/usr/bin/c++ -I/home/runner/work/mstd/mstd/include -I/home/runner/work/mstd/mstd/external/Catch2/src/catch2/.. -I/home/runner/work/mstd/mstd/build/test/external/Catch2/generated-includes -std=gnu++20 -o CMakeFiles/mstd_tests_quantity.dir/test_traits.cpp.o -c /home/runner/work/mstd/mstd/test/quantity/test_traits.cpp", - "file": "/home/runner/work/mstd/mstd/test/quantity/test_traits.cpp", - "output": "test/quantity/CMakeFiles/mstd_tests_quantity.dir/test_traits.cpp.o" -} -] \ No newline at end of file diff --git a/compile_commands.json b/compile_commands.json new file mode 120000 index 0000000..4503a4b --- /dev/null +++ b/compile_commands.json @@ -0,0 +1 @@ +.build/compile_commands.json \ No newline at end of file From 6c7338f4b713bfaa2784d81a6dd0d21719caba83 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:28:08 +0000 Subject: [PATCH 085/115] Add explicit permissions to static analysis workflow Co-authored-by: 97gamjak <77228802+97gamjak@users.noreply.github.com> --- .github/workflows/static-analysis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 7b53e1d..75053ce 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -6,6 +6,9 @@ on: - '*' workflow_dispatch: +permissions: + contents: read + jobs: cppcheck: runs-on: ubuntu-24.04 From c952138d89321ee90fbee4bf0f70b30751893b25 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 7 Dec 2025 22:34:11 +0100 Subject: [PATCH 086/115] Fix: cppcheck suppression for missing system includes --- .github/workflows/static-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 75053ce..11bf772 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -27,6 +27,7 @@ jobs: cppcheck --enable=all \ --error-exitcode=1 \ --suppressions-list=.cppcheck.suppress \ + --suppress=missingIncludeSystem \ --inline-suppr \ -I include \ include test From 5d455af7e4963b3df331ca9832d2b91db28416ab Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 7 Dec 2025 22:40:14 +0100 Subject: [PATCH 087/115] Fix: update .gitignore to include compile_commands.json and remove symlink --- .gitignore | 1 + compile_commands.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 120000 compile_commands.json diff --git a/.gitignore b/.gitignore index 2a23e7d..32cd6fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ checks.egg-info/ __pycache__/ .venv docs/output/ +compile_commands.json diff --git a/compile_commands.json b/compile_commands.json deleted file mode 120000 index 4503a4b..0000000 --- a/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -.build/compile_commands.json \ No newline at end of file From 55b9706b7f0f734ff346a2b948aa2b0ac0ed2c1d Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 10 Dec 2025 18:21:25 +0100 Subject: [PATCH 088/115] fix: Enhance static analysis configuration and add cppcheck script - Updated cppcheck configuration to enable additional checks for performance, style, information, and portability. - Refactored eval method in LiePotential class to use a protected _eval method for better encapsulation. - Added cppcheck suppression comments for syntax errors in enums.hpp. - Introduced a new cppcheck.sh script for running cppcheck with the updated configuration. --- .github/workflows/static-analysis.yml | 19 ++++++++------ .../mstd/physics/potentials/lie_potential.hpp | 25 +++++++++++++------ include/mstd/quantity/enums.hpp | 8 ++++-- scripts/cppcheck.sh | 12 +++++++++ 4 files changed, 48 insertions(+), 16 deletions(-) create mode 100755 scripts/cppcheck.sh diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 11bf772..d75da5d 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -25,12 +25,17 @@ jobs: - name: Run cppcheck run: | cppcheck --enable=all \ - --error-exitcode=1 \ - --suppressions-list=.cppcheck.suppress \ - --suppress=missingIncludeSystem \ - --inline-suppr \ - -I include \ - include test + --enable=performance \ + --enable=style \ + --enable=information \ + --enable=portability \ + --error-exitcode=1 \ + --suppressions-list=.cppcheck.suppress \ + --suppress=missingIncludeSystem \ + --inline-suppr \ + --inconclusive \ + -I include \ + include test clang-tidy: runs-on: ubuntu-24.04 @@ -55,4 +60,4 @@ jobs: - name: Run clang-tidy on include directory run: | - find include -name '*.hpp' | xargs -r clang-tidy -p . --warnings-as-errors='*' + find include -name '*.hpp' | xargs -r clang-tidy -p . --warnings-as-errors='*' --suppress=AnalyzeMacros diff --git a/include/mstd/physics/potentials/lie_potential.hpp b/include/mstd/physics/potentials/lie_potential.hpp index 6653dbe..4110e4a 100644 --- a/include/mstd/physics/potentials/lie_potential.hpp +++ b/include/mstd/physics/potentials/lie_potential.hpp @@ -45,9 +45,23 @@ namespace mstd Rep _coeff1{}; Rep _coeff2{}; + protected: + std::pair _eval(const Rep r) const + { + return liePotential(_coeff1, _coeff2, r); + } + public: - /// @brief Constructs the potential with prefactors for the attractive - /// and repulsive terms. + /** + * @brief Constructs the potential with prefactors for the attractive + * and repulsive terms. + * + * @note The coefficients correspond to the terms + * \f$-c_1 r^{-M} + c_2 r^{-N}\f$ in the potential expression. + * + * @param c1 Coefficient for the attractive term. + * @param c2 Coefficient for the repulsive term. + */ constexpr LiePotential(Rep c1, Rep c2) : _coeff1(c1), _coeff2(c2) {} /// @brief Evaluates only the potential energy at a distance @p r. @@ -64,10 +78,7 @@ namespace mstd } /// @brief Returns both energy and force evaluated at @p r. - virtual std::pair eval(const Rep r) const - { - return liePotential(_coeff1, _coeff2, r); - } + virtual std::pair eval(const Rep r) const { return _eval(r); } }; template @@ -96,7 +107,7 @@ namespace mstd constexpr LieShiftedPotential(Rep c1, Rep c2, Rep rc) : LiePotential(c1, c2), _radialCutoff(rc) { - std::tie(_energyCutoff, _forceCutoff) = eval(_radialCutoff); + std::tie(_energyCutoff, _forceCutoff) = _eval(_radialCutoff); } /// @brief Energy corrected so that it vanishes at the cutoff. diff --git a/include/mstd/quantity/enums.hpp b/include/mstd/quantity/enums.hpp index d44744f..8da1bba 100644 --- a/include/mstd/quantity/enums.hpp +++ b/include/mstd/quantity/enums.hpp @@ -54,7 +54,7 @@ namespace mstd X(Amount) \ X(Luminous) - MSTD_ENUM(SIDimId, size_t, SIDIMID_LIST) + MSTD_ENUM(SIDimId, size_t, SIDIMID_LIST) // cppcheck-suppress syntaxError /** * @brief Enumeration of the extra dimension IDs. @@ -72,7 +72,11 @@ namespace mstd X(Info) \ X(Count) - MSTD_ENUM(ExtraDimId, size_t, EXTRADIMID_LIST) + MSTD_ENUM( + ExtraDimId, + size_t, + EXTRADIMID_LIST + ) // cppcheck-suppress syntaxError // NOLINTEND } // namespace mstd diff --git a/scripts/cppcheck.sh b/scripts/cppcheck.sh new file mode 100755 index 0000000..94769a7 --- /dev/null +++ b/scripts/cppcheck.sh @@ -0,0 +1,12 @@ +cppcheck --enable=all \ + --enable=performance \ + --enable=style \ + --enable=information \ + --enable=portability \ + --error-exitcode=1 \ + --suppressions-list=.cppcheck.suppress \ + --suppress=missingIncludeSystem \ + --inline-suppr \ + --inconclusive \ + -I include \ + include test From 5ff87f38eff3fe889db97ff4e22f9a32dcc1fa15 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 19:09:20 +0100 Subject: [PATCH 089/115] feat: Add include guards to new compile.hpp; enhance error.hpp and quantity.hpp with warnings for buggy code - update test_cpow.cpp with GPL header --- include/mstd/compile.hpp | 34 +++++++++++++++++++++++++++++++++ include/mstd/error.hpp | 40 +++++++++++++++++++++++++++++++++------ include/mstd/quantity.hpp | 4 ++++ test/math/test_cpow.cpp | 22 +++++++++++++++++++++ 4 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 include/mstd/compile.hpp diff --git a/include/mstd/compile.hpp b/include/mstd/compile.hpp new file mode 100644 index 0000000..4762a15 --- /dev/null +++ b/include/mstd/compile.hpp @@ -0,0 +1,34 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + +#ifndef __MSTD_COMPILE_HPP__ +#define __MSTD_COMPILE_HPP__ + +// ignore the exact value of MSTD_IGNORE_BUGGY_CODE +#ifdef MSTD_IGNORE_BUGGY_CODE +#undef MSTD_IGNORE_BUGGY_CODE +#define MSTD_IGNORE_BUGGY_CODE 1 +#else +#define MSTD_IGNORE_BUGGY_CODE 0 +#endif + +#endif // __MSTD_COMPILE_HPP__ \ No newline at end of file diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index 4269b71..d635dd7 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -25,21 +25,49 @@ #include +#include "compile.hpp" + namespace mstd { - // clang-format off /** * @brief a struct that is always false - * - * @tparam T + * + * @tparam T */ template - struct always_false : std::false_type{}; - // clang-format on + struct always_false : std::false_type + { + }; } // namespace mstd #define MSTD_COMPILE_FAIL(msg) \ - static_assert(::mstd::always_false::value, msg) + static_assert(::mstd::always_false::value, msg); + +#define MSTD_WARN_BUGGY_LIBRARY(library_name) +#define MSTD_WARN_BUGGY_HEADER(header_file) + +#if !MSTD_IGNORE_BUGGY_CODE + +#undef MSTD_WARN_BUGGY_LIBRARY +#undef MSTD_WARN_BUGGY_HEADER + +#define MSTD_WARN_BUGGY_LIBRARY(library_name) \ + namespace mstd::buggy \ + { \ + [[deprecated("Buggy library: " library_name " — don't use it!")]] \ + inline int _ = 0; \ + inline int __ = _; \ + } // namespace mstd::buggy + +#define MSTD_WARN_BUGGY_HEADER(header_file) \ + namespace mstd::buggy \ + { \ + [[deprecated("Buggy header: " header_file " — don't use it!")]] \ + inline int _ = 0; \ + inline int __ = _; \ + } // namespace mstd::buggy + +#endif #endif // __MSTD_ERROR_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity.hpp b/include/mstd/quantity.hpp index bf51a41..1ada8cb 100644 --- a/include/mstd/quantity.hpp +++ b/include/mstd/quantity.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_HPP__ #define __MSTD_UNITS_HPP__ +#include "mstd/error.hpp" // IWYU pragma: export + +MSTD_WARN_BUGGY_LIBRARY("mstd/quantity.hpp") + #include "mstd/type_traits/quantity_traits.hpp" // IWYU pragma: export #include "quantity/dim.hpp" // IWYU pragma: export #include "quantity/dim_impl.hpp" // IWYU pragma: export diff --git a/test/math/test_cpow.cpp b/test/math/test_cpow.cpp index 1cfd182..d078eda 100644 --- a/test/math/test_cpow.cpp +++ b/test/math/test_cpow.cpp @@ -1,3 +1,25 @@ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + #include #include #include From e7f783908852f11c1cff0db61fb4c72b44e5ee2f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 19:28:15 +0100 Subject: [PATCH 090/115] Update include/mstd/error.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- include/mstd/error.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index d635dd7..effd07d 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -42,7 +42,7 @@ namespace mstd } // namespace mstd #define MSTD_COMPILE_FAIL(msg) \ - static_assert(::mstd::always_false::value, msg); + static_assert(::mstd::always_false::value, msg) #define MSTD_WARN_BUGGY_LIBRARY(library_name) #define MSTD_WARN_BUGGY_HEADER(header_file) From 84ff357fd560f2348702663c05336cd88ecc999a Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 19:28:46 +0100 Subject: [PATCH 091/115] Update include/mstd/error.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- include/mstd/error.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index effd07d..47cb76e 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -56,16 +56,16 @@ namespace mstd namespace mstd::buggy \ { \ [[deprecated("Buggy library: " library_name " — don't use it!")]] \ - inline int _ = 0; \ - inline int __ = _; \ + inline int buggy_marker = 0; \ + inline int buggy_marker_alias = buggy_marker; \ } // namespace mstd::buggy #define MSTD_WARN_BUGGY_HEADER(header_file) \ namespace mstd::buggy \ { \ [[deprecated("Buggy header: " header_file " — don't use it!")]] \ - inline int _ = 0; \ - inline int __ = _; \ + inline int buggy_marker = 0; \ + inline int buggy_marker_alias = buggy_marker; \ } // namespace mstd::buggy #endif From 3c59c27f8888115c6f1df614c4d13217a438a4f3 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 19:32:04 +0100 Subject: [PATCH 092/115] feat: Add documentation for MSTD_IGNORE_BUGGY_CODE macro and enhance warnings for buggy libraries and headers --- include/mstd/compile.hpp | 11 ++++++++++- include/mstd/error.hpp | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/mstd/compile.hpp b/include/mstd/compile.hpp index 4762a15..34c8b09 100644 --- a/include/mstd/compile.hpp +++ b/include/mstd/compile.hpp @@ -23,7 +23,16 @@ #ifndef __MSTD_COMPILE_HPP__ #define __MSTD_COMPILE_HPP__ -// ignore the exact value of MSTD_IGNORE_BUGGY_CODE +/** + * @brief Ignore buggy code + * + * Define this macro to ignore code that is known to be buggy in certain + * environments/libraries/compilers. + * + * @note at the moment the exact value of this macro does not matter + * as long as it is defined or not defined + * + */ #ifdef MSTD_IGNORE_BUGGY_CODE #undef MSTD_IGNORE_BUGGY_CODE #define MSTD_IGNORE_BUGGY_CODE 1 diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index d635dd7..11ff8bf 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -52,6 +52,9 @@ namespace mstd #undef MSTD_WARN_BUGGY_LIBRARY #undef MSTD_WARN_BUGGY_HEADER +/** + * @brief Warn about a buggy library + */ #define MSTD_WARN_BUGGY_LIBRARY(library_name) \ namespace mstd::buggy \ { \ @@ -60,6 +63,9 @@ namespace mstd inline int __ = _; \ } // namespace mstd::buggy +/** + * @brief Warn about a buggy header + */ #define MSTD_WARN_BUGGY_HEADER(header_file) \ namespace mstd::buggy \ { \ From d44a1524826a72907c8dbaebc590c75afb8cf420 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 19:35:07 +0100 Subject: [PATCH 093/115] docs: Update CHANGELOG.md to include new error handling and compilation flags for buggy code --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3381b6..63def98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ All notable changes to this project will be documented in this file. - Add "static inline constexpr" as key sequence order cpp rule - Add "update_changelog.py" script to update CHANGELOG.md automatically based on version input +### Error Handling + +- Add compile time warning macros for buggy libraries and buggy headers (used atm in quantity lib as long as it is not fixed) + +### Compilation + +- Add Compile flag `MSTD_IGNORE_BUGGY_CODE` to ignore any kind of warnings for buggy libraries or headers + ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From 0bce8191f0a4513bbbed1a30f654c6022c494a49 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 20:11:51 +0100 Subject: [PATCH 094/115] refactor: rename mstd_checks to devosp --- {checks => devops}/.gitignore | 0 {checks => devops}/.python-version | 0 {checks => devops}/README.md | 0 {checks => devops}/pyproject.toml | 8 ++-- devops/src/devops.egg-info/PKG-INFO | 9 ++++ devops/src/devops.egg-info/SOURCES.txt | 29 +++++++++++++ .../src/devops.egg-info/dependency_links.txt | 1 + devops/src/devops.egg-info/entry_points.txt | 3 ++ devops/src/devops.egg-info/requires.txt | 3 ++ devops/src/devops.egg-info/top_level.txt | 1 + .../checks => devops/src/devops}/__init__.py | 0 .../src/devops}/cpp/__init__.py | 0 .../src/devops}/cpp/style_rules.py | 6 +-- .../src/devops}/enums/__init__.py | 0 .../src/devops}/enums/base.py | 0 .../src/devops}/files/__init__.py | 0 .../src/devops}/files/config.py | 0 .../src/devops}/files/files.py | 0 .../src/devops}/files/update_changelog.py | 7 +-- .../checks => devops/src/devops}/github.py | 0 .../src/devops}/logger/__init__.py | 0 .../src/devops}/logger/logger.py | 0 .../checks => devops/src/devops}/ruff.toml | 0 .../src/devops}/rules/__init__.py | 0 .../src/devops}/rules/result_type.py | 0 .../src/devops}/rules/rules.py | 4 +- .../src/devops}/scripts/__init__.py | 0 .../src/devops}/scripts/cpp_checks.py | 8 ++-- .../src/devops}/scripts/update_changelog.py | 7 +-- .../src/devops}/utils/__init__.py | 0 .../src/devops}/utils/rich.py | 0 .../src/devops}/utils/utils.py | 6 +-- {checks => devops}/tests/__init__.py | 0 {checks => devops}/tests/cpp/__init__.py | 0 .../tests/cpp/test_style_rules.py | 12 +++--- {checks => devops}/tests/files/__init__.py | 0 {checks => devops}/tests/files/test_files.py | 3 +- .../tests/files/test_update_changelog.py | 23 +++++----- {checks => devops}/tests/rules/__init__.py | 0 {checks => devops}/tests/rules/test_rules.py | 4 +- {checks => devops}/tests/scripts/__init__.py | 0 .../tests/scripts/test_cpp_checks.py | 43 ++++++++++--------- {checks => devops}/tests/utils/__init__.py | 0 {checks => devops}/tests/utils/test_utils.py | 4 +- {checks => devops}/uv.lock | 0 45 files changed, 118 insertions(+), 63 deletions(-) rename {checks => devops}/.gitignore (100%) rename {checks => devops}/.python-version (100%) rename {checks => devops}/README.md (100%) rename {checks => devops}/pyproject.toml (60%) create mode 100644 devops/src/devops.egg-info/PKG-INFO create mode 100644 devops/src/devops.egg-info/SOURCES.txt create mode 100644 devops/src/devops.egg-info/dependency_links.txt create mode 100644 devops/src/devops.egg-info/entry_points.txt create mode 100644 devops/src/devops.egg-info/requires.txt create mode 100644 devops/src/devops.egg-info/top_level.txt rename {checks/src/checks => devops/src/devops}/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/cpp/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/cpp/style_rules.py (84%) rename {checks/src/checks => devops/src/devops}/enums/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/enums/base.py (100%) rename {checks/src/checks => devops/src/devops}/files/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/files/config.py (100%) rename {checks/src/checks => devops/src/devops}/files/files.py (100%) rename {checks/src/checks => devops/src/devops}/files/update_changelog.py (91%) rename {checks/src/checks => devops/src/devops}/github.py (100%) rename {checks/src/checks => devops/src/devops}/logger/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/logger/logger.py (100%) rename {checks/src/checks => devops/src/devops}/ruff.toml (100%) rename {checks/src/checks => devops/src/devops}/rules/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/rules/result_type.py (100%) rename {checks/src/checks => devops/src/devops}/rules/rules.py (98%) rename {checks/src/checks => devops/src/devops}/scripts/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/scripts/cpp_checks.py (93%) rename {checks/src/checks => devops/src/devops}/scripts/update_changelog.py (80%) rename {checks/src/checks => devops/src/devops}/utils/__init__.py (100%) rename {checks/src/checks => devops/src/devops}/utils/rich.py (100%) rename {checks/src/checks => devops/src/devops}/utils/utils.py (94%) rename {checks => devops}/tests/__init__.py (100%) rename {checks => devops}/tests/cpp/__init__.py (100%) rename {checks => devops}/tests/cpp/test_style_rules.py (97%) rename {checks => devops}/tests/files/__init__.py (100%) rename {checks => devops}/tests/files/test_files.py (91%) rename {checks => devops}/tests/files/test_update_changelog.py (93%) rename {checks => devops}/tests/rules/__init__.py (100%) rename {checks => devops}/tests/rules/test_rules.py (99%) rename {checks => devops}/tests/scripts/__init__.py (100%) rename {checks => devops}/tests/scripts/test_cpp_checks.py (87%) rename {checks => devops}/tests/utils/__init__.py (100%) rename {checks => devops}/tests/utils/test_utils.py (97%) rename {checks => devops}/uv.lock (100%) diff --git a/checks/.gitignore b/devops/.gitignore similarity index 100% rename from checks/.gitignore rename to devops/.gitignore diff --git a/checks/.python-version b/devops/.python-version similarity index 100% rename from checks/.python-version rename to devops/.python-version diff --git a/checks/README.md b/devops/README.md similarity index 100% rename from checks/README.md rename to devops/README.md diff --git a/checks/pyproject.toml b/devops/pyproject.toml similarity index 60% rename from checks/pyproject.toml rename to devops/pyproject.toml index 70c5cb6..1849a8f 100644 --- a/checks/pyproject.toml +++ b/devops/pyproject.toml @@ -1,11 +1,11 @@ [project] -name = "checks" -version = "0.1.0" +name = "devops" +version = "0.0.1" description = "This package handles commit and CI checks for mstd" readme = "README.md" requires-python = ">=3.12" dependencies = ["pytest>=9.0.1", "ruff>=0.14.6", "typer>=0.20.0"] [project.scripts] -cpp_checks = "checks.scripts.cpp_checks:main" -update_changelog = "checks.scripts.update_changelog:app" +cpp_checks = "devops.scripts.cpp_checks:main" +update_changelog = "devops.scripts.update_changelog:app" diff --git a/devops/src/devops.egg-info/PKG-INFO b/devops/src/devops.egg-info/PKG-INFO new file mode 100644 index 0000000..b528ff4 --- /dev/null +++ b/devops/src/devops.egg-info/PKG-INFO @@ -0,0 +1,9 @@ +Metadata-Version: 2.4 +Name: devops +Version: 0.0.1 +Summary: This package handles commit and CI checks for mstd +Requires-Python: >=3.12 +Description-Content-Type: text/markdown +Requires-Dist: pytest>=9.0.1 +Requires-Dist: ruff>=0.14.6 +Requires-Dist: typer>=0.20.0 diff --git a/devops/src/devops.egg-info/SOURCES.txt b/devops/src/devops.egg-info/SOURCES.txt new file mode 100644 index 0000000..25c0642 --- /dev/null +++ b/devops/src/devops.egg-info/SOURCES.txt @@ -0,0 +1,29 @@ +README.md +pyproject.toml +src/devops/__init__.py +src/devops/github.py +src/devops.egg-info/PKG-INFO +src/devops.egg-info/SOURCES.txt +src/devops.egg-info/dependency_links.txt +src/devops.egg-info/entry_points.txt +src/devops.egg-info/requires.txt +src/devops.egg-info/top_level.txt +src/devops/cpp/__init__.py +src/devops/cpp/style_rules.py +src/devops/enums/__init__.py +src/devops/enums/base.py +src/devops/files/__init__.py +src/devops/files/config.py +src/devops/files/files.py +src/devops/files/update_changelog.py +src/devops/logger/__init__.py +src/devops/logger/logger.py +src/devops/rules/__init__.py +src/devops/rules/result_type.py +src/devops/rules/rules.py +src/devops/scripts/__init__.py +src/devops/scripts/cpp_checks.py +src/devops/scripts/update_changelog.py +src/devops/utils/__init__.py +src/devops/utils/rich.py +src/devops/utils/utils.py \ No newline at end of file diff --git a/devops/src/devops.egg-info/dependency_links.txt b/devops/src/devops.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/devops/src/devops.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/devops/src/devops.egg-info/entry_points.txt b/devops/src/devops.egg-info/entry_points.txt new file mode 100644 index 0000000..e38502a --- /dev/null +++ b/devops/src/devops.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +cpp_checks = devops.scripts.cpp_checks:main +update_changelog = devops.scripts.update_changelog:app diff --git a/devops/src/devops.egg-info/requires.txt b/devops/src/devops.egg-info/requires.txt new file mode 100644 index 0000000..c59dfdd --- /dev/null +++ b/devops/src/devops.egg-info/requires.txt @@ -0,0 +1,3 @@ +pytest>=9.0.1 +ruff>=0.14.6 +typer>=0.20.0 diff --git a/devops/src/devops.egg-info/top_level.txt b/devops/src/devops.egg-info/top_level.txt new file mode 100644 index 0000000..e18b651 --- /dev/null +++ b/devops/src/devops.egg-info/top_level.txt @@ -0,0 +1 @@ +devops diff --git a/checks/src/checks/__init__.py b/devops/src/devops/__init__.py similarity index 100% rename from checks/src/checks/__init__.py rename to devops/src/devops/__init__.py diff --git a/checks/src/checks/cpp/__init__.py b/devops/src/devops/cpp/__init__.py similarity index 100% rename from checks/src/checks/cpp/__init__.py rename to devops/src/devops/cpp/__init__.py diff --git a/checks/src/checks/cpp/style_rules.py b/devops/src/devops/cpp/style_rules.py similarity index 84% rename from checks/src/checks/cpp/style_rules.py rename to devops/src/devops/cpp/style_rules.py index e5caae0..015a3d8 100644 --- a/checks/src/checks/cpp/style_rules.py +++ b/devops/src/devops/cpp/style_rules.py @@ -1,7 +1,7 @@ -"""C++ rules for mstd checks.""" +"""C++ rules for mstd devops.""" -from checks.rules import Rule, RuleInputType, RuleType -from checks.utils import check_key_sequence_ordered +from devops.rules import Rule, RuleInputType, RuleType +from devops.utils import check_key_sequence_ordered class CheckKeySeqOrder(Rule): diff --git a/checks/src/checks/enums/__init__.py b/devops/src/devops/enums/__init__.py similarity index 100% rename from checks/src/checks/enums/__init__.py rename to devops/src/devops/enums/__init__.py diff --git a/checks/src/checks/enums/base.py b/devops/src/devops/enums/base.py similarity index 100% rename from checks/src/checks/enums/base.py rename to devops/src/devops/enums/base.py diff --git a/checks/src/checks/files/__init__.py b/devops/src/devops/files/__init__.py similarity index 100% rename from checks/src/checks/files/__init__.py rename to devops/src/devops/files/__init__.py diff --git a/checks/src/checks/files/config.py b/devops/src/devops/files/config.py similarity index 100% rename from checks/src/checks/files/config.py rename to devops/src/devops/files/config.py diff --git a/checks/src/checks/files/files.py b/devops/src/devops/files/files.py similarity index 100% rename from checks/src/checks/files/files.py rename to devops/src/devops/files/files.py diff --git a/checks/src/checks/files/update_changelog.py b/devops/src/devops/files/update_changelog.py similarity index 91% rename from checks/src/checks/files/update_changelog.py rename to devops/src/devops/files/update_changelog.py index 04cce7b..39547d4 100644 --- a/checks/src/checks/files/update_changelog.py +++ b/devops/src/devops/files/update_changelog.py @@ -4,8 +4,8 @@ from datetime import UTC, datetime from pathlib import Path -from checks.files.files import MSTDFileNotFoundError -from checks.github import get_github_repo +from devops.files.files import MSTDFileNotFoundError +from devops.github import get_github_repo from .config import __DEFAULT_ENCODING__ @@ -74,4 +74,5 @@ def update_changelog(version: str, changelog_path: Path = __CHANGELOG_PATH__) -> msg = "Could not find '## Next Release' in CHANGELOG.md" raise MSTDChangelogError(msg) - changelog_path.write_text("".join(updated) + "\n", encoding=__DEFAULT_ENCODING__) + changelog_path.write_text("".join(updated) + "\n", + encoding=__DEFAULT_ENCODING__) diff --git a/checks/src/checks/github.py b/devops/src/devops/github.py similarity index 100% rename from checks/src/checks/github.py rename to devops/src/devops/github.py diff --git a/checks/src/checks/logger/__init__.py b/devops/src/devops/logger/__init__.py similarity index 100% rename from checks/src/checks/logger/__init__.py rename to devops/src/devops/logger/__init__.py diff --git a/checks/src/checks/logger/logger.py b/devops/src/devops/logger/logger.py similarity index 100% rename from checks/src/checks/logger/logger.py rename to devops/src/devops/logger/logger.py diff --git a/checks/src/checks/ruff.toml b/devops/src/devops/ruff.toml similarity index 100% rename from checks/src/checks/ruff.toml rename to devops/src/devops/ruff.toml diff --git a/checks/src/checks/rules/__init__.py b/devops/src/devops/rules/__init__.py similarity index 100% rename from checks/src/checks/rules/__init__.py rename to devops/src/devops/rules/__init__.py diff --git a/checks/src/checks/rules/result_type.py b/devops/src/devops/rules/result_type.py similarity index 100% rename from checks/src/checks/rules/result_type.py rename to devops/src/devops/rules/result_type.py diff --git a/checks/src/checks/rules/rules.py b/devops/src/devops/rules/rules.py similarity index 98% rename from checks/src/checks/rules/rules.py rename to devops/src/devops/rules/rules.py index 9e033cb..654655e 100644 --- a/checks/src/checks/rules/rules.py +++ b/devops/src/devops/rules/rules.py @@ -3,8 +3,8 @@ import typing -from checks.enums import StrEnum -from checks.files import FileType +from devops.enums import StrEnum +from devops.files import FileType if typing.TYPE_CHECKING: from collections.abc import Callable diff --git a/checks/src/checks/scripts/__init__.py b/devops/src/devops/scripts/__init__.py similarity index 100% rename from checks/src/checks/scripts/__init__.py rename to devops/src/devops/scripts/__init__.py diff --git a/checks/src/checks/scripts/cpp_checks.py b/devops/src/devops/scripts/cpp_checks.py similarity index 93% rename from checks/src/checks/scripts/cpp_checks.py rename to devops/src/devops/scripts/cpp_checks.py index 825bfb9..220e6bd 100644 --- a/checks/src/checks/scripts/cpp_checks.py +++ b/devops/src/devops/scripts/cpp_checks.py @@ -3,15 +3,15 @@ import sys from pathlib import Path -from checks.cpp import cpp_rules -from checks.files import ( +from devops.cpp import cpp_rules +from devops.files import ( __EXECUTION_DIR__, determine_file_type, get_files_in_dirs, get_staged_files, ) -from checks.logger import cpp_check_logger -from checks.rules import ResultType, ResultTypeEnum, Rule, filter_line_rules +from devops.logger import cpp_check_logger +from devops.rules import ResultType, ResultTypeEnum, Rule, filter_line_rules __CPP_DIRS__ = ["include", "test"] __OTHER_DIRS__ = ["scripts"] diff --git a/checks/src/checks/scripts/update_changelog.py b/devops/src/devops/scripts/update_changelog.py similarity index 80% rename from checks/src/checks/scripts/update_changelog.py rename to devops/src/devops/scripts/update_changelog.py index 132adbe..8e257b7 100644 --- a/checks/src/checks/scripts/update_changelog.py +++ b/devops/src/devops/scripts/update_changelog.py @@ -4,9 +4,9 @@ import typer -from checks.files import update_changelog -from checks.files.update_changelog import MSTDChangelogError -from checks.utils import mstd_print +from devops.files import update_changelog +from devops.files.update_changelog import MSTDChangelogError +from devops.utils import mstd_print app = typer.Typer() @@ -28,5 +28,6 @@ def main(version: str) -> None: mstd_print(f"❌ Error updating changelog: {e}") sys.exit(1) + if __name__ == "__main__": app() diff --git a/checks/src/checks/utils/__init__.py b/devops/src/devops/utils/__init__.py similarity index 100% rename from checks/src/checks/utils/__init__.py rename to devops/src/devops/utils/__init__.py diff --git a/checks/src/checks/utils/rich.py b/devops/src/devops/utils/rich.py similarity index 100% rename from checks/src/checks/utils/rich.py rename to devops/src/devops/utils/rich.py diff --git a/checks/src/checks/utils/utils.py b/devops/src/devops/utils/utils.py similarity index 94% rename from checks/src/checks/utils/utils.py rename to devops/src/devops/utils/utils.py index f89340a..8493d05 100644 --- a/checks/src/checks/utils/utils.py +++ b/devops/src/devops/utils/utils.py @@ -4,9 +4,9 @@ import typing -from checks.github import __MSTD_ISSUES_PAGE__ -from checks.logger import utils_logger -from checks.rules import ResultType, ResultTypeEnum +from devops.github import __MSTD_ISSUES_PAGE__ +from devops.logger import utils_logger +from devops.rules import ResultType, ResultTypeEnum if typing.TYPE_CHECKING: from typing import Any diff --git a/checks/tests/__init__.py b/devops/tests/__init__.py similarity index 100% rename from checks/tests/__init__.py rename to devops/tests/__init__.py diff --git a/checks/tests/cpp/__init__.py b/devops/tests/cpp/__init__.py similarity index 100% rename from checks/tests/cpp/__init__.py rename to devops/tests/cpp/__init__.py diff --git a/checks/tests/cpp/test_style_rules.py b/devops/tests/cpp/test_style_rules.py similarity index 97% rename from checks/tests/cpp/test_style_rules.py rename to devops/tests/cpp/test_style_rules.py index ad3081b..58ed8be 100644 --- a/checks/tests/cpp/test_style_rules.py +++ b/devops/tests/cpp/test_style_rules.py @@ -1,8 +1,8 @@ """Unit tests for C++ style rules.""" -from checks.cpp.style_rules import CheckKeySeqOrder, cpp_style_rules, rule01 -from checks.files import FileType -from checks.rules import ResultTypeEnum, Rule, RuleInputType, RuleType +from devops.cpp.style_rules import CheckKeySeqOrder, cpp_style_rules, rule01 +from devops.files import FileType +from devops.rules import ResultTypeEnum, Rule, RuleInputType, RuleType class TestCheckKeySeqOrder: @@ -172,7 +172,8 @@ def test_static_inline_constexpr_wrong_order(self): ] for line in test_cases: result = rule.apply(line) - assert result.value == ResultTypeEnum.Error, f"Expected Error for: {line}" + assert result.value == ResultTypeEnum.Error, f"Expected Error for: { + line}" def test_static_inline_constexpr_partial_present(self): """Test lines with only some keywords present.""" @@ -186,7 +187,8 @@ def test_static_inline_constexpr_partial_present(self): ] for line in test_cases: result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: {line}" + assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: { + line}" def test_rule01_exists_and_configured(self): """Test that rule01 is properly configured.""" diff --git a/checks/tests/files/__init__.py b/devops/tests/files/__init__.py similarity index 100% rename from checks/tests/files/__init__.py rename to devops/tests/files/__init__.py diff --git a/checks/tests/files/test_files.py b/devops/tests/files/test_files.py similarity index 91% rename from checks/tests/files/test_files.py rename to devops/tests/files/test_files.py index 5d74f56..9a1e64c 100644 --- a/checks/tests/files/test_files.py +++ b/devops/tests/files/test_files.py @@ -1,6 +1,7 @@ """Unit tests for file-related functionality in mstd checks.""" -from checks.files import FileType +from devops.files import FileType + def test_all_types(): diff --git a/checks/tests/files/test_update_changelog.py b/devops/tests/files/test_update_changelog.py similarity index 93% rename from checks/tests/files/test_update_changelog.py rename to devops/tests/files/test_update_changelog.py index a0b9adf..26e2b6e 100644 --- a/checks/tests/files/test_update_changelog.py +++ b/devops/tests/files/test_update_changelog.py @@ -5,8 +5,8 @@ import pytest -from checks.files.files import MSTDFileNotFoundError -from checks.files.update_changelog import ( +from devops.files.files import MSTDFileNotFoundError +from devops.files.update_changelog import ( MSTDChangelogError, __CHANGELOG_INSERTION_MARKER__, update_changelog, @@ -31,7 +31,7 @@ def test_changelog_error_is_exception(self): class TestUpdateChangelog: """Tests for update_changelog function.""" - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_success(self, mock_get_repo, tmp_path): """Test successful changelog update with new version.""" mock_get_repo.return_value = "https://github.com/test/repo" @@ -62,7 +62,7 @@ def test_update_changelog_success(self, mock_get_repo, tmp_path): new_version_pos = content.find("## [1.1.0]") assert next_release_pos < marker_pos < new_version_pos - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_with_date(self, mock_get_repo, tmp_path): """Test that changelog entry includes today's date.""" mock_get_repo.return_value = "https://github.com/test/repo" @@ -82,7 +82,8 @@ def test_update_changelog_with_date(self, mock_get_repo, tmp_path): content = changelog.read_text() today = datetime.now(tz=UTC).date().isoformat() - assert f"## [2.0.0](https://github.com/test/repo/releases/tag/2.0.0) - {today}" in content + assert f"## [2.0.0](https://github.com/test/repo/releases/tag/2.0.0) - { + today}" in content def test_update_changelog_file_not_found(self, tmp_path): """Test that MSTDFileNotFoundError is raised when file doesn't exist.""" @@ -93,7 +94,7 @@ def test_update_changelog_file_not_found(self, tmp_path): assert exc_info.value.filepath == non_existent - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_missing_next_release(self, mock_get_repo, tmp_path): """Test that MSTDChangelogError is raised when Next Release marker missing.""" mock_get_repo.return_value = "https://github.com/test/repo" @@ -112,7 +113,7 @@ def test_update_changelog_missing_next_release(self, mock_get_repo, tmp_path): assert "Next Release" in exc_info.value.message - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_removes_old_marker(self, mock_get_repo, tmp_path): """Test that old insertion marker is removed and new one is placed.""" mock_get_repo.return_value = "https://github.com/test/repo" @@ -142,7 +143,7 @@ def test_update_changelog_removes_old_marker(self, mock_get_repo, tmp_path): marker_pos = content.find(__CHANGELOG_INSERTION_MARKER__) assert next_release_pos < marker_pos - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_no_existing_marker(self, mock_get_repo, tmp_path): """Test changelog update when no insertion marker exists.""" mock_get_repo.return_value = "https://github.com/test/repo" @@ -164,7 +165,7 @@ def test_update_changelog_no_existing_marker(self, mock_get_repo, tmp_path): assert __CHANGELOG_INSERTION_MARKER__ in content assert "## [1.1.0]" in content - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_preserves_content(self, mock_get_repo, tmp_path): """Test that changelog update preserves existing content.""" mock_get_repo.return_value = "https://github.com/test/repo" @@ -205,7 +206,7 @@ def test_update_changelog_preserves_content(self, mock_get_repo, tmp_path): assert "- Initial release" in content assert "## [1.0.0]" in content - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_next_release_regex_variations( self, mock_get_repo, tmp_path ): @@ -229,7 +230,7 @@ def test_update_changelog_next_release_regex_variations( content = changelog.read_text() assert "## [1.0.0]" in content - @patch("checks.files.update_changelog.get_github_repo") + @patch("devops.files.update_changelog.get_github_repo") def test_update_changelog_empty_next_release(self, mock_get_repo, tmp_path): """Test changelog update when Next Release section is empty.""" mock_get_repo.return_value = "https://github.com/test/repo" diff --git a/checks/tests/rules/__init__.py b/devops/tests/rules/__init__.py similarity index 100% rename from checks/tests/rules/__init__.py rename to devops/tests/rules/__init__.py diff --git a/checks/tests/rules/test_rules.py b/devops/tests/rules/test_rules.py similarity index 99% rename from checks/tests/rules/test_rules.py rename to devops/tests/rules/test_rules.py index 27e73c1..a48ece5 100644 --- a/checks/tests/rules/test_rules.py +++ b/devops/tests/rules/test_rules.py @@ -1,7 +1,7 @@ """Unit tests for Rule class and related functionality.""" -from checks.files import FileType -from checks.rules import ( +from devops.files import FileType +from devops.rules import ( ResultType, ResultTypeEnum, Rule, diff --git a/checks/tests/scripts/__init__.py b/devops/tests/scripts/__init__.py similarity index 100% rename from checks/tests/scripts/__init__.py rename to devops/tests/scripts/__init__.py diff --git a/checks/tests/scripts/test_cpp_checks.py b/devops/tests/scripts/test_cpp_checks.py similarity index 87% rename from checks/tests/scripts/test_cpp_checks.py rename to devops/tests/scripts/test_cpp_checks.py index d5b37ed..4b690aa 100644 --- a/checks/tests/scripts/test_cpp_checks.py +++ b/devops/tests/scripts/test_cpp_checks.py @@ -2,9 +2,9 @@ from unittest.mock import patch -from checks.files import FileType -from checks.rules import ResultType, ResultTypeEnum, Rule, RuleInputType, RuleType -from checks.scripts.cpp_checks import main, run_checks, run_line_checks +from devops.files import FileType +from devops.rules import ResultType, ResultTypeEnum, Rule, RuleInputType, RuleType +from devops.scripts.cpp_checks import main, run_checks, run_line_checks class TestRunLineChecks: @@ -38,7 +38,8 @@ def test_run_line_checks_with_non_matching_file_type(self, tmp_path): rule = Rule( name="cpp_only_rule", - func=lambda line: ResultType(ResultTypeEnum.Error, "Should not run"), + func=lambda line: ResultType( + ResultTypeEnum.Error, "Should not run"), rule_type=RuleType.CPP_STYLE, rule_input_type=RuleInputType.LINE, file_types={FileType.CPPSource}, @@ -96,7 +97,8 @@ def test_run_line_checks_filters_non_line_rules(self, tmp_path): ) file_rule = Rule( name="file_rule", - func=lambda line: ResultType(ResultTypeEnum.Error, "Should not run"), + func=lambda line: ResultType( + ResultTypeEnum.Error, "Should not run"), rule_type=RuleType.CPP_STYLE, rule_input_type=RuleInputType.FILE, ) @@ -137,8 +139,8 @@ def setup_method(self): Rule.cpp_style_rule_counter = 0 Rule.general_rule_counter = 0 - @patch("checks.scripts.cpp_checks.get_staged_files") - @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("devops.scripts.cpp_checks.get_staged_files") + @patch("devops.scripts.cpp_checks.cpp_check_logger") def test_run_checks_no_files(self, mock_logger, mock_get_staged): """Test run_checks logs warning when no files to check.""" mock_get_staged.return_value = [] @@ -155,8 +157,8 @@ def test_run_checks_no_files(self, mock_logger, mock_get_staged): mock_logger.warning.assert_called_once_with("No files to check.") - @patch("checks.scripts.cpp_checks.get_staged_files") - @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("devops.scripts.cpp_checks.get_staged_files") + @patch("devops.scripts.cpp_checks.cpp_check_logger") def test_run_checks_staged_mode(self, mock_logger, mock_get_staged, tmp_path): """Test run_checks in staged files mode.""" test_file = tmp_path / "test.cpp" @@ -174,10 +176,11 @@ def test_run_checks_staged_mode(self, mock_logger, mock_get_staged, tmp_path): with patch.object(Rule, "general_rule_counter", 0): run_checks([rule]) - mock_logger.info.assert_called_with("Running checks on staged files...") + mock_logger.info.assert_called_with( + "Running checks on staged files...") - @patch("checks.scripts.cpp_checks.get_files_in_dirs") - @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("devops.scripts.cpp_checks.get_files_in_dirs") + @patch("devops.scripts.cpp_checks.cpp_check_logger") @patch("sys.argv", ["cpp_checks", "full"]) def test_run_checks_full_mode(self, mock_logger, mock_get_files, tmp_path): """Test run_checks in full mode.""" @@ -198,8 +201,8 @@ def test_run_checks_full_mode(self, mock_logger, mock_get_files, tmp_path): mock_logger.info.assert_called_with("Running full checks...") - @patch("checks.scripts.cpp_checks.get_staged_files") - @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("devops.scripts.cpp_checks.get_staged_files") + @patch("devops.scripts.cpp_checks.cpp_check_logger") def test_run_checks_with_errors(self, mock_logger, mock_get_staged, tmp_path): """Test run_checks logs errors when rule fails.""" test_file = tmp_path / "test.cpp" @@ -219,8 +222,8 @@ def test_run_checks_with_errors(self, mock_logger, mock_get_staged, tmp_path): assert mock_logger.error.called - @patch("checks.scripts.cpp_checks.get_staged_files") - @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("devops.scripts.cpp_checks.get_staged_files") + @patch("devops.scripts.cpp_checks.cpp_check_logger") def test_run_checks_stops_on_first_file_with_errors( self, mock_logger, mock_get_staged, tmp_path ): @@ -260,17 +263,17 @@ def setup_method(self): Rule.cpp_style_rule_counter = 0 Rule.general_rule_counter = 0 - @patch("checks.scripts.cpp_checks.run_checks") + @patch("devops.scripts.cpp_checks.run_checks") def test_main_calls_run_checks(self, mock_run_checks): """Test main function calls run_checks with cpp_rules.""" - from checks.cpp import cpp_rules + from devops.cpp import cpp_rules main() mock_run_checks.assert_called_once_with(cpp_rules) - @patch("checks.scripts.cpp_checks.get_staged_files") - @patch("checks.scripts.cpp_checks.cpp_check_logger") + @patch("devops.scripts.cpp_checks.get_staged_files") + @patch("devops.scripts.cpp_checks.cpp_check_logger") def test_main_integration(self, mock_logger, mock_get_staged, tmp_path): """Test main function integration.""" test_file = tmp_path / "test.cpp" diff --git a/checks/tests/utils/__init__.py b/devops/tests/utils/__init__.py similarity index 100% rename from checks/tests/utils/__init__.py rename to devops/tests/utils/__init__.py diff --git a/checks/tests/utils/test_utils.py b/devops/tests/utils/test_utils.py similarity index 97% rename from checks/tests/utils/test_utils.py rename to devops/tests/utils/test_utils.py index 897e359..f953e41 100644 --- a/checks/tests/utils/test_utils.py +++ b/devops/tests/utils/test_utils.py @@ -1,5 +1,5 @@ -from checks.utils import check_key_sequence_ordered -from checks.rules import ResultTypeEnum +from devops.utils import check_key_sequence_ordered +from devops.rules import ResultTypeEnum def test_check_key_sequence_ordered(): diff --git a/checks/uv.lock b/devops/uv.lock similarity index 100% rename from checks/uv.lock rename to devops/uv.lock From 2ccfb50e499860dcdc1d928c151dcfd8c810b03e Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 20:14:09 +0100 Subject: [PATCH 095/115] docs: update section title from MSTD-CHECKS to DevOps in CHANGELOG.md and reflect change of package name --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3381b6..85cdd96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file. ## Next Release -### MSTD-CHECKS +### DevOps -- Add checks python library first version for all kind of custom static code analysis +- Add devops python library first version for all kind of custom static code analysis - Add "static inline constexpr" as key sequence order cpp rule - Add "update_changelog.py" script to update CHANGELOG.md automatically based on version input From d46da7614d2d5b3d2959313448b0a03b68223562 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Thu, 11 Dec 2025 21:13:41 +0100 Subject: [PATCH 096/115] refactor: extracting devops to separate package --- devops/.gitignore | 6 - devops/.python-version | 1 - devops/README.md | 0 devops/pyproject.toml | 11 - devops/src/devops.egg-info/PKG-INFO | 9 - devops/src/devops.egg-info/SOURCES.txt | 29 -- .../src/devops.egg-info/dependency_links.txt | 1 - devops/src/devops.egg-info/entry_points.txt | 3 - devops/src/devops.egg-info/requires.txt | 3 - devops/src/devops.egg-info/top_level.txt | 1 - devops/src/devops/__init__.py | 7 - devops/src/devops/cpp/__init__.py | 6 - devops/src/devops/cpp/style_rules.py | 33 -- devops/src/devops/enums/__init__.py | 5 - devops/src/devops/enums/base.py | 22 -- devops/src/devops/files/__init__.py | 15 - devops/src/devops/files/config.py | 3 - devops/src/devops/files/files.py | 150 --------- devops/src/devops/files/update_changelog.py | 78 ----- devops/src/devops/github.py | 32 -- devops/src/devops/logger/__init__.py | 5 - devops/src/devops/logger/logger.py | 21 -- devops/src/devops/ruff.toml | 11 - devops/src/devops/rules/__init__.py | 18 -- devops/src/devops/rules/result_type.py | 26 -- devops/src/devops/rules/rules.py | 180 ----------- devops/src/devops/scripts/__init__.py | 1 - devops/src/devops/scripts/cpp_checks.py | 97 ------ devops/src/devops/scripts/update_changelog.py | 33 -- devops/src/devops/utils/__init__.py | 7 - devops/src/devops/utils/rich.py | 5 - devops/src/devops/utils/utils.py | 96 ------ devops/tests/__init__.py | 1 - devops/tests/cpp/__init__.py | 1 - devops/tests/cpp/test_style_rules.py | 256 ---------------- devops/tests/files/__init__.py | 1 - devops/tests/files/test_files.py | 17 -- devops/tests/files/test_update_changelog.py | 253 ---------------- devops/tests/rules/__init__.py | 1 - devops/tests/rules/test_rules.py | 259 ---------------- devops/tests/scripts/__init__.py | 1 - devops/tests/scripts/test_cpp_checks.py | 285 ------------------ devops/tests/utils/__init__.py | 1 - devops/tests/utils/test_utils.py | 88 ------ devops/uv.lock | 186 ------------ 45 files changed, 2265 deletions(-) delete mode 100644 devops/.gitignore delete mode 100644 devops/.python-version delete mode 100644 devops/README.md delete mode 100644 devops/pyproject.toml delete mode 100644 devops/src/devops.egg-info/PKG-INFO delete mode 100644 devops/src/devops.egg-info/SOURCES.txt delete mode 100644 devops/src/devops.egg-info/dependency_links.txt delete mode 100644 devops/src/devops.egg-info/entry_points.txt delete mode 100644 devops/src/devops.egg-info/requires.txt delete mode 100644 devops/src/devops.egg-info/top_level.txt delete mode 100644 devops/src/devops/__init__.py delete mode 100644 devops/src/devops/cpp/__init__.py delete mode 100644 devops/src/devops/cpp/style_rules.py delete mode 100644 devops/src/devops/enums/__init__.py delete mode 100644 devops/src/devops/enums/base.py delete mode 100644 devops/src/devops/files/__init__.py delete mode 100644 devops/src/devops/files/config.py delete mode 100644 devops/src/devops/files/files.py delete mode 100644 devops/src/devops/files/update_changelog.py delete mode 100644 devops/src/devops/github.py delete mode 100644 devops/src/devops/logger/__init__.py delete mode 100644 devops/src/devops/logger/logger.py delete mode 100644 devops/src/devops/ruff.toml delete mode 100644 devops/src/devops/rules/__init__.py delete mode 100644 devops/src/devops/rules/result_type.py delete mode 100644 devops/src/devops/rules/rules.py delete mode 100644 devops/src/devops/scripts/__init__.py delete mode 100644 devops/src/devops/scripts/cpp_checks.py delete mode 100644 devops/src/devops/scripts/update_changelog.py delete mode 100644 devops/src/devops/utils/__init__.py delete mode 100644 devops/src/devops/utils/rich.py delete mode 100644 devops/src/devops/utils/utils.py delete mode 100644 devops/tests/__init__.py delete mode 100644 devops/tests/cpp/__init__.py delete mode 100644 devops/tests/cpp/test_style_rules.py delete mode 100644 devops/tests/files/__init__.py delete mode 100644 devops/tests/files/test_files.py delete mode 100644 devops/tests/files/test_update_changelog.py delete mode 100644 devops/tests/rules/__init__.py delete mode 100644 devops/tests/rules/test_rules.py delete mode 100644 devops/tests/scripts/__init__.py delete mode 100644 devops/tests/scripts/test_cpp_checks.py delete mode 100644 devops/tests/utils/__init__.py delete mode 100644 devops/tests/utils/test_utils.py delete mode 100644 devops/uv.lock diff --git a/devops/.gitignore b/devops/.gitignore deleted file mode 100644 index 7f92207..0000000 --- a/devops/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -__pycache__ -*.pyc -.ruff_cache -.venv/ -dist/ -build/ diff --git a/devops/.python-version b/devops/.python-version deleted file mode 100644 index e4fba21..0000000 --- a/devops/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.12 diff --git a/devops/README.md b/devops/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/devops/pyproject.toml b/devops/pyproject.toml deleted file mode 100644 index 1849a8f..0000000 --- a/devops/pyproject.toml +++ /dev/null @@ -1,11 +0,0 @@ -[project] -name = "devops" -version = "0.0.1" -description = "This package handles commit and CI checks for mstd" -readme = "README.md" -requires-python = ">=3.12" -dependencies = ["pytest>=9.0.1", "ruff>=0.14.6", "typer>=0.20.0"] - -[project.scripts] -cpp_checks = "devops.scripts.cpp_checks:main" -update_changelog = "devops.scripts.update_changelog:app" diff --git a/devops/src/devops.egg-info/PKG-INFO b/devops/src/devops.egg-info/PKG-INFO deleted file mode 100644 index b528ff4..0000000 --- a/devops/src/devops.egg-info/PKG-INFO +++ /dev/null @@ -1,9 +0,0 @@ -Metadata-Version: 2.4 -Name: devops -Version: 0.0.1 -Summary: This package handles commit and CI checks for mstd -Requires-Python: >=3.12 -Description-Content-Type: text/markdown -Requires-Dist: pytest>=9.0.1 -Requires-Dist: ruff>=0.14.6 -Requires-Dist: typer>=0.20.0 diff --git a/devops/src/devops.egg-info/SOURCES.txt b/devops/src/devops.egg-info/SOURCES.txt deleted file mode 100644 index 25c0642..0000000 --- a/devops/src/devops.egg-info/SOURCES.txt +++ /dev/null @@ -1,29 +0,0 @@ -README.md -pyproject.toml -src/devops/__init__.py -src/devops/github.py -src/devops.egg-info/PKG-INFO -src/devops.egg-info/SOURCES.txt -src/devops.egg-info/dependency_links.txt -src/devops.egg-info/entry_points.txt -src/devops.egg-info/requires.txt -src/devops.egg-info/top_level.txt -src/devops/cpp/__init__.py -src/devops/cpp/style_rules.py -src/devops/enums/__init__.py -src/devops/enums/base.py -src/devops/files/__init__.py -src/devops/files/config.py -src/devops/files/files.py -src/devops/files/update_changelog.py -src/devops/logger/__init__.py -src/devops/logger/logger.py -src/devops/rules/__init__.py -src/devops/rules/result_type.py -src/devops/rules/rules.py -src/devops/scripts/__init__.py -src/devops/scripts/cpp_checks.py -src/devops/scripts/update_changelog.py -src/devops/utils/__init__.py -src/devops/utils/rich.py -src/devops/utils/utils.py \ No newline at end of file diff --git a/devops/src/devops.egg-info/dependency_links.txt b/devops/src/devops.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/devops/src/devops.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/devops/src/devops.egg-info/entry_points.txt b/devops/src/devops.egg-info/entry_points.txt deleted file mode 100644 index e38502a..0000000 --- a/devops/src/devops.egg-info/entry_points.txt +++ /dev/null @@ -1,3 +0,0 @@ -[console_scripts] -cpp_checks = devops.scripts.cpp_checks:main -update_changelog = devops.scripts.update_changelog:app diff --git a/devops/src/devops.egg-info/requires.txt b/devops/src/devops.egg-info/requires.txt deleted file mode 100644 index c59dfdd..0000000 --- a/devops/src/devops.egg-info/requires.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=9.0.1 -ruff>=0.14.6 -typer>=0.20.0 diff --git a/devops/src/devops.egg-info/top_level.txt b/devops/src/devops.egg-info/top_level.txt deleted file mode 100644 index e18b651..0000000 --- a/devops/src/devops.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -devops diff --git a/devops/src/devops/__init__.py b/devops/src/devops/__init__.py deleted file mode 100644 index 2f5cd90..0000000 --- a/devops/src/devops/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Top level package for mstd checks.""" - -from pathlib import Path - -__BASE_DIR__ = Path(__file__).resolve().parent.parent - -__all__ = ["__BASE_DIR__"] diff --git a/devops/src/devops/cpp/__init__.py b/devops/src/devops/cpp/__init__.py deleted file mode 100644 index de38dd3..0000000 --- a/devops/src/devops/cpp/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Package defining C++ check rules.""" - -from .style_rules import cpp_style_rules - -cpp_rules = cpp_style_rules -__all__ = ["cpp_rules"] diff --git a/devops/src/devops/cpp/style_rules.py b/devops/src/devops/cpp/style_rules.py deleted file mode 100644 index 015a3d8..0000000 --- a/devops/src/devops/cpp/style_rules.py +++ /dev/null @@ -1,33 +0,0 @@ -"""C++ rules for mstd devops.""" - -from devops.rules import Rule, RuleInputType, RuleType -from devops.utils import check_key_sequence_ordered - - -class CheckKeySeqOrder(Rule): - """Rule to check that a specific key sequence appears only in a given order.""" - - def __init__(self, key_sequence: str) -> None: - """Initialize CheckKeySeqOrder with the given key sequence. - - Parameters - ---------- - key_sequence: str - The key sequence to check. - - """ - super().__init__( - name=key_sequence, - func=lambda line: check_key_sequence_ordered( - key_sequence, - line - ), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - description=f'Use "{key_sequence}" only in this given order.' - ) - - -rule01 = CheckKeySeqOrder("static inline constexpr") - -cpp_style_rules = [rule01] diff --git a/devops/src/devops/enums/__init__.py b/devops/src/devops/enums/__init__.py deleted file mode 100644 index 5d116e5..0000000 --- a/devops/src/devops/enums/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Top level package for enums in mstd checks.""" - -from .base import StrEnum - -__all__ = ["StrEnum"] diff --git a/devops/src/devops/enums/base.py b/devops/src/devops/enums/base.py deleted file mode 100644 index 62b9daa..0000000 --- a/devops/src/devops/enums/base.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Base enumerations for mstd checks.""" - -from __future__ import annotations - -from enum import Enum - - -class StrEnum(Enum): - """Base class for string enumerations.""" - - def __str__(self) -> str: - """Return the string representation of the enumeration value.""" - return self.value.upper() - - @classmethod - def _missing_(cls, value: object) -> StrEnum | None: - """Handle missing enumeration values in a case-insensitive manner.""" - if isinstance(value, str): - for member in cls: - if member.value.upper() == value.upper(): - return member - return None diff --git a/devops/src/devops/files/__init__.py b/devops/src/devops/files/__init__.py deleted file mode 100644 index da756dc..0000000 --- a/devops/src/devops/files/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Top level package for file operations in mstd checks.""" - -from pathlib import Path - -from .files import FileType, determine_file_type, get_files_in_dirs, get_staged_files - -__EXECUTION_DIR__ = Path.cwd() - -__all__ = [ - "__EXECUTION_DIR__", - "FileType", - "determine_file_type", - "get_files_in_dirs", - "get_staged_files" -] diff --git a/devops/src/devops/files/config.py b/devops/src/devops/files/config.py deleted file mode 100644 index 30323a0..0000000 --- a/devops/src/devops/files/config.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Module for configurations settings for mstd file operations.""" - -__DEFAULT_ENCODING__ = "utf-8" diff --git a/devops/src/devops/files/files.py b/devops/src/devops/files/files.py deleted file mode 100644 index d00c985..0000000 --- a/devops/src/devops/files/files.py +++ /dev/null @@ -1,150 +0,0 @@ -"""Module for file operations in mstd checks.""" - -from __future__ import annotations - -import subprocess -import typing -from enum import Enum -from pathlib import Path - -if typing.TYPE_CHECKING: - from collections.abc import Iterable - - -class MSTDFileNotFoundError(Exception): - """Exception raised when a specified file is not found.""" - - def __init__(self, filepath: Path) -> None: - """Initialize the exception with the missing file path.""" - super().__init__(f"File not found: {filepath}") - self.filepath = filepath - - -class FileType(Enum): - """Enumeration of file types for mstd checks.""" - - UNKNOWN = 0 - CPPHeader = 1 - CPPSource = 2 - CMakeLists = 3 - - @classmethod - def all_types(cls) -> set[FileType]: - """Get a set of all defined file types. - - Returns - ------- - set[FileType]: - A set containing all file types. - - """ - return set(cls) - - @classmethod - def cpp_types(cls) -> set[FileType]: - """Get a set of all CPP related file types.""" - return {FileType.CPPHeader, FileType.CPPSource} - - -def determine_file_type(filename: str | Path) -> FileType: - """Determine the file type based on the filename extension. - - Parameters - ---------- - filename: str | Path - The name of the file to check. - - Returns - ------- - FileType: - The determined file type. - - """ - filename = str(filename) - - if filename.endswith((".h", ".hpp")): - return FileType.CPPHeader - if filename.endswith((".cpp", ".cxx", ".cc", ".c")): - return FileType.CPPSource - if filename == "CMakeLists.txt": - return FileType.CMakeLists - - return FileType.UNKNOWN - - -def get_files_in_dirs( - paths: Iterable[Path], - exclude_dirs: list[str] | None = None, - exclude_files: list[str] | None = None, - max_recursion: int = 20 -) -> list[Path]: - """Get all files in the specified directories. - - Parameters - ---------- - paths: Iterable[Path] - List of directory paths to search for files. - exclude_dirs: list[str] | None - List of directory names to exclude from the search. Defaults to None. - exclude_files: list[str] | None - List of file names to exclude from the search. Defaults to None. - max_recursion: int - Number of maximum recursion through dirs to avoid infinite recursion, - default 20 - - Returns - ------- - list[Path]: - List of file paths found in the specified directories. - - """ - if exclude_dirs is None: - exclude_dirs = [] - - if exclude_files is None: - exclude_files = [] - - all_files = [] - - if max_recursion == 0: - return all_files - - for path in paths: - if path.is_dir() and path.name not in exclude_dirs: - all_files.extend( - get_files_in_dirs( - path.iterdir(), - exclude_dirs, - exclude_files, - max_recursion - 1 - ) - ) - elif path.is_file() and path.name not in exclude_files: - all_files.append(path) - - return all_files - - -def get_staged_files() -> list[Path]: - """Get the list of staged files in the git repository. - - Returns - ------- - list[Path]: - List of staged file paths. - - Raises - ------ - subprocess.CalledProcessError - If the git command fails. - - """ - result = subprocess.run( - ["git", "diff", "--name-only", "--cached"], - capture_output=True, - text=True, - check=True - ) - - files = result.stdout.strip().split("\n") - return [Path(file) for file in files if file] diff --git a/devops/src/devops/files/update_changelog.py b/devops/src/devops/files/update_changelog.py deleted file mode 100644 index 39547d4..0000000 --- a/devops/src/devops/files/update_changelog.py +++ /dev/null @@ -1,78 +0,0 @@ -"""Module for updating the changelog file.""" - -import re -from datetime import UTC, datetime -from pathlib import Path - -from devops.files.files import MSTDFileNotFoundError -from devops.github import get_github_repo - -from .config import __DEFAULT_ENCODING__ - -__CHANGELOG_PATH__ = Path("CHANGELOG.md") -__CHANGELOG_INSERTION_MARKER__ = "" - - -class MSTDChangelogError(Exception): - """Base class for changelog related errors.""" - - def __init__(self, message: str) -> None: - """Initialize the exception with a message.""" - super().__init__(f"MSTDChangelogError: {message}") - self.message = message - - -def update_changelog(version: str, changelog_path: Path = __CHANGELOG_PATH__) -> None: - """Update the changelog file with a new version entry. - - Parameters - ---------- - version: str - The new version to add to the changelog. - changelog_path: Path - The path to the changelog file. - - Raises - ------ - MSTDFileNotFoundError - If the changelog file does not exist. - MSTDChangelogError - If the "## Next Release" marker is not found in the changelog. - - """ - if not changelog_path.is_file(): - raise MSTDFileNotFoundError(changelog_path) - - with changelog_path.open("r", encoding=__DEFAULT_ENCODING__) as f: - content = f.readlines() - - repo = get_github_repo() - today = datetime.now(tz=UTC).date().isoformat() - new_entry = f"## [{version}]({repo}/releases/tag/{version}) - {today}" - - updated = [] - marker_moved = False - - for line in content: - # Find the "## Next Release" heading - if not marker_moved and re.match(r"^##\s+Next Release", line): - # Ensure marker comes right after "Next Release" - # For formatting consistency, add newline characters to all appended lines - updated.append(line + "\n") - updated.append(__CHANGELOG_INSERTION_MARKER__ + "\n") - updated.append(new_entry + "\n") - marker_moved = True - - # Skip the old insertion marker wherever it was - elif __CHANGELOG_INSERTION_MARKER__ in line: - continue - - else: - updated.append(line) - - if not marker_moved: - msg = "Could not find '## Next Release' in CHANGELOG.md" - raise MSTDChangelogError(msg) - - changelog_path.write_text("".join(updated) + "\n", - encoding=__DEFAULT_ENCODING__) diff --git a/devops/src/devops/github.py b/devops/src/devops/github.py deleted file mode 100644 index 2bcf588..0000000 --- a/devops/src/devops/github.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Module for GitHub-related constants and functions.""" - -import os - -__GITHUB_REPO__ = "https://github.com" -__MSTD_GITHUB_REPO__ = "https://github.com/97gamjak/mstd" -__MSTD_ISSUES_PAGE__ = f"{__MSTD_GITHUB_REPO__}/issues" - - -class MSTDGithubError(Exception): - """Exception raised for GitHub-related errors in mstd checks.""" - - def __init__(self, message: str) -> None: - """Initialize the exception with a message.""" - super().__init__(f"MSTDGithubError: {message}") - self.message = message - - -def get_github_repo() -> str: - """Get the current GitHub repository URL. - - Returns - ------- - str - The GitHub repository URL. - - """ - repo = os.getenv("GITHUB_REPOSITORY", "repo/owner") - # TODO(97gamjak): centralize env logic if needed elsewhere - # https://github.com/97gamjak/mstd/issues/26 - - return f"{__GITHUB_REPO__}/{repo}" diff --git a/devops/src/devops/logger/__init__.py b/devops/src/devops/logger/__init__.py deleted file mode 100644 index f3b21b2..0000000 --- a/devops/src/devops/logger/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Top level package for logger in mstd checks.""" - -from .logger import cpp_check_logger, utils_logger - -__all__ = ["cpp_check_logger", "utils_logger"] diff --git a/devops/src/devops/logger/logger.py b/devops/src/devops/logger/logger.py deleted file mode 100644 index e4d985b..0000000 --- a/devops/src/devops/logger/logger.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Module initializing logger for mstd checks.""" -import logging -import os - -__DEBUG_MSTD_CHECKS__ = os.getenv("DEBUG_MSTD_CHECKS", "0") -__DEBUG_MSTD_UTILS__ = os.getenv("DEBUG_MSTD_UTILS", "0") - -# TODO(97gamjak): centralize env logic if needed elsewhere -# https://github.com/97gamjak/mstd/issues/26 -if int(__DEBUG_MSTD_CHECKS__) > 0: - logging.basicConfig(level=logging.DEBUG) -else: - logging.basicConfig(level=logging.INFO) - -cpp_check_logger = logging.getLogger("mstd_cpp_checks") -utils_logger = logging.getLogger("mstd_utils") - -if int(__DEBUG_MSTD_UTILS__) > 0: - utils_logger.setLevel(logging.DEBUG) -else: - utils_logger.setLevel(logging.INFO) diff --git a/devops/src/devops/ruff.toml b/devops/src/devops/ruff.toml deleted file mode 100644 index e2b672d..0000000 --- a/devops/src/devops/ruff.toml +++ /dev/null @@ -1,11 +0,0 @@ -[lint] -select = ["ALL"] -ignore = [ - "D203", # blank line before docstring of class (conflict with other rule) - "D213", # multiline summary second line (conflict with other rule) - "COM812", # trailing comma missing (conflict with other rule) - "FIX002", # missing TODO - already solved by other rules which force linking author and github issue - "S607", # relative paths are not allowed by this rule in subprocess commands - "ANN401", # allow Any type annotations for now -] -pylint.max-args = 6 \ No newline at end of file diff --git a/devops/src/devops/rules/__init__.py b/devops/src/devops/rules/__init__.py deleted file mode 100644 index 046e47e..0000000 --- a/devops/src/devops/rules/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Top level package for rules in mstd checks.""" -from .result_type import ResultType, ResultTypeEnum -from .rules import ( - Rule, - RuleInputType, - RuleType, - filter_cpp_rules, - filter_line_rules, -) - -__all__ = ["ResultType", "ResultTypeEnum"] -__all__ += [ - "Rule", - "RuleInputType", - "RuleType", - "filter_cpp_rules", - "filter_line_rules", -] diff --git a/devops/src/devops/rules/result_type.py b/devops/src/devops/rules/result_type.py deleted file mode 100644 index c448ba3..0000000 --- a/devops/src/devops/rules/result_type.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Module defining result types for mstd checks.""" - -from __future__ import annotations - -from enum import Enum - - -class ResultTypeEnum(Enum): - """Enumeration of result types for mstd checks.""" - - Ok = "ok" - Warning = "warning" - Error = "error" - - -class ResultType: - """Class representing the result of a mstd type check.""" - - def __init__( - self, - value: ResultTypeEnum, - description: str | None = None - ) -> None: - """Initialize ResultType with a value and optional description.""" - self.value = value - self.description = description diff --git a/devops/src/devops/rules/rules.py b/devops/src/devops/rules/rules.py deleted file mode 100644 index 654655e..0000000 --- a/devops/src/devops/rules/rules.py +++ /dev/null @@ -1,180 +0,0 @@ -"""Module defining rules for mstd checks.""" -from __future__ import annotations - -import typing - -from devops.enums import StrEnum -from devops.files import FileType - -if typing.TYPE_CHECKING: - from collections.abc import Callable - - from .result_type import ResultType - - -class RuleType(StrEnum): - """Enumeration of rule types for mstd checks.""" - - GENERAL = "GENERAL" - CPP_STYLE = "CPP_STYLE" - - @classmethod - def cpp_rules(cls) -> set[RuleType]: - """Get a set of C++ related rule types. - - Returns - ------- - set[RuleType] - A set containing the C++ related rule types. - - """ - return {RuleType.CPP_STYLE} - - -class RuleInputType(StrEnum): - """Enumeration of rule input types for mstd checks.""" - - NONE = "NONE" - LINE = "LINE" - FILE = "FILE" - - -class Rule: - """Base class for defining a rule.""" - - cpp_style_rule_counter = 0 - general_rule_counter = 0 - - @classmethod - def increment_rule_counter(cls, rule_type: RuleType) -> tuple[str, int]: - """Increment the rule counter based on the rule type. - - Parameters - ---------- - rule_type: RuleType - The type of the rule. - - Returns - ------- - tuple[str, int] - A string representing the rule type and the updated counter. - - Raises - ------ - ValueError - If the rule type is unknown. - - """ - if rule_type == RuleType.CPP_STYLE: - return "STYLE", cls.increment_style_rule_counter() - - if rule_type == RuleType.GENERAL: - return "GENERAL", cls.increment_general_rule_counter() - - msg = f"Unknown rule type: {rule_type}" - raise ValueError(msg) - - @classmethod - def increment_style_rule_counter(cls) -> int: - """Increment the C++ style rule counter. - - Returns - ------- - int - The updated C++ style rule counter. - - """ - cls.cpp_style_rule_counter += 1 - return cls.cpp_style_rule_counter - - @classmethod - def increment_general_rule_counter(cls) -> int: - """Increment the general rule counter. - - Returns - ------- - int - The updated general rule counter. - - """ - cls.general_rule_counter += 1 - return cls.general_rule_counter - - def __init__( - self, - name: str, - func: Callable, - rule_type: RuleType = RuleType.GENERAL, - rule_input_type: RuleInputType = RuleInputType.NONE, - file_types: set[FileType] | None = None, - description: str | None = None - ) -> None: - """Initialize Rule with a name and optional description.""" - self.name = name - self.description = description - self.func = func - self.rule_type = rule_type - self.rule_input_type = rule_input_type - - if file_types is None and rule_type == RuleType.CPP_STYLE: - # use only cpp file types if user gives explicit CPP_STYLE rule - file_types = FileType.cpp_types() - elif file_types is None: - file_types = FileType.all_types() - - self.file_types = file_types - - self.rule_identifier = Rule.increment_rule_counter(rule_type) - - def apply(self, args: tuple) -> ResultType: - """Apply the rule on a specific line. - - Parameters - ---------- - args: tuple - The arguments to pass to the rule function. - - Returns - ------- - ResultType - The result of applying the rule. - - """ - if isinstance(args, str): - args = (args,) - - return self.func(*args) if args else self.func() - - -def filter_cpp_rules(rules: list[Rule]) -> list[Rule]: - """Filter and return only C++ related rules. - - Parameters - ---------- - rules: list[Rule] - The list of rules to filter. - - Returns - ------- - list[Rule] - A list of C++ related rules. - - """ - return [rule for rule in rules if rule.rule_type in RuleType.cpp_rules()] - - -def filter_line_rules(rules: list[Rule]) -> list[Rule]: - """Filter and return only line related rules. - - Parameters - ---------- - rules: list[Rule] - The list of rules to filter. - - Returns - ------- - list[Rule] - A list of line related rules. - - """ - return [rule for rule in rules if rule.rule_input_type == RuleInputType.LINE] diff --git a/devops/src/devops/scripts/__init__.py b/devops/src/devops/scripts/__init__.py deleted file mode 100644 index 458a2da..0000000 --- a/devops/src/devops/scripts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Top level package for script operations in mstd checks.""" diff --git a/devops/src/devops/scripts/cpp_checks.py b/devops/src/devops/scripts/cpp_checks.py deleted file mode 100644 index 220e6bd..0000000 --- a/devops/src/devops/scripts/cpp_checks.py +++ /dev/null @@ -1,97 +0,0 @@ -"""Module defining C++ check rules.""" - -import sys -from pathlib import Path - -from devops.cpp import cpp_rules -from devops.files import ( - __EXECUTION_DIR__, - determine_file_type, - get_files_in_dirs, - get_staged_files, -) -from devops.logger import cpp_check_logger -from devops.rules import ResultType, ResultTypeEnum, Rule, filter_line_rules - -__CPP_DIRS__ = ["include", "test"] -__OTHER_DIRS__ = ["scripts"] -__EXCLUDE_DIRS__ = ["__pycache__", ".ruff_cache"] -__EXCLUDE_FILES__ = [".gitignore"] - -__DIRS__ = __CPP_DIRS__ + __OTHER_DIRS__ - - -def run_line_checks(rules: list[Rule], file: Path) -> list[ResultType]: - """Run line-based C++ checks on a given file. - - Parameters - ---------- - rules: list[Rule] - The list of rules to apply. - file: Path - The file to check. - - Returns - ------- - list[ResultType] - The list of results from the checks. - - """ - results = [] - file_type = determine_file_type(file) - - with Path(file).open("r", encoding="utf-8") as f: - line_rules = filter_line_rules(rules) - for line in f: - for rule in line_rules: - if file_type not in rule.file_types: - continue - - results.append(rule.apply(line)) - - return results - - -def run_checks(rules: list[Rule]) -> None: - """Run C++ checks based on the provided rules. - - Returns immediately after encountering the first file with errors. - - Parameters - ---------- - rules: list[Rule] - The list of rules to apply. - - """ - if "full" in sys.argv: - cpp_check_logger.info("Running full checks...") - cpp_check_logger.debug(f"Checking directories: {__DIRS__}") - dirs = [__EXECUTION_DIR__ / dir_name for dir_name in __DIRS__] - files = get_files_in_dirs(dirs, __EXCLUDE_DIRS__, __EXCLUDE_FILES__) - else: - cpp_check_logger.info("Running checks on staged files...") - files = get_staged_files() - - if not files: - cpp_check_logger.warning("No files to check.") - return - - for filename in files: - cpp_check_logger.debug(f"Checking file: {filename}") - file_results = run_line_checks(rules, filename) - if any(result.value != ResultTypeEnum.Ok for result in file_results): - filtered_results = [ - res - for res in file_results - if res.value != ResultTypeEnum.Ok - ] - for res in filtered_results: - cpp_check_logger.error( - f"Line check result in {filename}: {res.description}" - ) - return - - -def main() -> None: - """Run C++ checks.""" - run_checks(cpp_rules) diff --git a/devops/src/devops/scripts/update_changelog.py b/devops/src/devops/scripts/update_changelog.py deleted file mode 100644 index 8e257b7..0000000 --- a/devops/src/devops/scripts/update_changelog.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Script for updating the changelog file.""" - -import sys - -import typer - -from devops.files import update_changelog -from devops.files.update_changelog import MSTDChangelogError -from devops.utils import mstd_print - -app = typer.Typer() - - -@app.command() -def main(version: str) -> None: - """Update the changelog file with a new version entry. - - Parameters - ---------- - version: str - The new version to add to the changelog. - - """ - try: - update_changelog.update_changelog(version) - mstd_print(f"✅ CHANGELOG.md updated for version {version}") - except MSTDChangelogError as e: - mstd_print(f"❌ Error updating changelog: {e}") - sys.exit(1) - - -if __name__ == "__main__": - app() diff --git a/devops/src/devops/utils/__init__.py b/devops/src/devops/utils/__init__.py deleted file mode 100644 index be10864..0000000 --- a/devops/src/devops/utils/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Top level package for utility functions in mstd checks.""" - -from .rich import mstd_print -from .utils import check_key_sequence_ordered - -__all__ = ["check_key_sequence_ordered"] -__all__ += ["mstd_print"] diff --git a/devops/src/devops/utils/rich.py b/devops/src/devops/utils/rich.py deleted file mode 100644 index edf8a2d..0000000 --- a/devops/src/devops/utils/rich.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Utility module for rich text printing.""" - -from rich import print as mstd_print - -__all__ = ["mstd_print"] diff --git a/devops/src/devops/utils/utils.py b/devops/src/devops/utils/utils.py deleted file mode 100644 index 8493d05..0000000 --- a/devops/src/devops/utils/utils.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Module defining utility functions for mstd checks.""" - -from __future__ import annotations - -import typing - -from devops.github import __MSTD_ISSUES_PAGE__ -from devops.logger import utils_logger -from devops.rules import ResultType, ResultTypeEnum - -if typing.TYPE_CHECKING: - from typing import Any - - -def find_indices(list_to_search: list[Any], element: Any) -> list[int]: - """Find all indices of an element in a list. - - Parameters - ---------- - list_to_search: list[Any] - The list to search through. - element: Any - The element to find in the list. - - Returns - ------- - list[int] - A list of indices where the element is found. - - """ - return [index for index, value in enumerate(list_to_search) if value == element] - - -def check_key_sequence_ordered( - key_sequence: str, - line: str, - key_delimiter: str = " " -) -> ResultType: - """Check if keys in key_sequence appear in order on the given line. - - Parameters - ---------- - key_sequence: str - The sequence of keys to check for order as a string. - line: str - The line of text to check. - key_delimiter: str - The delimiter used to find the keys. - - Returns - ------- - ResultType: - Result of the check, Error if keys are out of order, Ok otherwise - - """ - key_sequence = key_sequence.split(key_delimiter) - line_elements = line.split(key_delimiter) - - # If not all keys are present, return Ok - if set(key_sequence).intersection(set(line_elements)) != set(key_sequence): - return ResultType(ResultTypeEnum.Ok) - - indices = [ - find_indices(line_elements, key) - for key in key_sequence - ] - - if len(indices) != len(key_sequence): - msg = f"Expected {len(key_sequence)} indices, but got {len(indices)}. " - msg += "This indicates an internal error. " - msg += f"Please report this issue at {__MSTD_ISSUES_PAGE__}." - raise ValueError(msg) - - found_indices = 0 - for index in indices[0]: - found_indices = 1 - for i in range(1, len(indices)): - if index + i in indices[i]: - found_indices += 1 - continue - break - - if found_indices == len(key_sequence): - utils_logger.debug( - "All keys from key_sequence %s are present " - "in line %s and ordered correctly.", - key_sequence, - line - ) - return ResultType(ResultTypeEnum.Ok) - - return ResultType( - ResultTypeEnum.Error, - f"key_sequence {key_sequence} not ordered correctly " - f"in line {line}." - ) diff --git a/devops/tests/__init__.py b/devops/tests/__init__.py deleted file mode 100644 index 6cf7a62..0000000 --- a/devops/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Top level package for tests in mstd checks.""" diff --git a/devops/tests/cpp/__init__.py b/devops/tests/cpp/__init__.py deleted file mode 100644 index 004410d..0000000 --- a/devops/tests/cpp/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Test module for C++ style rules.""" diff --git a/devops/tests/cpp/test_style_rules.py b/devops/tests/cpp/test_style_rules.py deleted file mode 100644 index 58ed8be..0000000 --- a/devops/tests/cpp/test_style_rules.py +++ /dev/null @@ -1,256 +0,0 @@ -"""Unit tests for C++ style rules.""" - -from devops.cpp.style_rules import CheckKeySeqOrder, cpp_style_rules, rule01 -from devops.files import FileType -from devops.rules import ResultTypeEnum, Rule, RuleInputType, RuleType - - -class TestCheckKeySeqOrder: - """Tests for CheckKeySeqOrder rule.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_check_key_seq_order_creation(self): - """Test CheckKeySeqOrder rule creation.""" - rule = CheckKeySeqOrder("static inline constexpr") - assert rule.name == "static inline constexpr" - assert rule.rule_type == RuleType.CPP_STYLE - assert rule.rule_input_type == RuleInputType.LINE - assert rule.description == 'Use "static inline constexpr" only in this given order.' - assert rule.file_types == FileType.cpp_types() - - def test_check_key_seq_order_correct_order(self): - """Test CheckKeySeqOrder returns Ok for correct order.""" - rule = CheckKeySeqOrder("static inline constexpr") - line = "static inline constexpr int x = 42;" - result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok - - def test_check_key_seq_order_incorrect_order(self): - """Test CheckKeySeqOrder returns Error for incorrect order.""" - rule = CheckKeySeqOrder("static inline constexpr") - line = "inline static constexpr int x = 42;" - result = rule.apply(line) - assert result.value == ResultTypeEnum.Error - - def test_check_key_seq_order_missing_keys(self): - """Test CheckKeySeqOrder returns Ok when keys are missing.""" - rule = CheckKeySeqOrder("static inline constexpr") - line = "int x = 42;" - result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok - - def test_check_key_seq_order_partial_keys(self): - """Test CheckKeySeqOrder returns Ok when only some keys are present.""" - rule = CheckKeySeqOrder("static inline constexpr") - line = "static int x = 42;" - result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok - - def test_check_key_seq_order_different_sequence(self): - """Test CheckKeySeqOrder with different key sequence.""" - rule = CheckKeySeqOrder("const int") - line = "const int x = 42;" - result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok - - line = "int const x = 42;" - result = rule.apply(line) - assert result.value == ResultTypeEnum.Error - - def test_rule_initialization(self): - """Test that CheckKeySeqOrder is initialized correctly.""" - rule = CheckKeySeqOrder("static inline constexpr") - - assert rule.name == "static inline constexpr" - assert rule.rule_type == RuleType.CPP_STYLE - assert rule.rule_input_type == RuleInputType.LINE - assert rule.description == 'Use "static inline constexpr" only in this given order.' - - def test_rule_initialization_custom_key_sequence(self): - """Test CheckKeySeqOrder with a different key sequence.""" - rule = CheckKeySeqOrder("const static") - - assert rule.name == "const static" - assert rule.rule_type == RuleType.CPP_STYLE - assert rule.rule_input_type == RuleInputType.LINE - assert rule.description == 'Use "const static" only in this given order.' - - def test_apply_correct_order(self): - """Test that rule passes when keys are in correct order.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("static inline constexpr int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - def test_apply_incorrect_order(self): - """Test that rule fails when keys are out of order.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("inline static constexpr int x = 42;") - - assert result.value == ResultTypeEnum.Error - - def test_apply_partial_keys_present(self): - """Test that rule passes when only some keys are present.""" - rule = CheckKeySeqOrder("static inline constexpr") - # Only "static" and "constexpr" are present, missing "inline" - result = rule.apply("static constexpr int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - def test_apply_no_keys_present(self): - """Test that rule passes when no keys are present.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - def test_apply_single_key_present(self): - """Test that rule passes when only a single key is present.""" - rule = CheckKeySeqOrder("static inline constexpr") - result = rule.apply("static int x = 42;") - - assert result.value == ResultTypeEnum.Ok - - -class TestCppStyleRulesModule: - """Tests for cpp_style_rules module.""" - - def test_rule01_is_check_key_seq_order(self): - """Test that rule01 is a CheckKeySeqOrder instance.""" - assert isinstance(rule01, CheckKeySeqOrder) - - def test_rule01_checks_static_inline_constexpr(self): - """Test that rule01 checks for static inline constexpr ordering.""" - assert rule01.name == "static inline constexpr" - - def test_cpp_style_rules_list_not_empty(self): - """Test that cpp_style_rules list is not empty.""" - assert len(cpp_style_rules) > 0 - - def test_cpp_style_rules_contains_rule01(self): - """Test that cpp_style_rules contains rule01.""" - assert rule01 in cpp_style_rules - - def test_all_cpp_style_rules_are_cpp_style_type(self): - """Test that all rules in cpp_style_rules have CPP_STYLE type.""" - for rule in cpp_style_rules: - assert rule.rule_type == RuleType.CPP_STYLE - - -class TestStaticInlineConstexprRule: - """Tests for static inline constexpr ordering rule.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_static_inline_constexpr_correct(self): - """Test correct static inline constexpr order.""" - rule = CheckKeySeqOrder("static inline constexpr") - test_cases = [ - "static inline constexpr int x = 42;", - " static inline constexpr auto value = 10;", - "static inline constexpr double PI = 3.14159;", - ] - for line in test_cases: - result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok, f"Failed for: {line}" - - def test_static_inline_constexpr_wrong_order(self): - """Test wrong static inline constexpr order returns Error.""" - rule = CheckKeySeqOrder("static inline constexpr") - test_cases = [ - "inline static constexpr int x = 42;", - "constexpr static inline int x = 42;", - "constexpr inline static int x = 42;", - "inline constexpr static int x = 42;", - ] - for line in test_cases: - result = rule.apply(line) - assert result.value == ResultTypeEnum.Error, f"Expected Error for: { - line}" - - def test_static_inline_constexpr_partial_present(self): - """Test lines with only some keywords present.""" - rule = CheckKeySeqOrder("static inline constexpr") - test_cases = [ - "static int x = 42;", - "inline void func();", - "constexpr int y = 10;", - "static constexpr int z = 5;", - "inline constexpr int w = 3;", - ] - for line in test_cases: - result = rule.apply(line) - assert result.value == ResultTypeEnum.Ok, f"Expected Ok for: { - line}" - - def test_rule01_exists_and_configured(self): - """Test that rule01 is properly configured.""" - assert rule01 is not None - assert rule01.name == "static inline constexpr" - assert rule01.rule_type == RuleType.CPP_STYLE - assert rule01.rule_input_type == RuleInputType.LINE - - def test_rule01_in_cpp_style_rules(self): - """Test that rule01 is in the cpp_style_rules list.""" - assert rule01 in cpp_style_rules - assert len(cpp_style_rules) >= 1 - - def test_static_inline_constexpr_correct_order(self): - """Test static inline constexpr in correct order.""" - result = rule01.apply("static inline constexpr int value = 10;") - assert result.value == ResultTypeEnum.Ok - - def test_static_inline_constexpr_wrong_order_inline_first(self): - """Test inline static constexpr (wrong order).""" - result = rule01.apply("inline static constexpr int value = 10;") - assert result.value == ResultTypeEnum.Error - - def test_static_inline_constexpr_wrong_order_constexpr_first(self): - """Test constexpr static inline (wrong order).""" - result = rule01.apply("constexpr static inline int value = 10;") - assert result.value == ResultTypeEnum.Error - - def test_static_inline_constexpr_wrong_order_constexpr_inline_static(self): - """Test constexpr inline static (wrong order).""" - result = rule01.apply("constexpr inline static int value = 10;") - assert result.value == ResultTypeEnum.Error - - def test_static_constexpr_only(self): - """Test static constexpr without inline (should pass - not all keys present).""" - result = rule01.apply("static constexpr int value = 10;") - assert result.value == ResultTypeEnum.Ok - - def test_inline_constexpr_only(self): - """Test inline constexpr without static (should pass - not all keys present).""" - result = rule01.apply("inline constexpr int value = 10;") - assert result.value == ResultTypeEnum.Ok - - def test_no_keywords(self): - """Test line with no relevant keywords.""" - result = rule01.apply("int value = 10;") - assert result.value == ResultTypeEnum.Ok - - def test_with_template(self): - """Test static inline constexpr in a template context.""" - result = rule01.apply( - "template static inline constexpr T default_value{};") - assert result.value == ResultTypeEnum.Ok - - def test_in_function_declaration(self): - """Test static inline constexpr in a function declaration.""" - result = rule01.apply( - "static inline constexpr auto compute() -> int { return 42; }") - assert result.value == ResultTypeEnum.Ok - - def test_wrong_order_in_function(self): - """Test wrong order in function declaration.""" - result = rule01.apply( - "inline static constexpr auto compute() -> int { return 42; }") - assert result.value == ResultTypeEnum.Error diff --git a/devops/tests/files/__init__.py b/devops/tests/files/__init__.py deleted file mode 100644 index 41a6e13..0000000 --- a/devops/tests/files/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Package for file-related tests in mstd checks.""" diff --git a/devops/tests/files/test_files.py b/devops/tests/files/test_files.py deleted file mode 100644 index 9a1e64c..0000000 --- a/devops/tests/files/test_files.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Unit tests for file-related functionality in mstd checks.""" - -from devops.files import FileType - - -def test_all_types(): - - expected_types = { - FileType.CPPHeader, - FileType.CPPSource, - FileType.UNKNOWN, - FileType.CMakeLists - } - - actual_types = FileType.all_types() - - assert actual_types == expected_types, "FileType enum does not match expected types." diff --git a/devops/tests/files/test_update_changelog.py b/devops/tests/files/test_update_changelog.py deleted file mode 100644 index 26e2b6e..0000000 --- a/devops/tests/files/test_update_changelog.py +++ /dev/null @@ -1,253 +0,0 @@ -"""Unit tests for changelog update functionality in mstd checks.""" - -from datetime import UTC, datetime -from unittest.mock import patch - -import pytest - -from devops.files.files import MSTDFileNotFoundError -from devops.files.update_changelog import ( - MSTDChangelogError, - __CHANGELOG_INSERTION_MARKER__, - update_changelog, -) - - -class TestMSTDChangelogError: - """Tests for MSTDChangelogError exception class.""" - - def test_changelog_error_message(self): - """Test that MSTDChangelogError formats message correctly.""" - error = MSTDChangelogError("test error message") - assert str(error) == "MSTDChangelogError: test error message" - assert error.message == "test error message" - - def test_changelog_error_is_exception(self): - """Test that MSTDChangelogError is a proper exception.""" - error = MSTDChangelogError("test") - assert isinstance(error, Exception) - - -class TestUpdateChangelog: - """Tests for update_changelog function.""" - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_success(self, mock_get_repo, tmp_path): - """Test successful changelog update with new version.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## Next Release\n" - "\n" - "- Some change\n" - "\n" - "\n" - "\n" - "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" - "\n" - "- Initial release\n" - ) - - update_changelog("1.1.0", changelog) - - content = changelog.read_text() - assert "## [1.1.0](https://github.com/test/repo/releases/tag/1.1.0)" in content - assert "## Next Release" in content - # Marker should be after Next Release now - next_release_pos = content.find("## Next Release") - marker_pos = content.find(__CHANGELOG_INSERTION_MARKER__) - new_version_pos = content.find("## [1.1.0]") - assert next_release_pos < marker_pos < new_version_pos - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_with_date(self, mock_get_repo, tmp_path): - """Test that changelog entry includes today's date.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## Next Release\n" - "\n" - "- New feature\n" - "\n" - "\n" - ) - - update_changelog("2.0.0", changelog) - - content = changelog.read_text() - today = datetime.now(tz=UTC).date().isoformat() - assert f"## [2.0.0](https://github.com/test/repo/releases/tag/2.0.0) - { - today}" in content - - def test_update_changelog_file_not_found(self, tmp_path): - """Test that MSTDFileNotFoundError is raised when file doesn't exist.""" - non_existent = tmp_path / "does_not_exist.md" - - with pytest.raises(MSTDFileNotFoundError) as exc_info: - update_changelog("1.0.0", non_existent) - - assert exc_info.value.filepath == non_existent - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_missing_next_release(self, mock_get_repo, tmp_path): - """Test that MSTDChangelogError is raised when Next Release marker missing.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" - "\n" - "- Initial release\n" - ) - - with pytest.raises(MSTDChangelogError) as exc_info: - update_changelog("1.1.0", changelog) - - assert "Next Release" in exc_info.value.message - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_removes_old_marker(self, mock_get_repo, tmp_path): - """Test that old insertion marker is removed and new one is placed.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## Next Release\n" - "\n" - "- New change\n" - "\n" - "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" - "\n" - "\n" - "\n" - "## [0.9.0](https://github.com/test/repo/releases/tag/0.9.0) - 2023-12-01\n" - ) - - update_changelog("1.1.0", changelog) - - content = changelog.read_text() - # Should have exactly one marker - assert content.count(__CHANGELOG_INSERTION_MARKER__) == 1 - # Marker should be right after Next Release section heading - next_release_pos = content.find("## Next Release") - marker_pos = content.find(__CHANGELOG_INSERTION_MARKER__) - assert next_release_pos < marker_pos - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_no_existing_marker(self, mock_get_repo, tmp_path): - """Test changelog update when no insertion marker exists.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## Next Release\n" - "\n" - "- Feature A\n" - "\n" - "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" - ) - - update_changelog("1.1.0", changelog) - - content = changelog.read_text() - assert __CHANGELOG_INSERTION_MARKER__ in content - assert "## [1.1.0]" in content - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_preserves_content(self, mock_get_repo, tmp_path): - """Test that changelog update preserves existing content.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - original_content = ( - "# Changelog\n" - "\n" - "All notable changes to this project.\n" - "\n" - "## Next Release\n" - "\n" - "### Added\n" - "- New feature\n" - "\n" - "### Fixed\n" - "- Bug fix\n" - "\n" - "\n" - "\n" - "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" - "\n" - "### Added\n" - "- Initial release\n" - ) - changelog.write_text(original_content) - - update_changelog("1.1.0", changelog) - - content = changelog.read_text() - # Check original sections are preserved - assert "# Changelog" in content - assert "All notable changes to this project." in content - assert "### Added" in content - assert "- New feature" in content - assert "### Fixed" in content - assert "- Bug fix" in content - assert "- Initial release" in content - assert "## [1.0.0]" in content - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_next_release_regex_variations( - self, mock_get_repo, tmp_path - ): - """Test that regex matches various Next Release formats.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - # Test with extra spaces - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## Next Release\n" - "\n" - "- Change\n" - "\n" - "\n" - ) - - update_changelog("1.0.0", changelog) - - content = changelog.read_text() - assert "## [1.0.0]" in content - - @patch("devops.files.update_changelog.get_github_repo") - def test_update_changelog_empty_next_release(self, mock_get_repo, tmp_path): - """Test changelog update when Next Release section is empty.""" - mock_get_repo.return_value = "https://github.com/test/repo" - - changelog = tmp_path / "CHANGELOG.md" - changelog.write_text( - "# Changelog\n" - "\n" - "## Next Release\n" - "\n" - "\n" - "\n" - "## [1.0.0](https://github.com/test/repo/releases/tag/1.0.0) - 2024-01-01\n" - ) - - update_changelog("1.1.0", changelog) - - content = changelog.read_text() - assert "## [1.1.0]" in content - assert "## [1.0.0]" in content diff --git a/devops/tests/rules/__init__.py b/devops/tests/rules/__init__.py deleted file mode 100644 index dbbb144..0000000 --- a/devops/tests/rules/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Unit tests for rules module.""" diff --git a/devops/tests/rules/test_rules.py b/devops/tests/rules/test_rules.py deleted file mode 100644 index a48ece5..0000000 --- a/devops/tests/rules/test_rules.py +++ /dev/null @@ -1,259 +0,0 @@ -"""Unit tests for Rule class and related functionality.""" - -from devops.files import FileType -from devops.rules import ( - ResultType, - ResultTypeEnum, - Rule, - RuleInputType, - RuleType, - filter_cpp_rules, - filter_line_rules, -) - - -class TestRuleType: - """Tests for RuleType enumeration.""" - - def test_rule_type_values(self): - """Test that RuleType has expected values.""" - assert RuleType.GENERAL.value == "GENERAL" - assert RuleType.CPP_STYLE.value == "CPP_STYLE" - - def test_cpp_rules(self): - """Test that cpp_rules returns correct set.""" - cpp_rules = RuleType.cpp_rules() - assert isinstance(cpp_rules, set) - assert RuleType.CPP_STYLE in cpp_rules - assert RuleType.GENERAL not in cpp_rules - - -class TestRuleInputType: - """Tests for RuleInputType enumeration.""" - - def test_rule_input_type_values(self): - """Test that RuleInputType has expected values.""" - assert RuleInputType.NONE.value == "NONE" - assert RuleInputType.LINE.value == "LINE" - assert RuleInputType.FILE.value == "FILE" - - -class TestRuleCreation: - """Tests for Rule class creation.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_rule_creation_with_defaults(self): - """Test Rule creation with default parameters.""" - rule = Rule( - name="test_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - ) - assert rule.name == "test_rule" - assert rule.rule_type == RuleType.GENERAL - assert rule.rule_input_type == RuleInputType.NONE - assert rule.file_types == FileType.all_types() - assert rule.description is None - - def test_rule_creation_cpp_style(self): - """Test Rule creation with CPP_STYLE type.""" - rule = Rule( - name="cpp_style_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - ) - assert rule.rule_type == RuleType.CPP_STYLE - assert rule.file_types == FileType.cpp_types() - - def test_rule_creation_with_custom_file_types(self): - """Test Rule creation with custom file types.""" - custom_types = {FileType.CPPHeader} - rule = Rule( - name="custom_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - file_types=custom_types, - ) - assert rule.file_types == custom_types - - def test_rule_creation_with_description(self): - """Test Rule creation with description.""" - rule = Rule( - name="described_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - description="Test description", - ) - assert rule.description == "Test description" - - def test_rule_creation_line_input_type(self): - """Test Rule creation with LINE input type.""" - rule = Rule( - name="line_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_input_type=RuleInputType.LINE, - ) - assert rule.rule_input_type == RuleInputType.LINE - - -class TestRuleCounters: - """Tests for Rule counter functionality.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_general_rule_counter_increment(self): - """Test that general rule counter increments correctly.""" - initial_counter = Rule.general_rule_counter - rule = Rule( - name="general_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.GENERAL, - ) - assert rule.rule_identifier == ("GENERAL", initial_counter + 1) - assert Rule.general_rule_counter == initial_counter + 1 - - def test_cpp_style_rule_counter_increment(self): - """Test that cpp style rule counter increments correctly.""" - initial_counter = Rule.cpp_style_rule_counter - rule = Rule( - name="cpp_style_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - ) - assert rule.rule_identifier == ("STYLE", initial_counter + 1) - assert Rule.cpp_style_rule_counter == initial_counter + 1 - - def test_multiple_rules_increment_counters(self): - """Test that multiple rules increment counters correctly.""" - Rule( - name="rule1", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.GENERAL, - ) - Rule( - name="rule2", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.GENERAL, - ) - assert Rule.general_rule_counter == 2 - - Rule( - name="rule3", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - ) - assert Rule.cpp_style_rule_counter == 1 - - -class TestRuleApplication: - """Tests for Rule apply method.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_apply_with_string_arg(self): - """Test Rule apply with string argument.""" - def check_func(line): - if "hello" in line: - return ResultType(ResultTypeEnum.Ok) - return ResultType(ResultTypeEnum.Error, "No hello found") - - rule = Rule(name="hello_check", func=check_func) - result = rule.apply("hello world") - assert result.value == ResultTypeEnum.Ok - - result = rule.apply("goodbye world") - assert result.value == ResultTypeEnum.Error - - def test_apply_with_tuple_arg(self): - """Test Rule apply with tuple argument.""" - def check_func(a, b): - if a == b: - return ResultType(ResultTypeEnum.Ok) - return ResultType(ResultTypeEnum.Error, "Values don't match") - - rule = Rule(name="match_check", func=check_func) - result = rule.apply(("test", "test")) - assert result.value == ResultTypeEnum.Ok - - result = rule.apply(("test1", "test2")) - assert result.value == ResultTypeEnum.Error - - -class TestRuleFiltering: - """Tests for rule filtering functions.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_filter_cpp_rules(self): - """Test filter_cpp_rules returns only C++ related rules.""" - cpp_rule = Rule( - name="cpp_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - ) - general_rule = Rule( - name="general_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.GENERAL, - ) - rules = [cpp_rule, general_rule] - - filtered = filter_cpp_rules(rules) - assert len(filtered) == 1 - assert cpp_rule in filtered - assert general_rule not in filtered - - def test_filter_cpp_rules_empty_list(self): - """Test filter_cpp_rules with empty list.""" - filtered = filter_cpp_rules([]) - assert filtered == [] - - def test_filter_cpp_rules_no_matches(self): - """Test filter_cpp_rules when no rules match.""" - general_rule = Rule( - name="general_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.GENERAL, - ) - filtered = filter_cpp_rules([general_rule]) - assert filtered == [] - - def test_filter_line_rules(self): - """Test filter_line_rules returns only line input rules.""" - line_rule = Rule( - name="line_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_input_type=RuleInputType.LINE, - ) - file_rule = Rule( - name="file_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_input_type=RuleInputType.FILE, - ) - none_rule = Rule( - name="none_rule", - func=lambda x: ResultType(ResultTypeEnum.Ok), - rule_input_type=RuleInputType.NONE, - ) - rules = [line_rule, file_rule, none_rule] - - filtered = filter_line_rules(rules) - assert len(filtered) == 1 - assert line_rule in filtered - assert file_rule not in filtered - assert none_rule not in filtered - - def test_filter_line_rules_empty_list(self): - """Test filter_line_rules with empty list.""" - filtered = filter_line_rules([]) - assert filtered == [] diff --git a/devops/tests/scripts/__init__.py b/devops/tests/scripts/__init__.py deleted file mode 100644 index 20399b4..0000000 --- a/devops/tests/scripts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for script modules in mstd checks.""" diff --git a/devops/tests/scripts/test_cpp_checks.py b/devops/tests/scripts/test_cpp_checks.py deleted file mode 100644 index 4b690aa..0000000 --- a/devops/tests/scripts/test_cpp_checks.py +++ /dev/null @@ -1,285 +0,0 @@ -"""Unit tests for cpp_checks script module.""" - -from unittest.mock import patch - -from devops.files import FileType -from devops.rules import ResultType, ResultTypeEnum, Rule, RuleInputType, RuleType -from devops.scripts.cpp_checks import main, run_checks, run_line_checks - - -class TestRunLineChecks: - """Tests for run_line_checks function.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - def test_run_line_checks_with_matching_rule(self, tmp_path): - """Test run_line_checks applies rule to matching file type.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("static inline constexpr int x = 42;\n") - - rule = Rule( - name="test_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - results = run_line_checks([rule], test_file) - assert len(results) == 1 - assert results[0].value == ResultTypeEnum.Ok - - def test_run_line_checks_with_non_matching_file_type(self, tmp_path): - """Test run_line_checks skips rule when file type doesn't match.""" - test_file = tmp_path / "test.txt" - test_file.write_text("test content\n") - - rule = Rule( - name="cpp_only_rule", - func=lambda line: ResultType( - ResultTypeEnum.Error, "Should not run"), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - file_types={FileType.CPPSource}, - ) - - results = run_line_checks([rule], test_file) - assert len(results) == 0 - - def test_run_line_checks_multiple_lines(self, tmp_path): - """Test run_line_checks processes all lines.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("line1\nline2\nline3\n") - - rule = Rule( - name="count_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - results = run_line_checks([rule], test_file) - assert len(results) == 3 - - def test_run_line_checks_multiple_rules(self, tmp_path): - """Test run_line_checks applies multiple rules.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("test line\n") - - rule1 = Rule( - name="rule1", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - rule2 = Rule( - name="rule2", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - results = run_line_checks([rule1, rule2], test_file) - assert len(results) == 2 - - def test_run_line_checks_filters_non_line_rules(self, tmp_path): - """Test run_line_checks only applies LINE input type rules.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("test line\n") - - line_rule = Rule( - name="line_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - file_rule = Rule( - name="file_rule", - func=lambda line: ResultType( - ResultTypeEnum.Error, "Should not run"), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.FILE, - ) - - results = run_line_checks([line_rule, file_rule], test_file) - assert len(results) == 1 - assert results[0].value == ResultTypeEnum.Ok - - def test_run_line_checks_empty_file(self, tmp_path): - """Test run_line_checks handles empty files.""" - test_file = tmp_path / "empty.cpp" - test_file.write_text("") - - rule = Rule( - name="test_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - results = run_line_checks([rule], test_file) - assert len(results) == 0 - - def test_run_line_checks_no_rules(self, tmp_path): - """Test run_line_checks with no rules.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("test content\n") - - results = run_line_checks([], test_file) - assert len(results) == 0 - - -class TestRunChecks: - """Tests for run_checks function.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - @patch("devops.scripts.cpp_checks.get_staged_files") - @patch("devops.scripts.cpp_checks.cpp_check_logger") - def test_run_checks_no_files(self, mock_logger, mock_get_staged): - """Test run_checks logs warning when no files to check.""" - mock_get_staged.return_value = [] - - rules = [ - Rule( - name="test_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_input_type=RuleInputType.LINE, - ) - ] - - run_checks(rules) - - mock_logger.warning.assert_called_once_with("No files to check.") - - @patch("devops.scripts.cpp_checks.get_staged_files") - @patch("devops.scripts.cpp_checks.cpp_check_logger") - def test_run_checks_staged_mode(self, mock_logger, mock_get_staged, tmp_path): - """Test run_checks in staged files mode.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("test content\n") - mock_get_staged.return_value = [test_file] - - rule = Rule( - name="test_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - with patch.object(Rule, "cpp_style_rule_counter", 0): - with patch.object(Rule, "general_rule_counter", 0): - run_checks([rule]) - - mock_logger.info.assert_called_with( - "Running checks on staged files...") - - @patch("devops.scripts.cpp_checks.get_files_in_dirs") - @patch("devops.scripts.cpp_checks.cpp_check_logger") - @patch("sys.argv", ["cpp_checks", "full"]) - def test_run_checks_full_mode(self, mock_logger, mock_get_files, tmp_path): - """Test run_checks in full mode.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("test content\n") - mock_get_files.return_value = [test_file] - - rule = Rule( - name="test_rule", - func=lambda line: ResultType(ResultTypeEnum.Ok), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - with patch.object(Rule, "cpp_style_rule_counter", 0): - with patch.object(Rule, "general_rule_counter", 0): - run_checks([rule]) - - mock_logger.info.assert_called_with("Running full checks...") - - @patch("devops.scripts.cpp_checks.get_staged_files") - @patch("devops.scripts.cpp_checks.cpp_check_logger") - def test_run_checks_with_errors(self, mock_logger, mock_get_staged, tmp_path): - """Test run_checks logs errors when rule fails.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("bad code\n") - mock_get_staged.return_value = [test_file] - - rule = Rule( - name="failing_rule", - func=lambda line: ResultType(ResultTypeEnum.Error, "Error found"), - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - with patch.object(Rule, "cpp_style_rule_counter", 0): - with patch.object(Rule, "general_rule_counter", 0): - run_checks([rule]) - - assert mock_logger.error.called - - @patch("devops.scripts.cpp_checks.get_staged_files") - @patch("devops.scripts.cpp_checks.cpp_check_logger") - def test_run_checks_stops_on_first_file_with_errors( - self, mock_logger, mock_get_staged, tmp_path - ): - """Test run_checks returns after first file with errors.""" - file1 = tmp_path / "test1.cpp" - file1.write_text("bad code\n") - file2 = tmp_path / "test2.cpp" - file2.write_text("more code\n") - mock_get_staged.return_value = [file1, file2] - - call_count = [0] - - def counting_func(line): - call_count[0] += 1 - return ResultType(ResultTypeEnum.Error, "Error") - - rule = Rule( - name="counting_rule", - func=counting_func, - rule_type=RuleType.CPP_STYLE, - rule_input_type=RuleInputType.LINE, - ) - - with patch.object(Rule, "cpp_style_rule_counter", 0): - with patch.object(Rule, "general_rule_counter", 0): - run_checks([rule]) - - # Should stop after first file - assert call_count[0] == 1 - - -class TestMain: - """Tests for main function.""" - - def setup_method(self): - """Reset rule counters before each test.""" - Rule.cpp_style_rule_counter = 0 - Rule.general_rule_counter = 0 - - @patch("devops.scripts.cpp_checks.run_checks") - def test_main_calls_run_checks(self, mock_run_checks): - """Test main function calls run_checks with cpp_rules.""" - from devops.cpp import cpp_rules - - main() - - mock_run_checks.assert_called_once_with(cpp_rules) - - @patch("devops.scripts.cpp_checks.get_staged_files") - @patch("devops.scripts.cpp_checks.cpp_check_logger") - def test_main_integration(self, mock_logger, mock_get_staged, tmp_path): - """Test main function integration.""" - test_file = tmp_path / "test.cpp" - test_file.write_text("static inline constexpr int x = 42;\n") - mock_get_staged.return_value = [test_file] - - main() - - mock_logger.info.assert_called() diff --git a/devops/tests/utils/__init__.py b/devops/tests/utils/__init__.py deleted file mode 100644 index 5ba146d..0000000 --- a/devops/tests/utils/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Package for testing utility functions in mstd checks.""" diff --git a/devops/tests/utils/test_utils.py b/devops/tests/utils/test_utils.py deleted file mode 100644 index f953e41..0000000 --- a/devops/tests/utils/test_utils.py +++ /dev/null @@ -1,88 +0,0 @@ -from devops.utils import check_key_sequence_ordered -from devops.rules import ResultTypeEnum - - -def test_check_key_sequence_ordered(): - keys = "static inline constexpr" - line = "static inline constexpr int x = 42;" - result = check_key_sequence_ordered(keys, line) - assert result.value == ResultTypeEnum.Ok - - line = "inline static constexpr int x = 42;" - result = check_key_sequence_ordered(keys, line) - assert result.value == ResultTypeEnum.Error - - -def test_check_key_sequence_ordered_first_key_not_in_line(): - """Test when the first key doesn't appear in the line.""" - keys = "static inline constexpr" - # Line doesn't contain 'static' (first key) - line = "inline constexpr int x = 42;" - result = check_key_sequence_ordered(keys, line) - # Should return Ok since not all keys are present - assert result.value == ResultTypeEnum.Ok - - -def test_check_key_sequence_ordered_no_keys_in_line(): - """Test when none of the keys appear in the line.""" - keys = "static inline constexpr" - line = "int x = 42;" - result = check_key_sequence_ordered(keys, line) - assert result.value == ResultTypeEnum.Ok - - -def test_check_key_sequence_ordered_keys_multiple_positions(): - """Test when keys appear multiple times in different positions.""" - keys = "static inline" - # 'static' appears twice, second occurrence is followed by 'inline' - line = "static int static inline foo();" - result = check_key_sequence_ordered(keys, line) - # Should be Ok because the sequence 'static inline' exists in the line - assert result.value == ResultTypeEnum.Ok - - -def test_check_key_sequence_ordered_keys_multiple_positions_wrong_order(): - """Test when keys appear multiple times but never in correct sequence.""" - keys = "static inline constexpr" - # 'static' at positions 0, 3; 'inline' at 1; 'constexpr' at 4 - # No consecutive sequence of 'static inline constexpr' exists - line = "static inline int static constexpr x;" - result = check_key_sequence_ordered(keys, line) - # Should be Error because the exact sequence isn't in correct consecutive order - assert result.value == ResultTypeEnum.Error - - -def test_check_key_sequence_ordered_correct_order_not_consecutive(): - """Test when keys appear in correct order but not consecutively.""" - keys = "static inline constexpr" - # Keys in order but with other tokens between them - line = "static int inline float constexpr x = 42;" - result = check_key_sequence_ordered(keys, line) - # Should be Error because keys are not consecutively in order - assert result.value == ResultTypeEnum.Error - - -def test_check_key_sequence_ordered_single_key(): - """Test with a single key.""" - keys = "static" - line = "static int x = 42;" - result = check_key_sequence_ordered(keys, line) - assert result.value == ResultTypeEnum.Ok - - -def test_check_key_sequence_ordered_single_key_not_present(): - """Test with a single key that's not present.""" - keys = "static" - line = "int x = 42;" - result = check_key_sequence_ordered(keys, line) - assert result.value == ResultTypeEnum.Ok - - -def test_check_key_sequence_ordered_partial_keys_present(): - """Test when only some keys from the sequence are present.""" - keys = "static inline constexpr" - # Only 'static' and 'constexpr' are present, 'inline' is missing - line = "static constexpr int x = 42;" - result = check_key_sequence_ordered(keys, line) - # Should return Ok since not all keys are present - assert result.value == ResultTypeEnum.Ok diff --git a/devops/uv.lock b/devops/uv.lock deleted file mode 100644 index e189042..0000000 --- a/devops/uv.lock +++ /dev/null @@ -1,186 +0,0 @@ -version = 1 -revision = 3 -requires-python = ">=3.12" - -[[package]] -name = "checks" -version = "0.1.0" -source = { virtual = "." } -dependencies = [ - { name = "pytest" }, - { name = "ruff" }, - { name = "typer" }, -] - -[package.metadata] -requires-dist = [ - { name = "pytest", specifier = ">=9.0.1" }, - { name = "ruff", specifier = ">=0.14.6" }, - { name = "typer", specifier = ">=0.20.0" }, -] - -[[package]] -name = "click" -version = "8.3.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" }, -] - -[[package]] -name = "colorama" -version = "0.4.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, -] - -[[package]] -name = "iniconfig" -version = "2.3.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, -] - -[[package]] -name = "markdown-it-py" -version = "4.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "mdurl" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, -] - -[[package]] -name = "mdurl" -version = "0.1.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, -] - -[[package]] -name = "packaging" -version = "25.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, -] - -[[package]] -name = "pluggy" -version = "1.6.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, -] - -[[package]] -name = "pygments" -version = "2.19.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, -] - -[[package]] -name = "pytest" -version = "9.0.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "iniconfig" }, - { name = "packaging" }, - { name = "pluggy" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/07/56/f013048ac4bc4c1d9be45afd4ab209ea62822fb1598f40687e6bf45dcea4/pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8", size = 1564125, upload-time = "2025-11-12T13:05:09.333Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, -] - -[[package]] -name = "rich" -version = "14.2.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markdown-it-py" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" }, -] - -[[package]] -name = "ruff" -version = "0.14.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/52/f0/62b5a1a723fe183650109407fa56abb433b00aa1c0b9ba555f9c4efec2c6/ruff-0.14.6.tar.gz", hash = "sha256:6f0c742ca6a7783a736b867a263b9a7a80a45ce9bee391eeda296895f1b4e1cc", size = 5669501, upload-time = "2025-11-21T14:26:17.903Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/67/d2/7dd544116d107fffb24a0064d41a5d2ed1c9d6372d142f9ba108c8e39207/ruff-0.14.6-py3-none-linux_armv6l.whl", hash = "sha256:d724ac2f1c240dbd01a2ae98db5d1d9a5e1d9e96eba999d1c48e30062df578a3", size = 13326119, upload-time = "2025-11-21T14:25:24.2Z" }, - { url = "https://files.pythonhosted.org/packages/36/6a/ad66d0a3315d6327ed6b01f759d83df3c4d5f86c30462121024361137b6a/ruff-0.14.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9f7539ea257aa4d07b7ce87aed580e485c40143f2473ff2f2b75aee003186004", size = 13526007, upload-time = "2025-11-21T14:25:26.906Z" }, - { url = "https://files.pythonhosted.org/packages/a3/9d/dae6db96df28e0a15dea8e986ee393af70fc97fd57669808728080529c37/ruff-0.14.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7f6007e55b90a2a7e93083ba48a9f23c3158c433591c33ee2e99a49b889c6332", size = 12676572, upload-time = "2025-11-21T14:25:29.826Z" }, - { url = "https://files.pythonhosted.org/packages/76/a4/f319e87759949062cfee1b26245048e92e2acce900ad3a909285f9db1859/ruff-0.14.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a8e7b9d73d8728b68f632aa8e824ef041d068d231d8dbc7808532d3629a6bef", size = 13140745, upload-time = "2025-11-21T14:25:32.788Z" }, - { url = "https://files.pythonhosted.org/packages/95/d3/248c1efc71a0a8ed4e8e10b4b2266845d7dfc7a0ab64354afe049eaa1310/ruff-0.14.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d50d45d4553a3ebcbd33e7c5e0fe6ca4aafd9a9122492de357205c2c48f00775", size = 13076486, upload-time = "2025-11-21T14:25:35.601Z" }, - { url = "https://files.pythonhosted.org/packages/a5/19/b68d4563fe50eba4b8c92aa842149bb56dd24d198389c0ed12e7faff4f7d/ruff-0.14.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:118548dd121f8a21bfa8ab2c5b80e5b4aed67ead4b7567790962554f38e598ce", size = 13727563, upload-time = "2025-11-21T14:25:38.514Z" }, - { url = "https://files.pythonhosted.org/packages/47/ac/943169436832d4b0e867235abbdb57ce3a82367b47e0280fa7b4eabb7593/ruff-0.14.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:57256efafbfefcb8748df9d1d766062f62b20150691021f8ab79e2d919f7c11f", size = 15199755, upload-time = "2025-11-21T14:25:41.516Z" }, - { url = "https://files.pythonhosted.org/packages/c9/b9/288bb2399860a36d4bb0541cb66cce3c0f4156aaff009dc8499be0c24bf2/ruff-0.14.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ff18134841e5c68f8e5df1999a64429a02d5549036b394fafbe410f886e1989d", size = 14850608, upload-time = "2025-11-21T14:25:44.428Z" }, - { url = "https://files.pythonhosted.org/packages/ee/b1/a0d549dd4364e240f37e7d2907e97ee80587480d98c7799d2d8dc7a2f605/ruff-0.14.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:29c4b7ec1e66a105d5c27bd57fa93203637d66a26d10ca9809dc7fc18ec58440", size = 14118754, upload-time = "2025-11-21T14:25:47.214Z" }, - { url = "https://files.pythonhosted.org/packages/13/ac/9b9fe63716af8bdfddfacd0882bc1586f29985d3b988b3c62ddce2e202c3/ruff-0.14.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167843a6f78680746d7e226f255d920aeed5e4ad9c03258094a2d49d3028b105", size = 13949214, upload-time = "2025-11-21T14:25:50.002Z" }, - { url = "https://files.pythonhosted.org/packages/12/27/4dad6c6a77fede9560b7df6802b1b697e97e49ceabe1f12baf3ea20862e9/ruff-0.14.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:16a33af621c9c523b1ae006b1b99b159bf5ac7e4b1f20b85b2572455018e0821", size = 14106112, upload-time = "2025-11-21T14:25:52.841Z" }, - { url = "https://files.pythonhosted.org/packages/6a/db/23e322d7177873eaedea59a7932ca5084ec5b7e20cb30f341ab594130a71/ruff-0.14.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1432ab6e1ae2dc565a7eea707d3b03a0c234ef401482a6f1621bc1f427c2ff55", size = 13035010, upload-time = "2025-11-21T14:25:55.536Z" }, - { url = "https://files.pythonhosted.org/packages/a8/9c/20e21d4d69dbb35e6a1df7691e02f363423658a20a2afacf2a2c011800dc/ruff-0.14.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4c55cfbbe7abb61eb914bfd20683d14cdfb38a6d56c6c66efa55ec6570ee4e71", size = 13054082, upload-time = "2025-11-21T14:25:58.625Z" }, - { url = "https://files.pythonhosted.org/packages/66/25/906ee6a0464c3125c8d673c589771a974965c2be1a1e28b5c3b96cb6ef88/ruff-0.14.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:efea3c0f21901a685fff4befda6d61a1bf4cb43de16da87e8226a281d614350b", size = 13303354, upload-time = "2025-11-21T14:26:01.816Z" }, - { url = "https://files.pythonhosted.org/packages/4c/58/60577569e198d56922b7ead07b465f559002b7b11d53f40937e95067ca1c/ruff-0.14.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:344d97172576d75dc6afc0e9243376dbe1668559c72de1864439c4fc95f78185", size = 14054487, upload-time = "2025-11-21T14:26:05.058Z" }, - { url = "https://files.pythonhosted.org/packages/67/0b/8e4e0639e4cc12547f41cb771b0b44ec8225b6b6a93393176d75fe6f7d40/ruff-0.14.6-py3-none-win32.whl", hash = "sha256:00169c0c8b85396516fdd9ce3446c7ca20c2a8f90a77aa945ba6b8f2bfe99e85", size = 13013361, upload-time = "2025-11-21T14:26:08.152Z" }, - { url = "https://files.pythonhosted.org/packages/fb/02/82240553b77fd1341f80ebb3eaae43ba011c7a91b4224a9f317d8e6591af/ruff-0.14.6-py3-none-win_amd64.whl", hash = "sha256:390e6480c5e3659f8a4c8d6a0373027820419ac14fa0d2713bd8e6c3e125b8b9", size = 14432087, upload-time = "2025-11-21T14:26:10.891Z" }, - { url = "https://files.pythonhosted.org/packages/a5/1f/93f9b0fad9470e4c829a5bb678da4012f0c710d09331b860ee555216f4ea/ruff-0.14.6-py3-none-win_arm64.whl", hash = "sha256:d43c81fbeae52cfa8728d8766bbf46ee4298c888072105815b392da70ca836b2", size = 13520930, upload-time = "2025-11-21T14:26:13.951Z" }, -] - -[[package]] -name = "shellingham" -version = "1.5.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, -] - -[[package]] -name = "typer" -version = "0.20.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "rich" }, - { name = "shellingham" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/8f/28/7c85c8032b91dbe79725b6f17d2fffc595dff06a35c7a30a37bef73a1ab4/typer-0.20.0.tar.gz", hash = "sha256:1aaf6494031793e4876fb0bacfa6a912b551cf43c1e63c800df8b1a866720c37", size = 106492, upload-time = "2025-10-20T17:03:49.445Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/64/7713ffe4b5983314e9d436a90d5bd4f63b6054e2aca783a3cfc44cb95bbf/typer-0.20.0-py3-none-any.whl", hash = "sha256:5b463df6793ec1dca6213a3cf4c0f03bc6e322ac5e16e13ddd622a889489784a", size = 47028, upload-time = "2025-10-20T17:03:47.617Z" }, -] - -[[package]] -name = "typing-extensions" -version = "4.15.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, -] From fa31d9e8b85f52bbe73cf4b272463bcb5a2546a8 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 19:11:30 +0100 Subject: [PATCH 097/115] feat: add devops submodule for better integration --- .gitmodules | 3 +++ external/devops | 1 + 2 files changed, 4 insertions(+) create mode 160000 external/devops diff --git a/.gitmodules b/.gitmodules index d8dc293..b4143bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "external/Catch2"] path = external/Catch2 url = https://github.com/catchorg/Catch2 +[submodule "external/devops"] + path = external/devops + url = https://github.com/97gamjak/devops diff --git a/external/devops b/external/devops new file mode 160000 index 0000000..a361ebc --- /dev/null +++ b/external/devops @@ -0,0 +1 @@ +Subproject commit a361ebc7702c24f5b16ec1b999ce3b95f69805c3 From ece5ce82f4580dbef7a75709535cbf4cc52e28e5 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 19:23:14 +0100 Subject: [PATCH 098/115] feat: enhance static analysis workflow and add buggy header warnings --- .devops.toml | 22 +++++++++++++++++++ .github/workflows/static-analysis.yml | 15 +++++++++++-- include/mstd/quantity/dim.hpp | 4 ++++ include/mstd/quantity/dim_details.hpp | 4 ++++ include/mstd/quantity/dim_impl.hpp | 4 ++++ include/mstd/quantity/dim_operations.hpp | 4 ++++ include/mstd/quantity/dim_ratio.hpp | 4 ++++ include/mstd/quantity/dim_ratio_details.hpp | 4 ++++ include/mstd/quantity/dim_ratio_impl.hpp | 4 ++++ .../mstd/quantity/dim_ratio_operations.hpp | 4 ++++ include/mstd/quantity/enums.hpp | 4 ++++ include/mstd/quantity/quantity.hpp | 4 ++++ include/mstd/quantity/quantity_impl.hpp | 4 ++++ include/mstd/quantity/unit.hpp | 4 ++++ include/mstd/quantity/unit_details.hpp | 4 ++++ include/mstd/quantity/unit_impl.hpp | 4 ++++ include/mstd/quantity/unit_operations.hpp | 4 ++++ 17 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 .devops.toml diff --git a/.devops.toml b/.devops.toml new file mode 100644 index 0000000..edc2928 --- /dev/null +++ b/.devops.toml @@ -0,0 +1,22 @@ +# DevOps Configuration File + +[exclude] +buggy_cpp_macros = ["MSTD_WARN_BUGGY_HEADER", "MSTD_WARN_BUGGY_LIBRARY"] + +[logging] +#global_level = "INFO" +#utils_level = "INFO" +#config_level = "INFO" +#cpp_level = "INFO" + +[git] +#tag_prefix = "" +#empty_tag_list_allowed = true + +[cpp] +#style_checks = true +#license_header_check = true +#check_only_staged_files = false + +[file] +#encoding = "utf-8" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index d75da5d..6d04408 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -44,6 +44,17 @@ jobs: with: submodules: recursive + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.13 + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e external/devops + - name: Install clang-tidy and dependencies run: | sudo apt update @@ -56,8 +67,8 @@ jobs: - name: Run clang-tidy on test directory run: | - find test -name '*.cpp' -not -path '*/external/*' | xargs -r clang-tidy -p . --warnings-as-errors='*' + echo $(filter_buggy_cpp_files --dirs test) | xargs -r clang-tidy -p . --warnings-as-errors='*' - name: Run clang-tidy on include directory run: | - find include -name '*.hpp' | xargs -r clang-tidy -p . --warnings-as-errors='*' --suppress=AnalyzeMacros + echo $(filter_buggy_cpp_files --dirs include) | xargs -r clang-tidy -p . --warnings-as-errors='*' --suppress=AnalyzeMacros diff --git a/include/mstd/quantity/dim.hpp b/include/mstd/quantity/dim.hpp index bb5550e..d7af790 100644 --- a/include/mstd/quantity/dim.hpp +++ b/include/mstd/quantity/dim.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_DIMENSION_HPP__ #define __MSTD_UNITS_DIMENSION_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim.hpp") + #include #include "dim_details.hpp" diff --git a/include/mstd/quantity/dim_details.hpp b/include/mstd/quantity/dim_details.hpp index 9115af4..76ca756 100644 --- a/include/mstd/quantity/dim_details.hpp +++ b/include/mstd/quantity/dim_details.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIM_DETAILS_HPP__ #define __MSTD_DIM_DETAILS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_details.hpp") + #include "mstd/pack.hpp" namespace mstd diff --git a/include/mstd/quantity/dim_impl.hpp b/include/mstd/quantity/dim_impl.hpp index 975c55d..732ae73 100644 --- a/include/mstd/quantity/dim_impl.hpp +++ b/include/mstd/quantity/dim_impl.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIMENSION_IMPL_HPP__ #define __MSTD_DIMENSION_IMPL_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_impl.hpp") + #include "dim.hpp" #include "dim_operations.hpp" diff --git a/include/mstd/quantity/dim_operations.hpp b/include/mstd/quantity/dim_operations.hpp index cecf6a6..b8f51ad 100644 --- a/include/mstd/quantity/dim_operations.hpp +++ b/include/mstd/quantity/dim_operations.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIM_OPERATIONS_HPP__ #define __MSTD_DIM_OPERATIONS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_operations.hpp") + #include "dim.hpp" #include "dim_details.hpp" diff --git a/include/mstd/quantity/dim_ratio.hpp b/include/mstd/quantity/dim_ratio.hpp index 347e905..87256ba 100644 --- a/include/mstd/quantity/dim_ratio.hpp +++ b/include/mstd/quantity/dim_ratio.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIM_RATIO_HPP__ #define __MSTD_DIM_RATIO_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_ratio.hpp") + #include "enums.hpp" #include "mstd/pack.hpp" diff --git a/include/mstd/quantity/dim_ratio_details.hpp b/include/mstd/quantity/dim_ratio_details.hpp index 0b329f0..69783a4 100644 --- a/include/mstd/quantity/dim_ratio_details.hpp +++ b/include/mstd/quantity/dim_ratio_details.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIM_RATIO_DETAILS_HPP__ #define __MSTD_DIM_RATIO_DETAILS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_ratio_details.hpp") + #include "dim_details.hpp" #include "dim_ratio.hpp" #include "mstd/pack.hpp" diff --git a/include/mstd/quantity/dim_ratio_impl.hpp b/include/mstd/quantity/dim_ratio_impl.hpp index d9dbcb5..b85084d 100644 --- a/include/mstd/quantity/dim_ratio_impl.hpp +++ b/include/mstd/quantity/dim_ratio_impl.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIM_RATIO_IMPL_HPP__ #define __MSTD_DIM_RATIO_IMPL_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_ratio_impl.hpp") + #include "dim_ratio.hpp" #include "dim_ratio_operations.hpp" #include "mstd/ratio.hpp" diff --git a/include/mstd/quantity/dim_ratio_operations.hpp b/include/mstd/quantity/dim_ratio_operations.hpp index 05cf3e9..63cdec8 100644 --- a/include/mstd/quantity/dim_ratio_operations.hpp +++ b/include/mstd/quantity/dim_ratio_operations.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_DIM_RATIO_OPERATIONS_HPP__ #define __MSTD_DIM_RATIO_OPERATIONS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/dim_ratio_operations.hpp") + #include "dim_ratio.hpp" #include "dim_ratio_details.hpp" diff --git a/include/mstd/quantity/enums.hpp b/include/mstd/quantity/enums.hpp index 8da1bba..aa10c83 100644 --- a/include/mstd/quantity/enums.hpp +++ b/include/mstd/quantity/enums.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_ENUMS_HPP__ #define __MSTD_UNITS_ENUMS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/enums.hpp") + #include #include "mstd/enum.hpp" diff --git a/include/mstd/quantity/quantity.hpp b/include/mstd/quantity/quantity.hpp index 54996c9..18d0a99 100644 --- a/include/mstd/quantity/quantity.hpp +++ b/include/mstd/quantity/quantity.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_QUANTITY_HPP__ #define __MSTD_UNITS_QUANTITY_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_LIBRARY("mstd/quantity.hpp") + #include #include "mstd/type_traits/quantity_traits.hpp" diff --git a/include/mstd/quantity/quantity_impl.hpp b/include/mstd/quantity/quantity_impl.hpp index e196c72..3294473 100644 --- a/include/mstd/quantity/quantity_impl.hpp +++ b/include/mstd/quantity/quantity_impl.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_QUANTITY_IMPL_HPP__ #define __MSTD_UNITS_QUANTITY_IMPL_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/quantity_impl.hpp") + #include "quantity.hpp" #include "unit_impl.hpp" diff --git a/include/mstd/quantity/unit.hpp b/include/mstd/quantity/unit.hpp index 1caec56..9627bb8 100644 --- a/include/mstd/quantity/unit.hpp +++ b/include/mstd/quantity/unit.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_UNIT_HPP__ #define __MSTD_UNITS_UNIT_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/unit.hpp") + #include "dim_details.hpp" #include "dim_ratio.hpp" #include "mstd/error.hpp" diff --git a/include/mstd/quantity/unit_details.hpp b/include/mstd/quantity/unit_details.hpp index e4815a4..2953ad4 100644 --- a/include/mstd/quantity/unit_details.hpp +++ b/include/mstd/quantity/unit_details.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNITS_DETAILS_HPP__ #define __MSTD_UNITS_DETAILS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/unit_details.hpp") + #include "dim.hpp" #include "dim_ratio_operations.hpp" #include "mstd/math.hpp" diff --git a/include/mstd/quantity/unit_impl.hpp b/include/mstd/quantity/unit_impl.hpp index 461f0eb..272a516 100644 --- a/include/mstd/quantity/unit_impl.hpp +++ b/include/mstd/quantity/unit_impl.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNIT_IMPL_HPP__ #define __MSTD_UNIT_IMPL_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/unit_impl.hpp") + #include #include "dim_impl.hpp" diff --git a/include/mstd/quantity/unit_operations.hpp b/include/mstd/quantity/unit_operations.hpp index 9e650a6..659595c 100644 --- a/include/mstd/quantity/unit_operations.hpp +++ b/include/mstd/quantity/unit_operations.hpp @@ -23,6 +23,10 @@ #ifndef __MSTD_UNIT_OPERATIONS_HPP__ #define __MSTD_UNIT_OPERATIONS_HPP__ +#include "mstd/error.hpp" + +MSTD_WARN_BUGGY_HEADER("mstd/quantity/unit_operations.hpp") + #include "mstd/pack.hpp" #include "mstd/ratio.hpp" #include "unit_details.hpp" From 8880701013d5fd48bdb973b2379fdbef697a0339 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 19:27:47 +0100 Subject: [PATCH 099/115] feat: update buggy marker variables to include library and header names --- include/mstd/error.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index dc3e09e..a13a871 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -59,8 +59,8 @@ namespace mstd namespace mstd::buggy \ { \ [[deprecated("Buggy library: " library_name " — don't use it!")]] \ - inline int buggy_marker = 0; \ - inline int buggy_marker_alias = buggy_marker; \ + inline int buggy_marker##library_name = 0; \ + inline int buggy_marker_alias##library_name = buggy_marker; \ } // namespace mstd::buggy /** @@ -70,8 +70,8 @@ namespace mstd namespace mstd::buggy \ { \ [[deprecated("Buggy header: " header_file " — don't use it!")]] \ - inline int buggy_marker = 0; \ - inline int buggy_marker_alias = buggy_marker; \ + inline int buggy_marker##header_file = 0; \ + inline int buggy_marker_alias##header_file = buggy_marker; \ } // namespace mstd::buggy #endif From b67d5de829954d5a9fca5d90ba185f5c77204852 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 19:28:56 +0100 Subject: [PATCH 100/115] feat: update buggy marker macros to use library and header names in namespaces --- include/mstd/error.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index a13a871..f1b0c19 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -56,23 +56,23 @@ namespace mstd * @brief Warn about a buggy library */ #define MSTD_WARN_BUGGY_LIBRARY(library_name) \ - namespace mstd::buggy \ + namespace mstd::buggy##library_name \ { \ [[deprecated("Buggy library: " library_name " — don't use it!")]] \ - inline int buggy_marker##library_name = 0; \ - inline int buggy_marker_alias##library_name = buggy_marker; \ - } // namespace mstd::buggy + inline int buggy_marker = 0; \ + inline int buggy_marker_alias = buggy_marker; \ + } /** * @brief Warn about a buggy header */ #define MSTD_WARN_BUGGY_HEADER(header_file) \ - namespace mstd::buggy \ + namespace mstd::buggy##header_file \ { \ [[deprecated("Buggy header: " header_file " — don't use it!")]] \ - inline int buggy_marker##header_file = 0; \ - inline int buggy_marker_alias##header_file = buggy_marker; \ - } // namespace mstd::buggy + inline int buggy_marker = 0; \ + inline int buggy_marker_alias = buggy_marker; \ + } #endif From 7a432b1ffb8bae31d9d2e961de5692c05901f749 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 19:33:36 +0100 Subject: [PATCH 101/115] feat: enhance buggy library and header warnings with unique namespace generation --- include/mstd/error.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index f1b0c19..90f18e2 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -41,6 +41,9 @@ namespace mstd } // namespace mstd +#define MSTD_CAT(a, b) a##b +#define MSTD_CAT2(a, b) MSTD_CAT(a, b) + #define MSTD_COMPILE_FAIL(msg) \ static_assert(::mstd::always_false::value, msg) @@ -56,7 +59,7 @@ namespace mstd * @brief Warn about a buggy library */ #define MSTD_WARN_BUGGY_LIBRARY(library_name) \ - namespace mstd::buggy##library_name \ + namespace MSTD_CAT2(mstd::buggy, __COUNTER__) \ { \ [[deprecated("Buggy library: " library_name " — don't use it!")]] \ inline int buggy_marker = 0; \ @@ -67,7 +70,7 @@ namespace mstd * @brief Warn about a buggy header */ #define MSTD_WARN_BUGGY_HEADER(header_file) \ - namespace mstd::buggy##header_file \ + namespace MSTD_CAT2(mstd::buggy, __COUNTER__) \ { \ [[deprecated("Buggy header: " header_file " — don't use it!")]] \ inline int buggy_marker = 0; \ From 51cff2a918f5702e371922658ce4a73850da8937 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 19:39:46 +0100 Subject: [PATCH 102/115] feat: update lie potential evaluation method for clarity and consistency --- .cppcheck.suppress | 3 +-- include/mstd/physics/potentials/lie_potential.hpp | 13 +++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.cppcheck.suppress b/.cppcheck.suppress index 935ac34..e0e3a7f 100644 --- a/.cppcheck.suppress +++ b/.cppcheck.suppress @@ -1,2 +1 @@ -unusedFunction -unusedStructMember \ No newline at end of file +unusedFunction \ No newline at end of file diff --git a/include/mstd/physics/potentials/lie_potential.hpp b/include/mstd/physics/potentials/lie_potential.hpp index 4110e4a..ea278eb 100644 --- a/include/mstd/physics/potentials/lie_potential.hpp +++ b/include/mstd/physics/potentials/lie_potential.hpp @@ -45,12 +45,6 @@ namespace mstd Rep _coeff1{}; Rep _coeff2{}; - protected: - std::pair _eval(const Rep r) const - { - return liePotential(_coeff1, _coeff2, r); - } - public: /** * @brief Constructs the potential with prefactors for the attractive @@ -78,7 +72,10 @@ namespace mstd } /// @brief Returns both energy and force evaluated at @p r. - virtual std::pair eval(const Rep r) const { return _eval(r); } + virtual std::pair eval(const Rep r) const + { + return liePotential(_coeff1, _coeff2, r); + } }; template @@ -107,7 +104,7 @@ namespace mstd constexpr LieShiftedPotential(Rep c1, Rep c2, Rep rc) : LiePotential(c1, c2), _radialCutoff(rc) { - std::tie(_energyCutoff, _forceCutoff) = _eval(_radialCutoff); + std::tie(_energyCutoff, _forceCutoff) = _Base::eval(rc); } /// @brief Energy corrected so that it vanishes at the cutoff. From 5fca45b8fcaca6f17da2fd31ec5159fe14bbf795 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 20:32:50 +0100 Subject: [PATCH 103/115] feat: streamline static analysis workflow by removing clang-tidy and adding devops cpp_checks --- .devops.toml | 1 + .github/workflows/static-analysis.yml | 16 +--------------- external/devops | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.devops.toml b/.devops.toml index edc2928..185a95c 100644 --- a/.devops.toml +++ b/.devops.toml @@ -17,6 +17,7 @@ buggy_cpp_macros = ["MSTD_WARN_BUGGY_HEADER", "MSTD_WARN_BUGGY_LIBRARY"] #style_checks = true #license_header_check = true #check_only_staged_files = false +license_header = "config/licenseHeader.txt" [file] #encoding = "utf-8" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6d04408..20707ca 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -57,18 +57,4 @@ jobs: - name: Install clang-tidy and dependencies run: | - sudo apt update - sudo apt install -y clang-tidy cmake g++ - - - name: Generate compile_commands.json - run: | - cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - test -f build/compile_commands.json && cp build/compile_commands.json . - - - name: Run clang-tidy on test directory - run: | - echo $(filter_buggy_cpp_files --dirs test) | xargs -r clang-tidy -p . --warnings-as-errors='*' - - - name: Run clang-tidy on include directory - run: | - echo $(filter_buggy_cpp_files --dirs include) | xargs -r clang-tidy -p . --warnings-as-errors='*' --suppress=AnalyzeMacros + cpp_checks --dirs include --dirs test \ No newline at end of file diff --git a/external/devops b/external/devops index a361ebc..7d38a4d 160000 --- a/external/devops +++ b/external/devops @@ -1 +1 @@ -Subproject commit a361ebc7702c24f5b16ec1b999ce3b95f69805c3 +Subproject commit 7d38a4d40ec2cbabc8a43312fc9e675c2d9ccde0 From 5ac05f46301a0daa210e5ad29f45f4e5ed6e43ad Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 20:45:13 +0100 Subject: [PATCH 104/115] feat: enhance release version extraction and hotfix handling in CI workflows --- .../check-pr-for-release-version.yml | 21 ++++++-- .github/workflows/create-tag.yml | 49 +++++++++++++++++-- CHANGELOG.md | 6 +-- 3 files changed, 63 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-pr-for-release-version.yml b/.github/workflows/check-pr-for-release-version.yml index f233790..2030833 100644 --- a/.github/workflows/check-pr-for-release-version.yml +++ b/.github/workflows/check-pr-for-release-version.yml @@ -11,20 +11,31 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check PR Title or Description + - name: Check PR Title, Description, or Hotfix Branch run: | title="${{ github.event.pull_request.title }}" body="${{ github.event.pull_request.body }}" - echo "Checking PR title: $title" - echo "Checking PR body: $body" + head_ref="${{ github.head_ref }}" - # Regex: Release-x.y.z (case-insensitive, numeric x, y, z of variable length) + echo "PR title: $title" + echo "PR body: $body" + echo "PR source branch: $head_ref" + + # Allow hotfix branches unconditionally + if [[ "$head_ref" == hotfix/* ]]; then + echo "✅ Hotfix branch detected ($head_ref). Skipping release pattern check." + exit 0 + fi + + # Regex: Release-x.y.z (case-insensitive) regex='[Rr][Ee][Ll][Ee][Aa][Ss][Ee]-[0-9]+\.[0-9]+\.[0-9]+' if [[ "$title" =~ $regex ]] || [[ "$body" =~ $regex ]]; then echo "✅ Found valid Release pattern in title or description." exit 0 else - echo "❌ Invalid PR. Title or description must contain: Release-x.y.z (e.g., Release-1.2.3)" + echo "❌ Invalid PR." + echo " Title or description must contain: Release-x.y.z (e.g., Release-1.2.3)" + echo " OR the branch must start with: hotfix/" exit 1 fi diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml index 3df9dff..46bdd52 100644 --- a/.github/workflows/create-tag.yml +++ b/.github/workflows/create-tag.yml @@ -22,12 +22,44 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Extract release version from PR + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.13 + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e external/devops + + - name: Extract release version (Release-x.y.z OR hotfix bump) id: extract_version + shell: bash run: | + set -euo pipefail + title="${{ github.event.pull_request.title }}" body="${{ github.event.pull_request.body }}" + head_ref="${{ github.head_ref }}" # PR source branch name, e.g. hotfix/... + + echo "PR source branch: $head_ref" + echo "PR title: $title" + + # Hotfix: version = latest tag + 1 in patch + if [[ "$head_ref" == hotfix/* ]]; then + echo "✅ Hotfix PR detected. Deducing version from latest tag + patch bump..." + git fetch --tags --force + + version="$(increase_latest_tag --patch)" + + echo "✅ Hotfix release version: $version" + echo "version=$version" >> "$GITHUB_OUTPUT" + exit 0 + fi + + # Non-hotfix: expect Release-x.y.z in title/body regex='[Rr][Ee][Ll][Ee][Aa][Ss][Ee]-([0-9]+\.[0-9]+\.[0-9]+)' if [[ "$title" =~ $regex ]]; then @@ -36,16 +68,18 @@ jobs: version="${BASH_REMATCH[1]}" else echo "❌ No valid release version found in PR title or description." + echo " Expected: Release-x.y.z (e.g., Release-1.2.3)" + echo " Or use a hotfix/* branch to auto-bump patch." exit 1 fi echo "✅ Found release version: $version" - echo "version=$version" >> $GITHUB_OUTPUT + echo "version=$version" >> "$GITHUB_OUTPUT" - name: Update CHANGELOG.md run: | version="${{ steps.extract_version.outputs.version }}" - python3 scripts/update_changelog.py "$version" + update_changelog "$version" - name: Commit and push changelog update run: | @@ -54,16 +88,21 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add CHANGELOG.md - git commit -m "docs: update changelog for $version" + git commit -m "docs: update changelog for $version" || echo "No changes to commit" git push origin HEAD:main - name: Create Git tag - id: create_tag run: | version="${{ steps.extract_version.outputs.version }}" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + # Safety: don't fail if tag already exists (e.g., re-runs) + if git rev-parse -q --verify "refs/tags/$version" >/dev/null; then + echo "Tag $version already exists. Skipping tag creation." + exit 0 + fi + git tag "$version" git push origin "$version" diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a01cd2..d0d8f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,11 @@ All notable changes to this project will be documented in this file. ## Next Release -### DevOps +### CI - Add devops python library first version for all kind of custom static code analysis -- Add "static inline constexpr" as key sequence order cpp rule -- Add "update_changelog.py" script to update CHANGELOG.md automatically based on version input +- Add `update_changelog` from devops package to create_tag CI +- Add hotfix branch release handling to auto increment version patch aka `major.minor.patch` ### Error Handling From c5a5bd0fb1d9b3c14d7b3c15e094f0dc42e71a94 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 20:51:34 +0100 Subject: [PATCH 105/115] feat: enable comprehensive warnings and errors for GNU compiler; fix return type in integer_pack and add virtual destructor in lie_potential --- CMakeLists.txt | 34 +++++++++++++++++++ include/mstd/pack/integer_pack.hpp | 2 +- .../mstd/physics/potentials/lie_potential.hpp | 2 ++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2478bd..59ab53c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,40 @@ target_compile_features(mstd cxx_std_20 ) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(mstd INTERFACE + -Wall + -Wextra + -Wpedantic + -Werror + + # correctness + -Wshadow + -Wconversion + -Wsign-conversion + -Wcast-align + -Wformat=2 + -Wnull-dereference + -Wdouble-promotion + -Wimplicit-fallthrough + -Woverloaded-virtual + -Wnon-virtual-dtor + -Wold-style-cast + -Wuseless-cast + -Wduplicated-cond + -Wduplicated-branches + -Wlogical-op + -Wmisleading-indentation + + # lifetime / safety + -Wuninitialized + -Wmaybe-uninitialized + -Winit-self + + -Wno-error=deprecated-declarations + ) +endif() + if(MSTD_BUILD_TESTS) include(CTest) enable_testing() diff --git a/include/mstd/pack/integer_pack.hpp b/include/mstd/pack/integer_pack.hpp index be238d8..0dfa0c8 100644 --- a/include/mstd/pack/integer_pack.hpp +++ b/include/mstd/pack/integer_pack.hpp @@ -93,7 +93,7 @@ namespace mstd if (vals[i] != 0) return i; - return -1; + return static_cast(-1); } }; diff --git a/include/mstd/physics/potentials/lie_potential.hpp b/include/mstd/physics/potentials/lie_potential.hpp index ea278eb..0462dff 100644 --- a/include/mstd/physics/potentials/lie_potential.hpp +++ b/include/mstd/physics/potentials/lie_potential.hpp @@ -46,6 +46,8 @@ namespace mstd Rep _coeff2{}; public: + virtual ~LiePotential() = default; + /** * @brief Constructs the potential with prefactors for the attractive * and repulsive terms. From 3509f0788e52d0b70b385840843b2647c93261bd Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 20:58:23 +0100 Subject: [PATCH 106/115] docs: add exhaustive error flags for compilation in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d8f18..e0eac9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. ### Compilation - Add Compile flag `MSTD_IGNORE_BUGGY_CODE` to ignore any kind of warnings for buggy libraries or headers +- Add exhaustive error flags for compilation ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From bdbe3452f2da3a780104a42276e814ff6563b51a Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 21:02:51 +0100 Subject: [PATCH 107/115] feat: update Doxygen configuration and add GitHub Actions workflow for documentation build --- .github/workflows/docs.yml | 30 ++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + docs/Doxyfile | 3 ++- include/mstd/quantity/quantity.hpp | 1 - 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..d42d7db --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,30 @@ +name: BUILD + +on: + pull_request: + branches: + - '*' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive # ✅ ensure Catch2 is pulled in + + - name: Install gcc14 + run: | + sudo apt update + sudo apt install -y gcc-14 g++-14 + shell: bash + + - name: Build and Test Project + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DMSTD_BUILD_DOCS=ON + make docs # at the moment only building docs to verify no doc-related build issues + env: + CC: gcc-14 + CXX: g++-14 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e0eac9f..39e359c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - Add Compile flag `MSTD_IGNORE_BUGGY_CODE` to ignore any kind of warnings for buggy libraries or headers - Add exhaustive error flags for compilation +- Add checking of doxygen comments via building docs (no docs is building for gh pages - yet) ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 diff --git a/docs/Doxyfile b/docs/Doxyfile index 88ee01b..51633db 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -65,7 +65,8 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_IF_INCOMPLETE_DOC = YES -WARN_NO_PARAMDOC = NO +WARN_NO_PARAMDOC = YES +WARN_AS_ERROR = YES WARN_FORMAT = "$file:$line: $text" #--------------------------------------------------------------------------- diff --git a/include/mstd/quantity/quantity.hpp b/include/mstd/quantity/quantity.hpp index 18d0a99..c7ed4cb 100644 --- a/include/mstd/quantity/quantity.hpp +++ b/include/mstd/quantity/quantity.hpp @@ -71,7 +71,6 @@ namespace mstd /** * @brief Construct a Quantity from a base value (SI unit). * - * @param from_base_tag Tag to indicate base value construction. * @param base The base value in SI units. */ constexpr Quantity(from_base_t, Rep base) // base (SI) ctor From 006654d886b041e7adb081627985bc16380c4aee Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 21:07:00 +0100 Subject: [PATCH 108/115] fix: rename workflow to DOCS and add Doxygen installation step --- .github/workflows/docs.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d42d7db..e04fb32 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: BUILD +name: DOCS on: pull_request: @@ -21,6 +21,11 @@ jobs: sudo apt install -y gcc-14 g++-14 shell: bash + - name: Install Doxygen + run: | + sudo apt update + sudo apt install -y doxygen + - name: Build and Test Project run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DMSTD_BUILD_DOCS=ON From 2f0d2932a76657a94012924e1f31288b15b86291 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 22:47:16 +0100 Subject: [PATCH 109/115] feat: add header guards according to filepath and update related files --- .devops.toml | 1 + .vscode/settings.json | 3 ++- external/devops | 2 +- include/mstd/compile.hpp | 6 +++--- include/mstd/enum.hpp | 6 +++--- include/mstd/error.hpp | 6 +++--- include/mstd/functional.hpp | 6 +++--- include/mstd/math.hpp | 6 +++--- include/mstd/math/power.hpp | 6 +++--- include/mstd/pack.hpp | 6 +++--- include/mstd/pack/integer_pack.hpp | 6 +++--- include/mstd/pack/integer_pack_details.hpp | 12 ++++++------ include/mstd/pack/integer_pack_operations.hpp | 6 +++--- include/mstd/pack/ratio_pack.hpp | 6 +++--- include/mstd/pack/ratio_pack_details.hpp | 6 +++--- include/mstd/pack/ratio_pack_operations.hpp | 6 +++--- include/mstd/quantity.hpp | 6 +++--- include/mstd/quantity/dim.hpp | 6 +++--- include/mstd/quantity/dim_details.hpp | 6 +++--- include/mstd/quantity/dim_impl.hpp | 6 +++--- include/mstd/quantity/dim_operations.hpp | 6 +++--- include/mstd/quantity/dim_ratio.hpp | 6 +++--- include/mstd/quantity/dim_ratio_details.hpp | 6 +++--- include/mstd/quantity/dim_ratio_impl.hpp | 6 +++--- include/mstd/quantity/dim_ratio_operations.hpp | 6 +++--- include/mstd/quantity/enums.hpp | 6 +++--- include/mstd/quantity/quantity.hpp | 6 +++--- include/mstd/quantity/quantity_impl.hpp | 6 +++--- include/mstd/quantity/unit.hpp | 6 +++--- include/mstd/quantity/unit_details.hpp | 6 +++--- include/mstd/quantity/unit_impl.hpp | 6 +++--- include/mstd/quantity/unit_operations.hpp | 6 +++--- include/mstd/ratio.hpp | 6 +++--- include/mstd/type_traits.hpp | 6 +++--- include/mstd/type_traits/pack_traits.hpp | 6 +++--- include/mstd/type_traits/quantity_traits.hpp | 6 +++--- include/mstd/type_traits/ratio_traits.hpp | 6 +++--- scripts/cppcheck.sh | 2 ++ test/quantity/test_utils.hpp | 6 +++--- 39 files changed, 114 insertions(+), 110 deletions(-) diff --git a/.devops.toml b/.devops.toml index 185a95c..de78e83 100644 --- a/.devops.toml +++ b/.devops.toml @@ -18,6 +18,7 @@ buggy_cpp_macros = ["MSTD_WARN_BUGGY_HEADER", "MSTD_WARN_BUGGY_LIBRARY"] #license_header_check = true #check_only_staged_files = false license_header = "config/licenseHeader.txt" +header_guards_according_to_filepath = true [file] #encoding = "utf-8" diff --git a/.vscode/settings.json b/.vscode/settings.json index b376aa1..e3381ec 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -108,6 +108,7 @@ "__nullptr": "cpp", "csignal": "cpp", "list": "cpp", - "text_encoding": "cpp" + "text_encoding": "cpp", + "__locale": "cpp" }, } \ No newline at end of file diff --git a/external/devops b/external/devops index 7d38a4d..c3be8da 160000 --- a/external/devops +++ b/external/devops @@ -1 +1 @@ -Subproject commit 7d38a4d40ec2cbabc8a43312fc9e675c2d9ccde0 +Subproject commit c3be8da2dfa9abc382d8680746c7ca411f6fc7ea diff --git a/include/mstd/compile.hpp b/include/mstd/compile.hpp index 34c8b09..bae2261 100644 --- a/include/mstd/compile.hpp +++ b/include/mstd/compile.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_COMPILE_HPP__ -#define __MSTD_COMPILE_HPP__ +#ifndef __MSTD__COMPILE_HPP__ +#define __MSTD__COMPILE_HPP__ /** * @brief Ignore buggy code @@ -40,4 +40,4 @@ #define MSTD_IGNORE_BUGGY_CODE 0 #endif -#endif // __MSTD_COMPILE_HPP__ \ No newline at end of file +#endif // __MSTD__COMPILE_HPP__ \ No newline at end of file diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index 9b9d186..ae3e432 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_ENUM_HPP__ -#define __MSTD_ENUM_HPP__ +#ifndef __MSTD__ENUM_HPP__ +#define __MSTD__ENUM_HPP__ #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -100,4 +100,4 @@ } \ }; -#endif // __MSTD_ENUM_HPP__ \ No newline at end of file +#endif // __MSTD__ENUM_HPP__ \ No newline at end of file diff --git a/include/mstd/error.hpp b/include/mstd/error.hpp index 90f18e2..40215ab 100644 --- a/include/mstd/error.hpp +++ b/include/mstd/error.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_ERROR_HPP__ -#define __MSTD_ERROR_HPP__ +#ifndef __MSTD__ERROR_HPP__ +#define __MSTD__ERROR_HPP__ #include @@ -79,4 +79,4 @@ namespace mstd #endif -#endif // __MSTD_ERROR_HPP__ \ No newline at end of file +#endif // __MSTD__ERROR_HPP__ \ No newline at end of file diff --git a/include/mstd/functional.hpp b/include/mstd/functional.hpp index efb11c4..2d04802 100644 --- a/include/mstd/functional.hpp +++ b/include/mstd/functional.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __FUNCTIONAL_HPP__ -#define __FUNCTIONAL_HPP__ +#ifndef __MSTD__FUNCTIONAL_HPP__ +#define __MSTD__FUNCTIONAL_HPP__ namespace mstd { @@ -56,4 +56,4 @@ namespace mstd } // namespace mstd -#endif // __FUNCTIONAL_HPP__ \ No newline at end of file +#endif // __MSTD__FUNCTIONAL_HPP__ \ No newline at end of file diff --git a/include/mstd/math.hpp b/include/mstd/math.hpp index 6685d2e..94b1d46 100644 --- a/include/mstd/math.hpp +++ b/include/mstd/math.hpp @@ -20,9 +20,9 @@ ******************************************************************************/ -#ifndef __MSTD_MATH_HPP__ -#define __MSTD_MATH_HPP__ +#ifndef __MSTD__MATH_HPP__ +#define __MSTD__MATH_HPP__ #include "math/power.hpp" // IWYU pragma: export -#endif // __MSTD_MATH_HPP__ \ No newline at end of file +#endif // __MSTD__MATH_HPP__ \ No newline at end of file diff --git a/include/mstd/math/power.hpp b/include/mstd/math/power.hpp index d6b57b0..222fa32 100644 --- a/include/mstd/math/power.hpp +++ b/include/mstd/math/power.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_MATH_POWER_HPP__ -#define __MSTD_MATH_POWER_HPP__ +#ifndef __MSTD__MATH__POWER_HPP__ +#define __MSTD__MATH__POWER_HPP__ #include @@ -80,4 +80,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_MATH_POWER_HPP__ +#endif // __MSTD__MATH__POWER_HPP__ diff --git a/include/mstd/pack.hpp b/include/mstd/pack.hpp index a20f7e8..92c7f5c 100644 --- a/include/mstd/pack.hpp +++ b/include/mstd/pack.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_PACK_HPP__ -#define __MSTD_PACK_HPP__ +#ifndef __MSTD__PACK_HPP__ +#define __MSTD__PACK_HPP__ #include "pack/integer_pack.hpp" // IWYU pragma: export #include "pack/integer_pack_operations.hpp" // IWYU pragma: export @@ -29,4 +29,4 @@ #include "pack/ratio_pack_operations.hpp" // IWYU pragma: export #include "type_traits/pack_traits.hpp" // IWYU pragma: export -#endif // __MSTD_PACK_HPP__ \ No newline at end of file +#endif // __MSTD__PACK_HPP__ \ No newline at end of file diff --git a/include/mstd/pack/integer_pack.hpp b/include/mstd/pack/integer_pack.hpp index 0dfa0c8..9490875 100644 --- a/include/mstd/pack/integer_pack.hpp +++ b/include/mstd/pack/integer_pack.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_INTEGER_PACK_HPP__ -#define __MSTD_INTEGER_PACK_HPP__ +#ifndef __MSTD__PACK__INTEGER_PACK_HPP__ +#define __MSTD__PACK__INTEGER_PACK_HPP__ #include #include @@ -99,4 +99,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_INTEGER_PACK_HPP__ +#endif // __MSTD__PACK__INTEGER_PACK_HPP__ diff --git a/include/mstd/pack/integer_pack_details.hpp b/include/mstd/pack/integer_pack_details.hpp index 2da5c9f..f7527e7 100644 --- a/include/mstd/pack/integer_pack_details.hpp +++ b/include/mstd/pack/integer_pack_details.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_INTEGER_PACK_DETAILS_HPP__ -#define __MSTD_INTEGER_PACK_DETAILS_HPP__ +#ifndef __MSTD__PACK__INTEGER_PACK_DETAILS_HPP__ +#define __MSTD__PACK__INTEGER_PACK_DETAILS_HPP__ #include #include @@ -114,9 +114,9 @@ namespace mstd * @tparam F The function to apply. */ template - using pack_zip_t = decltype(pack_zip_impl( - std::make_index_sequence{} - )); + using pack_zip_t = + decltype(pack_zip_impl(std::make_index_sequence{}) + ); /********************* * * @@ -158,4 +158,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_INTEGER_PACK_DETAILS_HPP__ +#endif // __MSTD__PACK__INTEGER_PACK_DETAILS_HPP__ diff --git a/include/mstd/pack/integer_pack_operations.hpp b/include/mstd/pack/integer_pack_operations.hpp index 2b2b600..8c877ad 100644 --- a/include/mstd/pack/integer_pack_operations.hpp +++ b/include/mstd/pack/integer_pack_operations.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_INTEGER_PACK_OPERATIONS_HPP__ -#define __MSTD_INTEGER_PACK_OPERATIONS_HPP__ +#ifndef __MSTD__PACK__INTEGER_PACK_OPERATIONS_HPP__ +#define __MSTD__PACK__INTEGER_PACK_OPERATIONS_HPP__ #include "integer_pack.hpp" #include "integer_pack_details.hpp" @@ -60,4 +60,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_INTEGER_PACK_OPERATIONS_HPP__ \ No newline at end of file +#endif // __MSTD__PACK__INTEGER_PACK_OPERATIONS_HPP__ \ No newline at end of file diff --git a/include/mstd/pack/ratio_pack.hpp b/include/mstd/pack/ratio_pack.hpp index 4ca5ccd..6c6ca0a 100644 --- a/include/mstd/pack/ratio_pack.hpp +++ b/include/mstd/pack/ratio_pack.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_RATIO_PACK_HPP__ -#define __MSTD_RATIO_PACK_HPP__ +#ifndef __MSTD__PACK__RATIO_PACK_HPP__ +#define __MSTD__PACK__RATIO_PACK_HPP__ #include #include @@ -87,4 +87,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_RATIO_PACK_HPP__ +#endif // __MSTD__PACK__RATIO_PACK_HPP__ diff --git a/include/mstd/pack/ratio_pack_details.hpp b/include/mstd/pack/ratio_pack_details.hpp index a9c7360..da9cb58 100644 --- a/include/mstd/pack/ratio_pack_details.hpp +++ b/include/mstd/pack/ratio_pack_details.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_RATIO_PACK_DETAILS_HPP__ -#define __MSTD_RATIO_PACK_DETAILS_HPP__ +#ifndef __MSTD__PACK__RATIO_PACK_DETAILS_HPP__ +#define __MSTD__PACK__RATIO_PACK_DETAILS_HPP__ #include #include @@ -129,4 +129,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_RATIO_PACK_DETAILS_HPP__ +#endif // __MSTD__PACK__RATIO_PACK_DETAILS_HPP__ diff --git a/include/mstd/pack/ratio_pack_operations.hpp b/include/mstd/pack/ratio_pack_operations.hpp index def54af..2742a7e 100644 --- a/include/mstd/pack/ratio_pack_operations.hpp +++ b/include/mstd/pack/ratio_pack_operations.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_RATIO_PACK_OPERATIONS_HPP__ -#define __MSTD_RATIO_PACK_OPERATIONS_HPP__ +#ifndef __MSTD__PACK__RATIO_PACK_OPERATIONS_HPP__ +#define __MSTD__PACK__RATIO_PACK_OPERATIONS_HPP__ #include "ratio_pack.hpp" #include "ratio_pack_details.hpp" @@ -82,4 +82,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_RATIO_PACK_OPERATIONS_HPP__ \ No newline at end of file +#endif // __MSTD__PACK__RATIO_PACK_OPERATIONS_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity.hpp b/include/mstd/quantity.hpp index 1ada8cb..4921cd6 100644 --- a/include/mstd/quantity.hpp +++ b/include/mstd/quantity.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_HPP__ -#define __MSTD_UNITS_HPP__ +#ifndef __MSTD__QUANTITY_HPP__ +#define __MSTD__QUANTITY_HPP__ #include "mstd/error.hpp" // IWYU pragma: export @@ -36,4 +36,4 @@ MSTD_WARN_BUGGY_LIBRARY("mstd/quantity.hpp") #include "quantity/unit_impl.hpp" // IWYU pragma: export #include "quantity/unit_operations.hpp" // IWYU pragma: export -#endif // __MSTD_UNITS_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim.hpp b/include/mstd/quantity/dim.hpp index d7af790..3f0bd5a 100644 --- a/include/mstd/quantity/dim.hpp +++ b/include/mstd/quantity/dim.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_DIMENSION_HPP__ -#define __MSTD_UNITS_DIMENSION_HPP__ +#ifndef __MSTD__QUANTITY__DIM_HPP__ +#define __MSTD__QUANTITY__DIM_HPP__ #include "mstd/error.hpp" @@ -124,4 +124,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNITS_DIMENSION_HPP__ +#endif // __MSTD__QUANTITY__DIM_HPP__ diff --git a/include/mstd/quantity/dim_details.hpp b/include/mstd/quantity/dim_details.hpp index 76ca756..f2e219f 100644 --- a/include/mstd/quantity/dim_details.hpp +++ b/include/mstd/quantity/dim_details.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIM_DETAILS_HPP__ -#define __MSTD_DIM_DETAILS_HPP__ +#ifndef __MSTD__QUANTITY__DIM_DETAILS_HPP__ +#define __MSTD__QUANTITY__DIM_DETAILS_HPP__ #include "mstd/error.hpp" @@ -104,4 +104,4 @@ namespace mstd } // namespace details } // namespace mstd -#endif // __MSTD_DIM_DETAILS_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_DETAILS_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim_impl.hpp b/include/mstd/quantity/dim_impl.hpp index 732ae73..5d1909e 100644 --- a/include/mstd/quantity/dim_impl.hpp +++ b/include/mstd/quantity/dim_impl.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIMENSION_IMPL_HPP__ -#define __MSTD_DIMENSION_IMPL_HPP__ +#ifndef __MSTD__QUANTITY__DIM_IMPL_HPP__ +#define __MSTD__QUANTITY__DIM_IMPL_HPP__ #include "mstd/error.hpp" @@ -129,4 +129,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_DIMENSION_IMPL_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_IMPL_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim_operations.hpp b/include/mstd/quantity/dim_operations.hpp index b8f51ad..e28570e 100644 --- a/include/mstd/quantity/dim_operations.hpp +++ b/include/mstd/quantity/dim_operations.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIM_OPERATIONS_HPP__ -#define __MSTD_DIM_OPERATIONS_HPP__ +#ifndef __MSTD__QUANTITY__DIM_OPERATIONS_HPP__ +#define __MSTD__QUANTITY__DIM_OPERATIONS_HPP__ #include "mstd/error.hpp" @@ -75,4 +75,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_DIM_OPERATIONS_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_OPERATIONS_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim_ratio.hpp b/include/mstd/quantity/dim_ratio.hpp index 87256ba..2584d00 100644 --- a/include/mstd/quantity/dim_ratio.hpp +++ b/include/mstd/quantity/dim_ratio.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIM_RATIO_HPP__ -#define __MSTD_DIM_RATIO_HPP__ +#ifndef __MSTD__QUANTITY__DIM_RATIO_HPP__ +#define __MSTD__QUANTITY__DIM_RATIO_HPP__ #include "mstd/error.hpp" @@ -111,4 +111,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_DIM_RATIO_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_RATIO_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim_ratio_details.hpp b/include/mstd/quantity/dim_ratio_details.hpp index 69783a4..068d2c3 100644 --- a/include/mstd/quantity/dim_ratio_details.hpp +++ b/include/mstd/quantity/dim_ratio_details.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIM_RATIO_DETAILS_HPP__ -#define __MSTD_DIM_RATIO_DETAILS_HPP__ +#ifndef __MSTD__QUANTITY__DIM_RATIO_DETAILS_HPP__ +#define __MSTD__QUANTITY__DIM_RATIO_DETAILS_HPP__ #include "mstd/error.hpp" @@ -89,4 +89,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_DIM_RATIO_DETAILS_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_RATIO_DETAILS_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim_ratio_impl.hpp b/include/mstd/quantity/dim_ratio_impl.hpp index b85084d..4d5bcdd 100644 --- a/include/mstd/quantity/dim_ratio_impl.hpp +++ b/include/mstd/quantity/dim_ratio_impl.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIM_RATIO_IMPL_HPP__ -#define __MSTD_DIM_RATIO_IMPL_HPP__ +#ifndef __MSTD__QUANTITY__DIM_RATIO_IMPL_HPP__ +#define __MSTD__QUANTITY__DIM_RATIO_IMPL_HPP__ #include "mstd/error.hpp" @@ -115,4 +115,4 @@ namespace mstd using angle_dim_ratio = typename angle_dim_ratio_impl::type; } // namespace mstd -#endif // __MSTD_DIM_RATIO_IMPL_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_RATIO_IMPL_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/dim_ratio_operations.hpp b/include/mstd/quantity/dim_ratio_operations.hpp index 63cdec8..ee1625c 100644 --- a/include/mstd/quantity/dim_ratio_operations.hpp +++ b/include/mstd/quantity/dim_ratio_operations.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_DIM_RATIO_OPERATIONS_HPP__ -#define __MSTD_DIM_RATIO_OPERATIONS_HPP__ +#ifndef __MSTD__QUANTITY__DIM_RATIO_OPERATIONS_HPP__ +#define __MSTD__QUANTITY__DIM_RATIO_OPERATIONS_HPP__ #include "mstd/error.hpp" @@ -87,4 +87,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_DIM_RATIO_OPERATIONS_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__DIM_RATIO_OPERATIONS_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/enums.hpp b/include/mstd/quantity/enums.hpp index aa10c83..ab2ca1a 100644 --- a/include/mstd/quantity/enums.hpp +++ b/include/mstd/quantity/enums.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_ENUMS_HPP__ -#define __MSTD_UNITS_ENUMS_HPP__ +#ifndef __MSTD__QUANTITY__ENUMS_HPP__ +#define __MSTD__QUANTITY__ENUMS_HPP__ #include "mstd/error.hpp" @@ -85,4 +85,4 @@ namespace mstd // NOLINTEND } // namespace mstd -#endif // __MSTD_UNITS_ENUMS_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__ENUMS_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/quantity.hpp b/include/mstd/quantity/quantity.hpp index c7ed4cb..f1fed49 100644 --- a/include/mstd/quantity/quantity.hpp +++ b/include/mstd/quantity/quantity.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_QUANTITY_HPP__ -#define __MSTD_UNITS_QUANTITY_HPP__ +#ifndef __MSTD__QUANTITY__QUANTITY_HPP__ +#define __MSTD__QUANTITY__QUANTITY_HPP__ #include "mstd/error.hpp" @@ -365,4 +365,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNITS_QUANTITY_HPP__ +#endif // __MSTD__QUANTITY__QUANTITY_HPP__ diff --git a/include/mstd/quantity/quantity_impl.hpp b/include/mstd/quantity/quantity_impl.hpp index 3294473..4821440 100644 --- a/include/mstd/quantity/quantity_impl.hpp +++ b/include/mstd/quantity/quantity_impl.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_QUANTITY_IMPL_HPP__ -#define __MSTD_UNITS_QUANTITY_IMPL_HPP__ +#ifndef __MSTD__QUANTITY__QUANTITY_IMPL_HPP__ +#define __MSTD__QUANTITY__QUANTITY_IMPL_HPP__ #include "mstd/error.hpp" @@ -97,4 +97,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNITS_QUANTITY_IMPL_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__QUANTITY_IMPL_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/unit.hpp b/include/mstd/quantity/unit.hpp index 9627bb8..b7210f8 100644 --- a/include/mstd/quantity/unit.hpp +++ b/include/mstd/quantity/unit.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_UNIT_HPP__ -#define __MSTD_UNITS_UNIT_HPP__ +#ifndef __MSTD__QUANTITY__UNIT_HPP__ +#define __MSTD__QUANTITY__UNIT_HPP__ #include "mstd/error.hpp" @@ -83,4 +83,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNITS_UNIT_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__UNIT_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/unit_details.hpp b/include/mstd/quantity/unit_details.hpp index 2953ad4..6931004 100644 --- a/include/mstd/quantity/unit_details.hpp +++ b/include/mstd/quantity/unit_details.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_DETAILS_HPP__ -#define __MSTD_UNITS_DETAILS_HPP__ +#ifndef __MSTD__QUANTITY__UNIT_DETAILS_HPP__ +#define __MSTD__QUANTITY__UNIT_DETAILS_HPP__ #include "mstd/error.hpp" @@ -238,4 +238,4 @@ namespace mstd::details } // namespace mstd::details -#endif // __MSTD_UNITS_DETAILS_HPP__ +#endif // __MSTD__QUANTITY__UNIT_DETAILS_HPP__ diff --git a/include/mstd/quantity/unit_impl.hpp b/include/mstd/quantity/unit_impl.hpp index 272a516..9d65afd 100644 --- a/include/mstd/quantity/unit_impl.hpp +++ b/include/mstd/quantity/unit_impl.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNIT_IMPL_HPP__ -#define __MSTD_UNIT_IMPL_HPP__ +#ifndef __MSTD__QUANTITY__UNIT_IMPL_HPP__ +#define __MSTD__QUANTITY__UNIT_IMPL_HPP__ #include "mstd/error.hpp" @@ -208,4 +208,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNIT_IMPL_HPP__ \ No newline at end of file +#endif // __MSTD__QUANTITY__UNIT_IMPL_HPP__ \ No newline at end of file diff --git a/include/mstd/quantity/unit_operations.hpp b/include/mstd/quantity/unit_operations.hpp index 659595c..dc132ea 100644 --- a/include/mstd/quantity/unit_operations.hpp +++ b/include/mstd/quantity/unit_operations.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNIT_OPERATIONS_HPP__ -#define __MSTD_UNIT_OPERATIONS_HPP__ +#ifndef __MSTD__QUANTITY__UNIT_OPERATIONS_HPP__ +#define __MSTD__QUANTITY__UNIT_OPERATIONS_HPP__ #include "mstd/error.hpp" @@ -133,4 +133,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNIT_OPERATIONS_HPP__ +#endif // __MSTD__QUANTITY__UNIT_OPERATIONS_HPP__ diff --git a/include/mstd/ratio.hpp b/include/mstd/ratio.hpp index 612c4e5..4e827b1 100644 --- a/include/mstd/ratio.hpp +++ b/include/mstd/ratio.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_UNITS_RATIO_HPP__ -#define __MSTD_UNITS_RATIO_HPP__ +#ifndef __MSTD__RATIO_HPP__ +#define __MSTD__RATIO_HPP__ #include #include @@ -120,4 +120,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_UNITS_RATIO_HPP__ \ No newline at end of file +#endif // __MSTD__RATIO_HPP__ \ No newline at end of file diff --git a/include/mstd/type_traits.hpp b/include/mstd/type_traits.hpp index af73ccc..913f14e 100644 --- a/include/mstd/type_traits.hpp +++ b/include/mstd/type_traits.hpp @@ -20,12 +20,12 @@ ******************************************************************************/ -#ifndef __MSTD_TYPE_TRAITS_HPP__ -#define __MSTD_TYPE_TRAITS_HPP__ +#ifndef __MSTD__TYPE_TRAITS_HPP__ +#define __MSTD__TYPE_TRAITS_HPP__ #include "type_traits/math_traits.hpp" // IWYU pragma: export #include "type_traits/pack_traits.hpp" // IWYU pragma: export #include "type_traits/quantity_traits.hpp" // IWYU pragma: export #include "type_traits/ratio_traits.hpp" // IWYU pragma: export -#endif // __MSTD_TYPE_TRAITS_HPP__ \ No newline at end of file +#endif // __MSTD__TYPE_TRAITS_HPP__ \ No newline at end of file diff --git a/include/mstd/type_traits/pack_traits.hpp b/include/mstd/type_traits/pack_traits.hpp index 10ef53a..670f399 100644 --- a/include/mstd/type_traits/pack_traits.hpp +++ b/include/mstd/type_traits/pack_traits.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_PACK_TRAITS_HPP__ -#define __MSTD_PACK_TRAITS_HPP__ +#ifndef __MSTD__TYPE_TRAITS__PACK_TRAITS_HPP__ +#define __MSTD__TYPE_TRAITS__PACK_TRAITS_HPP__ #include "ratio_traits.hpp" @@ -64,4 +64,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_PACK_TRAITS_HPP__ \ No newline at end of file +#endif // __MSTD__TYPE_TRAITS__PACK_TRAITS_HPP__ \ No newline at end of file diff --git a/include/mstd/type_traits/quantity_traits.hpp b/include/mstd/type_traits/quantity_traits.hpp index adacc7c..90b2f01 100644 --- a/include/mstd/type_traits/quantity_traits.hpp +++ b/include/mstd/type_traits/quantity_traits.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_TYPE_TRAITS_QUANTITY_TRAITS_HPP__ -#define __MSTD_TYPE_TRAITS_QUANTITY_TRAITS_HPP__ +#ifndef __MSTD__TYPE_TRAITS__QUANTITY_TRAITS_HPP__ +#define __MSTD__TYPE_TRAITS__QUANTITY_TRAITS_HPP__ #include "pack_traits.hpp" #include "ratio_traits.hpp" @@ -125,4 +125,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_TYPE_TRAITS_QUANTITY_TRAITS_HPP__ \ No newline at end of file +#endif // __MSTD__TYPE_TRAITS__QUANTITY_TRAITS_HPP__ \ No newline at end of file diff --git a/include/mstd/type_traits/ratio_traits.hpp b/include/mstd/type_traits/ratio_traits.hpp index a1a85cf..b7ab7d5 100644 --- a/include/mstd/type_traits/ratio_traits.hpp +++ b/include/mstd/type_traits/ratio_traits.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_RATIO_TRAITS_HPP__ -#define __MSTD_RATIO_TRAITS_HPP__ +#ifndef __MSTD__TYPE_TRAITS__RATIO_TRAITS_HPP__ +#define __MSTD__TYPE_TRAITS__RATIO_TRAITS_HPP__ /** * @file ratio_traits.hpp @@ -50,4 +50,4 @@ namespace mstd } // namespace mstd -#endif // __MSTD_RATIO_TRAITS_HPP__ \ No newline at end of file +#endif // __MSTD__TYPE_TRAITS__RATIO_TRAITS_HPP__ \ No newline at end of file diff --git a/scripts/cppcheck.sh b/scripts/cppcheck.sh index 94769a7..7bd72cf 100755 --- a/scripts/cppcheck.sh +++ b/scripts/cppcheck.sh @@ -10,3 +10,5 @@ cppcheck --enable=all \ --inconclusive \ -I include \ include test + +cpp_checks --dirs include --dirs test diff --git a/test/quantity/test_utils.hpp b/test/quantity/test_utils.hpp index 6b61afb..23479e5 100644 --- a/test/quantity/test_utils.hpp +++ b/test/quantity/test_utils.hpp @@ -20,8 +20,8 @@ ******************************************************************************/ -#ifndef __MSTD_TEST_UTILS_HPP__ -#define __MSTD_TEST_UTILS_HPP__ +#ifndef __QUANTITY__TEST_UTILS_HPP__ +#define __QUANTITY__TEST_UTILS_HPP__ #include @@ -30,4 +30,4 @@ STATIC_REQUIRE(__VA_ARGS__) \ /* NOLINTEND */ -#endif // __MSTD_TEST_UTILS_HPP__ +#endif // __QUANTITY__TEST_UTILS_HPP__ From b0d66e39f8d27a883ddb8b3c218aeb9bddebcb81 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sat, 20 Dec 2025 22:50:23 +0100 Subject: [PATCH 110/115] chore: cleanup header guards to adhere to folder and file structure --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e359c..301d2b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ All notable changes to this project will be documented in this file. - Add exhaustive error flags for compilation - Add checking of doxygen comments via building docs (no docs is building for gh pages - yet) +### Cleanup + +- Cleanup header guards to follow common rule with folder and file structure + ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 From 559d5fd5ec9e4311194dc748de4bf3cae7dd5ae5 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 8 Feb 2026 11:37:27 +0100 Subject: [PATCH 111/115] feat: introduce enum traits for better metadata handling and API improvements --- .vscode/settings.json | 7 +++- CHANGELOG.md | 6 ++++ include/mstd/enum.hpp | 18 +++++++++-- include/mstd/type_traits/enum_traits.hpp | 41 ++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 include/mstd/type_traits/enum_traits.hpp diff --git a/.vscode/settings.json b/.vscode/settings.json index e3381ec..3aabd6d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -109,6 +109,11 @@ "csignal": "cpp", "list": "cpp", "text_encoding": "cpp", - "__locale": "cpp" + "__locale": "cpp", + "__hash_table": "cpp", + "__split_buffer": "cpp", + "__tree": "cpp", + "queue": "cpp", + "stack": "cpp" }, } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 301d2b8..9f8dd22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,12 @@ All notable changes to this project will be documented in this file. - Cleanup header guards to follow common rule with folder and file structure +### Enums + +- Introduce type traits for mstd enums: `using EnumMeta = typename enum_meta::type` +- Make `EnumMeta::index` return std::optional instead of -1 in case of error +- Add a `values_view` to `EnumMeta` returning a `std::span` for having a nicer API in special cases + ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index ae3e432..f0bbf52 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -26,9 +26,12 @@ #include // IWYU pragma: keep #include // IWYU pragma: keep #include // IWYU pragma: keep +#include // IWYU pragma: keep #include // IWYU pragma: keep #include // IWYU pragma: keep +#include "mstd/type_traits/enum_traits.hpp" // IWYU pragma: keep + // // Element expanders // @@ -60,6 +63,11 @@ static constexpr auto values = \ std::to_array({LIST(MSTD_ENUM_MAKE_VALUE)}); \ \ + static constexpr std::span values_view() \ + { \ + return values; \ + } \ + \ static constexpr auto names = \ std::to_array({LIST(MSTD_ENUM_MAKE_STRING)}); \ \ @@ -91,13 +99,19 @@ return static_cast(e); \ } \ \ - static constexpr std::size_t index(EnumName e) \ + static constexpr std::optional index(EnumName e) \ { \ for (std::size_t i = 0; i < size; ++i) \ if (values[i] == e) \ return i; \ - return static_cast(-1); \ + return std::nullopt; \ } \ + }; \ + \ + template <> \ + struct enum_meta \ + { \ + using type = EnumName##Meta; \ }; #endif // __MSTD__ENUM_HPP__ \ No newline at end of file diff --git a/include/mstd/type_traits/enum_traits.hpp b/include/mstd/type_traits/enum_traits.hpp new file mode 100644 index 0000000..0f91009 --- /dev/null +++ b/include/mstd/type_traits/enum_traits.hpp @@ -0,0 +1,41 @@ +#ifndef __TYPE_TRAITS__ENUM_TRAITS_HPP__ +#define __TYPE_TRAITS__ENUM_TRAITS_HPP__ + +#include + +// NOTE: here we omit the namespace mstd to avoid problems with ADL +// because the whole mstd enum macro definition relies on the enum_meta struct +// being in the same namespace as the enum itself + +/** + * @brief A traits class for enums defined with MSTD_ENUM + * + * This class is specialized for each enum defined with MSTD_ENUM, providing + * metadata about the enum such as its underlying type, values, and names. + * + * @tparam E The enum type + */ +template +struct enum_meta; + +/** + * @brief A helper type alias to extract the enum metadata type + * + * @tparam E The enum type + */ +template +using enum_meta_t = typename enum_meta::type; + +/** + * @brief A concept to check if a type has enum metadata + * + * This concept checks if a type is an enum and has a corresponding + * enum_meta specialization, which is true for enums defined with MSTD_ENUM. + * + * @tparam E The type to check + */ +template +concept has_enum_meta = + std::is_enum_v && requires { typename enum_meta_t; }; + +#endif // __TYPE_TRAITS__ENUM_TRAITS_HPP__ \ No newline at end of file From 2b39de61c253a8070c4d1f29c5a4e4973413ebaf Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 8 Feb 2026 11:41:44 +0100 Subject: [PATCH 112/115] feat: add missing include for enum_traits in type_traits.hpp --- include/mstd/type_traits.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mstd/type_traits.hpp b/include/mstd/type_traits.hpp index 913f14e..4449fe5 100644 --- a/include/mstd/type_traits.hpp +++ b/include/mstd/type_traits.hpp @@ -23,6 +23,7 @@ #ifndef __MSTD__TYPE_TRAITS_HPP__ #define __MSTD__TYPE_TRAITS_HPP__ +#include "type_traits/enum_traits.hpp" // IWYU pragma: export #include "type_traits/math_traits.hpp" // IWYU pragma: export #include "type_traits/pack_traits.hpp" // IWYU pragma: export #include "type_traits/quantity_traits.hpp" // IWYU pragma: export From 5866fd2eef430400f1203d80f901c73c623b240f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 8 Feb 2026 11:49:00 +0100 Subject: [PATCH 113/115] refactor: reorganize enum_traits.hpp for improved readability and structure --- include/mstd/type_traits/enum_traits.hpp | 62 ++++++++++++------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/include/mstd/type_traits/enum_traits.hpp b/include/mstd/type_traits/enum_traits.hpp index 0f91009..fa62563 100644 --- a/include/mstd/type_traits/enum_traits.hpp +++ b/include/mstd/type_traits/enum_traits.hpp @@ -3,39 +3,39 @@ #include -// NOTE: here we omit the namespace mstd to avoid problems with ADL -// because the whole mstd enum macro definition relies on the enum_meta struct -// being in the same namespace as the enum itself +namespace mstd +{ + /** + * @brief A traits class for enums defined with MSTD_ENUM + * + * This class is specialized for each enum defined with MSTD_ENUM, providing + * metadata about the enum such as its underlying type, values, and names. + * + * @tparam E The enum type + */ + template + struct enum_meta; -/** - * @brief A traits class for enums defined with MSTD_ENUM - * - * This class is specialized for each enum defined with MSTD_ENUM, providing - * metadata about the enum such as its underlying type, values, and names. - * - * @tparam E The enum type - */ -template -struct enum_meta; + /** + * @brief A helper type alias to extract the enum metadata type + * + * @tparam E The enum type + */ + template + using enum_meta_t = typename enum_meta::type; -/** - * @brief A helper type alias to extract the enum metadata type - * - * @tparam E The enum type - */ -template -using enum_meta_t = typename enum_meta::type; + /** + * @brief A concept to check if a type has enum metadata + * + * This concept checks if a type is an enum and has a corresponding + * enum_meta specialization, which is true for enums defined with MSTD_ENUM. + * + * @tparam E The type to check + */ + template + concept has_enum_meta = + std::is_enum_v && requires { typename enum_meta_t; }; -/** - * @brief A concept to check if a type has enum metadata - * - * This concept checks if a type is an enum and has a corresponding - * enum_meta specialization, which is true for enums defined with MSTD_ENUM. - * - * @tparam E The type to check - */ -template -concept has_enum_meta = - std::is_enum_v && requires { typename enum_meta_t; }; +} // namespace mstd #endif // __TYPE_TRAITS__ENUM_TRAITS_HPP__ \ No newline at end of file From 33c93b630a4475ddf08c73be43be3f88cd2243b2 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 8 Feb 2026 11:53:28 +0100 Subject: [PATCH 114/115] fix: update enum_meta struct to include namespace and improve header guard consistency --- include/mstd/enum.hpp | 2 +- include/mstd/type_traits/enum_traits.hpp | 28 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index f0bbf52..036f6bf 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -109,7 +109,7 @@ }; \ \ template <> \ - struct enum_meta \ + struct mstd::enum_meta \ { \ using type = EnumName##Meta; \ }; diff --git a/include/mstd/type_traits/enum_traits.hpp b/include/mstd/type_traits/enum_traits.hpp index fa62563..b4e30f9 100644 --- a/include/mstd/type_traits/enum_traits.hpp +++ b/include/mstd/type_traits/enum_traits.hpp @@ -1,5 +1,27 @@ -#ifndef __TYPE_TRAITS__ENUM_TRAITS_HPP__ -#define __TYPE_TRAITS__ENUM_TRAITS_HPP__ +/***************************************************************************** + + + mstd library + Copyright (C) 2025-now Jakob Gamper + + This program 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. + + This program 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 . + + +******************************************************************************/ + +#ifndef __MSTD__TYPE_TRAITS__ENUM_TRAITS_HPP__ +#define __MSTD__TYPE_TRAITS__ENUM_TRAITS_HPP__ #include @@ -38,4 +60,4 @@ namespace mstd } // namespace mstd -#endif // __TYPE_TRAITS__ENUM_TRAITS_HPP__ \ No newline at end of file +#endif // __MSTD__TYPE_TRAITS__ENUM_TRAITS_HPP__ \ No newline at end of file From dcdd765bdc9194b322120be4b6f703068b115fd5 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 8 Feb 2026 12:04:08 +0100 Subject: [PATCH 115/115] refactor: simplify enum_meta implementation and improve type alias for metadata extraction --- include/mstd/enum.hpp | 6 +----- include/mstd/type_traits/enum_traits.hpp | 15 ++------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index 036f6bf..e2cb3c3 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -108,10 +108,6 @@ } \ }; \ \ - template <> \ - struct mstd::enum_meta \ - { \ - using type = EnumName##Meta; \ - }; + static constexpr EnumName##Meta enum_meta(EnumName) { return {}; } #endif // __MSTD__ENUM_HPP__ \ No newline at end of file diff --git a/include/mstd/type_traits/enum_traits.hpp b/include/mstd/type_traits/enum_traits.hpp index b4e30f9..e00cff4 100644 --- a/include/mstd/type_traits/enum_traits.hpp +++ b/include/mstd/type_traits/enum_traits.hpp @@ -27,24 +27,13 @@ namespace mstd { - /** - * @brief A traits class for enums defined with MSTD_ENUM - * - * This class is specialized for each enum defined with MSTD_ENUM, providing - * metadata about the enum such as its underlying type, values, and names. - * - * @tparam E The enum type - */ - template - struct enum_meta; - /** * @brief A helper type alias to extract the enum metadata type * * @tparam E The enum type */ - template - using enum_meta_t = typename enum_meta::type; + template + using enum_meta_t = decltype(enum_meta(std::declval())); /** * @brief A concept to check if a type has enum metadata