Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
acc4a71
feat: add ResultType and check_key_sequence_ordered function for key …
97gamjak Nov 17, 2025
1147f79
feat: implement C++ type checking utilities and rules; add ResultType…
97gamjak Nov 17, 2025
f5f4c1e
chore: add .gitignore file to exclude Python cache and ruff cache files
97gamjak Nov 18, 2025
5fc9baa
feat: update addLicense.sh to include Python files in license additio…
97gamjak Nov 21, 2025
ef0aefa
chore: clean up ruff.toml by removing unused configurations and updat…
97gamjak Nov 21, 2025
21f4782
feat: add GPL license headers, refactor C++ checks, and implement fil…
97gamjak Nov 21, 2025
a3b25a7
refactor: start of centralizing all checks for mstd library into a si…
97gamjak Nov 22, 2025
37ab793
refactor: cleanup checks package
97gamjak Nov 23, 2025
ad54596
refactor: remove egg-info metadata files for checks package
97gamjak Nov 23, 2025
3e5df2e
feat: update .gitignore, add pytest dependency, and implement FileTyp…
97gamjak Nov 23, 2025
bb16326
refactor: reorganize result types and rules, update logging configura…
97gamjak Nov 23, 2025
56b718a
refactor: enhance C++ rule checks, improve key sequence validation, a…
97gamjak Nov 24, 2025
66b3ab9
refactor: remove unused C++ rules, enhance file type handling, and im…
97gamjak Nov 24, 2025
f28ba1f
refactor: update run_line_checks to return results and improve loggin…
97gamjak Nov 25, 2025
05299cb
feat: first working solution of cpp line checks with static inline co…
97gamjak Nov 25, 2025
477d8e4
Merge remote-tracking branch 'origin/dev' into MSTD-28-add-custom-fil…
97gamjak Nov 25, 2025
602e1f9
refactor: adjust cpow function declaration to have correct keyword se…
97gamjak Nov 25, 2025
fcda560
docs: update changelog with new MSTD-CHECKS features and cpp rule add…
97gamjak Nov 25, 2025
f28f0a6
Update checks/src/checks/rules/rules.py
97gamjak Nov 26, 2025
2e17296
Update checks/src/checks/ruff.toml
97gamjak Nov 26, 2025
2070438
Update checks/src/checks/enums.py
97gamjak Nov 26, 2025
5651a18
Update checks/src/checks/rules/rules.py
97gamjak Nov 26, 2025
630408f
fix: correct type hint for func parameter in Rule class constructor
97gamjak Nov 26, 2025
e00eb65
refactor: remove unused enums module for C++ checks
97gamjak Nov 26, 2025
2d9f7e2
fix: remove trailing period from comments in ruff.toml
97gamjak Nov 26, 2025
70a15aa
fix: optimize file type determination in run_line_checks function
97gamjak Nov 26, 2025
e0ca8a3
fix: make check_key_sequence_ordered function more robust and add uti…
97gamjak Nov 26, 2025
b0044db
fix: bugfix for new check_order_sequence function
97gamjak Nov 27, 2025
c0ff894
fix: remove unused Callable import in rules.py
97gamjak Nov 27, 2025
91a28be
Initial plan
Copilot Nov 27, 2025
9d5e36a
Initial plan
Copilot Nov 27, 2025
8fb9990
test: add comprehensive tests for CheckKeySeqOrder and C++ style rules
Copilot Nov 27, 2025
d27105a
feat: add comprehensive tests for Rule class and C++ style rules
Copilot Nov 27, 2025
17a891a
Merge pull request #51 from 97gamjak/copilot/sub-pr-46-again
97gamjak Nov 27, 2025
da459e3
Merge remote-tracking branch 'origin/MSTD-28-add-custom-file-rule-pyt…
97gamjak Nov 27, 2025
abcb38a
Merge pull request #50 from 97gamjak/copilot/sub-pr-46
97gamjak Nov 27, 2025
838701e
fix: import Callable for type checking in rules module
97gamjak Nov 27, 2025
c77507c
Update checks/src/checks/files/files.py
97gamjak Nov 28, 2025
c055446
Update checks/src/checks/utils/utils.py
97gamjak Nov 28, 2025
df813b6
Update checks/src/checks/ruff.toml
97gamjak Nov 28, 2025
df251a3
Update checks/src/checks/utils/utils.py
97gamjak Nov 28, 2025
434ccab
Update checks/src/checks/rules/rules.py
97gamjak Nov 28, 2025
e8262b4
Update checks/src/checks/utils/utils.py
97gamjak Nov 28, 2025
42eca12
Update checks/tests/files/test_files.py
97gamjak Nov 28, 2025
cd8f294
Update checks/src/checks/cpp/style_rules.py
97gamjak Nov 28, 2025
38860c9
refactor: get_staged_files should return list[Path] instead of list[str]
97gamjak Nov 28, 2025
0dc6fa2
fix: add max_recursion parameter to get_files_in_dirs for better cont…
97gamjak Nov 28, 2025
3a9f248
doc: enhance docstring in run_checks for clarity on parameters and be…
97gamjak Nov 28, 2025
0041755
Update checks/tests/cpp/test_style_rules.py
97gamjak Nov 28, 2025
3342e26
Update checks/tests/cpp/test_style_rules.py
97gamjak Nov 28, 2025
6396e85
Initial plan
Copilot Nov 28, 2025
f843aa4
feat: add comprehensive tests for cpp_checks script functions
Copilot Nov 28, 2025
00937a9
Merge pull request #52 from 97gamjak/copilot/sub-pr-46-another-one
97gamjak Nov 28, 2025
640fc0b
fix: simplify argument handling in Rule.apply method
97gamjak Nov 28, 2025
b4e86c5
fix: initialize found_indices variable within the loop in check_key_s…
97gamjak Nov 28, 2025
4c26c8e
Update checks/tests/files/test_files.py
97gamjak Nov 29, 2025
b786604
Update CHANGELOG.md
97gamjak Nov 29, 2025
52bbbad
Update checks/src/checks/files/files.py
97gamjak Nov 29, 2025
fccf2f6
Update checks/src/checks/utils/utils.py
97gamjak Nov 29, 2025
3a80c3f
feat: add error handling in check_key_sequence_ordered and include is…
97gamjak Nov 29, 2025
2fadb6a
fix: correct logic in check_key_sequence_ordered to properly track fo…
97gamjak Nov 29, 2025
49cdbfd
fix: remove TODO comment from pylint.max-args in ruff.toml
97gamjak Nov 29, 2025
d56c7ee
refactor: update type hints for paths in get_files_in_dirs and determ…
97gamjak Nov 29, 2025
9b79b54
fix: update apply method signature to accept variable arguments
97gamjak Nov 29, 2025
3fd8956
fix: update apply method signature to accept a tuple for arguments
97gamjak Nov 29, 2025
6aca498
Initial plan
Copilot Nov 29, 2025
beb2be7
feat: add comprehensive test cases for check_key_sequence_ordered
Copilot Nov 29, 2025
e94b415
fix: correct test case for keys appearing multiple times
Copilot Nov 29, 2025
1717248
Merge pull request #53 from 97gamjak/copilot/sub-pr-46-yet-again
97gamjak Nov 29, 2025
b094cd7
Merge pull request #46 from 97gamjak/MSTD-28-add-custom-file-rule-pyt…
97gamjak Nov 29, 2025
1ba9a3d
feat: add github module to mstd checks
97gamjak Nov 29, 2025
73afc0c
chore: update uv.lock and .gitignore for python packaging and adding …
97gamjak Nov 29, 2025
3c75947
feat: add general file settings config - for now only default encoding
97gamjak Nov 29, 2025
9419a50
feat: add option for rich printing
97gamjak Nov 29, 2025
7d82703
refactor: clean up a bit general logging debug handling
97gamjak Nov 29, 2025
da4cf8d
feat: add MSTDFileNotFoundError exception for handling missing files
97gamjak Nov 29, 2025
e84f582
feat: implement changelog update functionality with command-line inte…
97gamjak Nov 29, 2025
ab3b84a
docs: update CHANGELOG.md and add update_changelog.py info
97gamjak Nov 29, 2025
9c00f15
docs: clarify description of update_changelog.py in CHANGELOG.md
97gamjak Nov 29, 2025
0397432
Update checks/src/checks/files/update_changelog.py
97gamjak Nov 29, 2025
5e54a21
chore: add clarifying comment why update_changelog need new lines
97gamjak Nov 29, 2025
53e724c
Merge branch 'MSTD-38-transfer-update_changelog.py-to-checks-library'…
97gamjak Nov 29, 2025
1430855
Update checks/src/checks/files/update_changelog.py
97gamjak Nov 29, 2025
73f653e
Revert "refactor: clean up a bit general logging debug handling"
97gamjak Nov 29, 2025
899a1fb
Initial plan
Copilot Nov 29, 2025
a882def
test: add comprehensive tests for update_changelog module
Copilot Nov 29, 2025
0e63f1e
Merge pull request #59 from 97gamjak/copilot/sub-pr-54
97gamjak Nov 29, 2025
4c4c159
Merge pull request #54 from 97gamjak/MSTD-38-transfer-update_changelo…
97gamjak Nov 29, 2025
fdff7f1
Initial plan
Copilot Dec 1, 2025
a5a4ac7
Add Doxygen documentation support
Copilot Dec 1, 2025
8d24bc5
Remove redundant DOXYGEN_FOUND check in CMakeLists.txt
Copilot Dec 1, 2025
eb271fa
Merge pull request #60 from 97gamjak/copilot/add-doxygen-docs
97gamjak Dec 1, 2025
e8ebd12
Initial plan
Copilot Dec 2, 2025
3e8d51e
Add cppcheck and clang-tidy static analysis workflow
Copilot Dec 2, 2025
4d76416
Restore compile_commands.json symlink
Copilot Dec 2, 2025
6c7338f
Add explicit permissions to static analysis workflow
Copilot Dec 2, 2025
c952138
Fix: cppcheck suppression for missing system includes
97gamjak Dec 7, 2025
5d455af
Fix: update .gitignore to include compile_commands.json and remove sy…
97gamjak Dec 7, 2025
55b9706
fix: Enhance static analysis configuration and add cppcheck script
97gamjak Dec 10, 2025
795b9de
Merge pull request #65 from 97gamjak/fix_cpp_errors
97gamjak Dec 10, 2025
5ff87f3
feat: Add include guards to new compile.hpp; enhance error.hpp and qu…
97gamjak Dec 11, 2025
e7f7839
Update include/mstd/error.hpp
97gamjak Dec 11, 2025
84ff357
Update include/mstd/error.hpp
97gamjak Dec 11, 2025
3c59c27
feat: Add documentation for MSTD_IGNORE_BUGGY_CODE macro and enhance …
97gamjak Dec 11, 2025
c3d4c23
Merge branch 'feature/MSTD-65-create-buggy-static-asser-for-single-fi…
97gamjak Dec 11, 2025
d44a152
docs: Update CHANGELOG.md to include new error handling and compilati…
97gamjak Dec 11, 2025
d003e44
Merge pull request #70 from 97gamjak/feature/MSTD-65-create-buggy-sta…
97gamjak Dec 11, 2025
0bce819
refactor: rename mstd_checks to devosp
97gamjak Dec 11, 2025
2ccfb50
docs: update section title from MSTD-CHECKS to DevOps in CHANGELOG.md…
97gamjak Dec 11, 2025
d686c2e
Merge pull request #75 from 97gamjak/feature/MSTD-72-rename-mstd-chec…
97gamjak Dec 11, 2025
d46da76
refactor: extracting devops to separate package
97gamjak Dec 11, 2025
fa31d9e
feat: add devops submodule for better integration
97gamjak Dec 20, 2025
9f8f869
Merge pull request #77 from 97gamjak/feature/MSTD-80-include-devops-r…
97gamjak Dec 20, 2025
e59f872
Merge remote-tracking branch 'origin/dev' into copilot/add-cpp-check-…
97gamjak Dec 20, 2025
ece5ce8
feat: enhance static analysis workflow and add buggy header warnings
97gamjak Dec 20, 2025
8880701
feat: update buggy marker variables to include library and header names
97gamjak Dec 20, 2025
b67d5de
feat: update buggy marker macros to use library and header names in n…
97gamjak Dec 20, 2025
7a432b1
feat: enhance buggy library and header warnings with unique namespace…
97gamjak Dec 20, 2025
51cff2a
feat: update lie potential evaluation method for clarity and consistency
97gamjak Dec 20, 2025
5fca45b
feat: streamline static analysis workflow by removing clang-tidy and …
97gamjak Dec 20, 2025
1f7367b
Merge pull request #62 from 97gamjak/copilot/add-cpp-check-clang-ci
97gamjak Dec 20, 2025
5ac05f4
feat: enhance release version extraction and hotfix handling in CI wo…
97gamjak Dec 20, 2025
820172e
Merge pull request #78 from 97gamjak/MSTD-40-Update-release-ci-for-ch…
97gamjak Dec 20, 2025
c5a5bd0
feat: enable comprehensive warnings and errors for GNU compiler; fix …
97gamjak Dec 20, 2025
3509f07
docs: add exhaustive error flags for compilation in changelog
97gamjak Dec 20, 2025
0ceb686
Merge pull request #79 from 97gamjak/feature/MSTD-68-enable-all-kind-…
97gamjak Dec 20, 2025
bdbe345
feat: update Doxygen configuration and add GitHub Actions workflow fo…
97gamjak Dec 20, 2025
006654d
fix: rename workflow to DOCS and add Doxygen installation step
97gamjak Dec 20, 2025
5f5bc57
Merge pull request #80 from 97gamjak/feature/MSTD-81-udpate-devops-to…
97gamjak Dec 20, 2025
2f0d293
feat: add header guards according to filepath and update related files
97gamjak Dec 20, 2025
b0d66e3
chore: cleanup header guards to adhere to folder and file structure
97gamjak Dec 20, 2025
95141c0
Merge pull request #81 from 97gamjak/feature/MSTD-23-add-ci-to-check-…
97gamjak Dec 20, 2025
559d5fd
feat: introduce enum traits for better metadata handling and API impr…
97gamjak Feb 8, 2026
2b39de6
feat: add missing include for enum_traits in type_traits.hpp
97gamjak Feb 8, 2026
5866fd2
refactor: reorganize enum_traits.hpp for improved readability and str…
97gamjak Feb 8, 2026
33c93b6
fix: update enum_meta struct to include namespace and improve header …
97gamjak Feb 8, 2026
dcdd765
refactor: simplify enum_meta implementation and improve type alias fo…
97gamjak Feb 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .cppcheck.suppress
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
unusedFunction
unusedStructMember
unusedFunction
24 changes: 24 additions & 0 deletions .devops.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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
license_header = "config/licenseHeader.txt"
header_guards_according_to_filepath = true

[file]
#encoding = "utf-8"
21 changes: 16 additions & 5 deletions .github/workflows/check-pr-for-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
49 changes: 44 additions & 5 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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"

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: DOCS

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: 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
make docs # at the moment only building docs to verify no doc-related build issues
env:
CC: gcc-14
CXX: g++-14
60 changes: 60 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Static Analysis

on:
pull_request:
branches:
- '*'
workflow_dispatch:

permissions:
contents: read

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 \
--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
steps:
- uses: actions/checkout@v4
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: |
cpp_checks --dirs include --dirs test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.build
build
.cache
checks.egg-info/
__pycache__/
.venv
docs/output/
compile_commands.json
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
"__nullptr": "cpp",
"csignal": "cpp",
"list": "cpp",
"text_encoding": "cpp"
"text_encoding": "cpp",
"__locale": "cpp",
"__hash_table": "cpp",
"__split_buffer": "cpp",
"__tree": "cpp",
"queue": "cpp",
"stack": "cpp"
},
}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file.

## Next Release

### CI

- Add devops python library first version for all kind of custom static code analysis
- 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

- 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
- 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

### Enums

- Introduce type traits for mstd enums: `using EnumMeta = typename enum_meta<Enum>::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

<!-- insertion marker -->
## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20

Expand Down
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,10 +22,58 @@ 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()
add_subdirectory(test)
else()
message(STATUS "Tests are disabled. Set MSTD_BUILD_TESTS to ON to enable them.")
endif()

if(MSTD_BUILD_DOCS)
find_package(Doxygen REQUIRED)
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()
1 change: 0 additions & 1 deletion compile_commands.json

This file was deleted.

Loading