Skip to content

Commit 3aa3b70

Browse files
refactor: housekeeping, Google C++ style, and documentation
- Switch from LLVM to Google C++ style (.clang-format) - Add .editorconfig for non-C++ files - Rename Dockerfile to Containerfile (OCI-native), add symlink - Rename README_docker.md to README_container.md (runtime-agnostic) - Simplify .gitignore JetBrains section to just .idea/ - Remove FUNDING.yml, .gitlab-ci.yml, and stale references - Add fuzz_test/README.md with libFuzzer usage guide - Remove dead CMakePresets.json variables (ENABLE_DEVELOPER_MODE, etc.) - Lower CMake minimum from 3.29 to 3.21 (guard CMP0155 policy) - Update READMEs: C++23, CMake 3.21+, VS 2022, setup-cpp v1.8.0 - Update badges and links to VersatusHPC/cmake_template - Add proper acknowledgement for cpp-best-practices - Fix WASM deploy to support both main and master branches Signed-off-by: Helder Ferreira <helder@versatushpc.com.br> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4e51d93 commit 3aa3b70

35 files changed

Lines changed: 575 additions & 611 deletions

.clang-format

Lines changed: 21 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,25 @@
11
---
2-
BasedOnStyle: LLVM
3-
Language: Json
4-
IndentWidth: 4
5-
UseTab: Never
6-
---
7-
Language: Cpp
8-
AccessModifierOffset: -2
9-
AlignAfterOpenBracket: DontAlign
10-
AlignConsecutiveAssignments: false
11-
AlignConsecutiveDeclarations: false
12-
AlignEscapedNewlines: Left
13-
AlignOperands: true
14-
AlignTrailingComments: false
15-
AllowAllParametersOfDeclarationOnNextLine: false
16-
AllowShortBlocksOnASingleLine: true
17-
AllowShortCaseLabelsOnASingleLine: false
18-
AllowShortFunctionsOnASingleLine: All
19-
AllowShortIfStatementsOnASingleLine: true
20-
AllowShortLoopsOnASingleLine: true
21-
AlwaysBreakAfterDefinitionReturnType: None
22-
AlwaysBreakAfterReturnType: None
23-
AlwaysBreakBeforeMultilineStrings: true
24-
AlwaysBreakTemplateDeclarations: false
25-
BinPackArguments: false
26-
BinPackParameters: false
27-
BraceWrapping:
28-
AfterClass: true
29-
AfterControlStatement: false
30-
AfterEnum: false
31-
AfterFunction: true
32-
AfterNamespace: false
33-
AfterObjCDeclaration: false
34-
AfterStruct: true
35-
AfterUnion: false
36-
BeforeCatch: false
37-
BeforeElse: false
38-
IndentBraces: false
39-
SplitEmptyFunction: false
40-
SplitEmptyNamespace: true
41-
SplitEmptyRecord: true
42-
BreakAfterJavaFieldAnnotations: true
43-
BreakBeforeBinaryOperators: NonAssignment
44-
BreakBeforeBraces: Custom
45-
BreakBeforeInheritanceComma: true
46-
BreakBeforeTernaryOperators: true
47-
BreakConstructorInitializers: BeforeColon
48-
BreakConstructorInitializersBeforeComma: false
49-
BreakStringLiterals: true
50-
ColumnLimit: 120
51-
CommentPragmas: '^ IWYU pragma:'
52-
CompactNamespaces: false
53-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
54-
ConstructorInitializerIndentWidth: 2
55-
ContinuationIndentWidth: 2
2+
# VersatusHPC C++ style
3+
# Base: Google, with readability tweaks for enums, initializer lists,
4+
# and constructor initializers.
5+
BasedOnStyle: Google
6+
Language: Cpp
7+
8+
# Enums: one enumerator per line
9+
AllowShortEnumsOnASingleLine: false
10+
11+
# Constructor initializer lists: one per line, comma-first
12+
BreakConstructorInitializers: BeforeComma
13+
PackConstructorInitializers: Never
14+
15+
# Spaces inside braces on initializer lists: { x, y } not {x, y}
5616
Cpp11BracedListStyle: false
57-
DerivePointerAlignment: false
58-
DisableFormat: false
59-
ExperimentalAutoDetectBinPacking: true
60-
FixNamespaceComments: true
61-
ForEachMacros:
62-
- foreach
63-
- Q_FOREACH
64-
- BOOST_FOREACH
65-
IncludeCategories:
66-
- Priority: 2
67-
Regex: ^"(llvm|llvm-c|clang|clang-c)/
68-
- Priority: 3
69-
Regex: ^(<|"(gtest|gmock|isl|json)/)
70-
- Priority: 1
71-
Regex: .*
72-
IncludeIsMainRegex: (Test)?$
73-
IndentCaseLabels: false
17+
18+
# Keep the rest Google-default but be explicit on a few things
19+
ColumnLimit: 80
7420
IndentWidth: 2
75-
IndentWrappedFunctionNames: true
76-
JavaScriptQuotes: Leave
77-
JavaScriptWrapImports: true
78-
KeepEmptyLinesAtTheStartOfBlocks: true
79-
MacroBlockBegin: ''
80-
MacroBlockEnd: ''
81-
MaxEmptyLinesToKeep: 2
82-
NamespaceIndentation: Inner
83-
ObjCBlockIndentWidth: 7
84-
ObjCSpaceAfterProperty: true
85-
ObjCSpaceBeforeProtocolList: false
86-
PointerAlignment: Right
87-
ReflowComments: true
88-
SortIncludes: true
89-
SortUsingDeclarations: false
90-
SpaceAfterCStyleCast: false
91-
SpaceAfterTemplateKeyword: false
92-
SpaceBeforeAssignmentOperators: true
93-
SpaceBeforeParens: ControlStatements
94-
SpaceInEmptyParentheses: false
95-
SpacesBeforeTrailingComments: 0
96-
SpacesInAngles: false
97-
SpacesInCStyleCastParentheses: false
98-
SpacesInContainerLiterals: true
99-
SpacesInParentheses: false
100-
SpacesInSquareBrackets: false
101-
Standard: c++20
102-
TabWidth: 8
10321
UseTab: Never
22+
PointerAlignment: Left
23+
DerivePointerAlignment: false
24+
Standard: Latest
25+
...

.devcontainer/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ build/
33
out/
44
cmake-build-*/
55

6-
# User spesific settings
6+
# User specific settings
77
CMakeUserPresets.json
88

99
# IDE files
@@ -31,4 +31,5 @@ $RECYCLE.BIN/
3131
.TemporaryItems
3232
ehthumbs.db
3333
Thumbs.db
34+
Containerfile
3435
Dockerfile

.devcontainer/Containerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Red Hat Universal Base Image 10
2+
FROM registry.access.redhat.com/ubi10/ubi
3+
4+
# Enable required repositories
5+
RUN dnf install -y 'dnf-command(config-manager)' && \
6+
dnf config-manager --enable ubi-10-codeready-builder-rpms && \
7+
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
8+
9+
# Core build tools
10+
RUN dnf install -y \
11+
make ninja-build cmake ccache git git-lfs \
12+
python3 python3-pip wget zip unzip rsync \
13+
openssh-clients file
14+
15+
# GCC 14 (system) + GCC 15 (toolset)
16+
RUN dnf install -y gcc gcc-c++ gdb \
17+
gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ gcc-toolset-15-binutils
18+
19+
# LLVM / Clang
20+
RUN dnf install -y \
21+
llvm-toolset clang clang-tools-extra clang-devel llvm-devel lld lldb
22+
23+
# Static analysis and documentation
24+
RUN dnf install -y cppcheck doxygen graphviz
25+
26+
# Editors
27+
RUN dnf install -y neovim nano
28+
29+
# Python packages
30+
RUN python3 -m pip install --upgrade pip setuptools && \
31+
python3 -m pip install conan && \
32+
conan --version
33+
34+
# Conan configuration for containers
35+
ENV CONAN_SYSREQUIRES_SUDO=0 \
36+
CONAN_SYSREQUIRES_MODE=enabled
37+
38+
# include-what-you-use (build from source)
39+
ARG IWYU_BRANCH="clang_19"
40+
ENV IWYU=/home/iwyu \
41+
IWYU_BUILD=/home/iwyu/build \
42+
IWYU_SRC=/home/iwyu/include-what-you-use
43+
44+
RUN mkdir -p ${IWYU_BUILD} && \
45+
git clone --branch ${IWYU_BRANCH} --depth 1 \
46+
https://github.com/include-what-you-use/include-what-you-use.git \
47+
${IWYU_SRC}
48+
49+
RUN cmake -S ${IWYU_SRC} -B ${IWYU_BUILD} -G "Unix Makefiles" \
50+
-DCMAKE_PREFIX_PATH=$(llvm-config --prefix) && \
51+
cmake --build ${IWYU_BUILD} -j && \
52+
cmake --install ${IWYU_BUILD}
53+
54+
# Link Clang resource headers so IWYU can find them
55+
RUN mkdir -p $(include-what-you-use -print-resource-dir 2>/dev/null) && \
56+
ln -sf $(clang -print-resource-dir)/include \
57+
$(include-what-you-use -print-resource-dir 2>/dev/null)/include
58+
59+
# Cleanup
60+
RUN dnf clean all && rm -rf /var/cache/dnf
61+
62+
# Allow the user to set compiler defaults
63+
ARG USE_CLANG
64+
# if --build-arg USE_CLANG=1, set CC to 'clang' or set to null otherwise.
65+
ENV CC=${USE_CLANG:+"clang"}
66+
ENV CXX=${USE_CLANG:+"clang++"}
67+
# if CC is null, set it to 'gcc' (or leave as is otherwise).
68+
ENV CC=${CC:-"gcc"}
69+
ENV CXX=${CXX:-"g++"}
70+
71+
CMD ["/bin/bash"]

.devcontainer/Dockerfile

Lines changed: 0 additions & 71 deletions
This file was deleted.

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Containerfile

.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# EditorConfig — https://editorconfig.org
2+
# Complements .clang-format (C/C++) and .cmake-format.yaml (CMake).
3+
# Covers everything else: YAML, Markdown, Python, shell scripts, etc.
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.{c,cc,cpp,cxx,h,hh,hpp,hxx}]
16+
indent_size = 2
17+
18+
[*.{json,jsonc}]
19+
indent_size = 4
20+
21+
[*.{yml,yaml}]
22+
indent_size = 2
23+
24+
[*.py]
25+
indent_size = 4
26+
27+
[*.toml]
28+
indent_size = 4
29+
30+
[*.md]
31+
trim_trailing_whitespace = false
32+
33+
[Makefile]
34+
indent_style = tab

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# ── Git Line Endings ──────────────────────────────────────────────────
1+
# Git Line Endings
22

33
* text=auto eol=lf
44
*.{cmd,[cC][mM][dD]} text eol=crlf
55
*.{bat,[bB][aA][tT]} text eol=crlf
66
*.{vcxproj,vcxproj.filters} text eol=crlf
77

8-
# ── Git Large File System (LFS) ───────────────────────────────────────
8+
# Git Large File System (LFS)
99

1010
# Archives
1111
#*.7z filter=lfs diff=lfs merge=lfs -text

.github/FUNDING.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/template/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# %%myproject%%
22

33
[![ci](https://github.com/%%myorg%%/%%myproject%%/actions/workflows/ci.yml/badge.svg)](https://github.com/%%myorg%%/%%myproject%%/actions/workflows/ci.yml)
4-
[![codecov](https://codecov.io/gh/%%myorg%%/%%myproject%%/branch/main/graph/badge.svg)](https://codecov.io/gh/%%myorg%%/%%myproject%%)
4+
[![codecov](https://codecov.io/gh/%%myorg%%/%%myproject%%/graph/badge.svg)](https://codecov.io/gh/%%myorg%%/%%myproject%%)
55
[![CodeQL](https://github.com/%%myorg%%/%%myproject%%/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/%%myorg%%/%%myproject%%/actions/workflows/codeql-analysis.yml)
66

77
## About %%myproject%%
@@ -23,7 +23,7 @@ Try the live WebAssembly demo:
2323
- Main: [https://%%myorg%%.github.io/%%myproject%%/](https://%%myorg%%.github.io/%%myproject%%/)
2424
- Develop: [https://%%myorg%%.github.io/%%myproject%%/develop/](https://%%myorg%%.github.io/%%myproject%%/develop/)
2525

26-
The `main` branch deploys to the root, `develop` to `/develop/`, and tags to `/tagname/`.
26+
The default branch (`main` or `master`) deploys to the root, `develop` to `/develop/`, and tags to `/tagname/`.
2727

2828
## Getting Started
2929

@@ -38,5 +38,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for commit message policy and developer w
3838

3939
* [Dependency Setup](README_dependencies.md)
4040
* [Building Details](README_building.md)
41-
* [Troubleshooting](README_troubleshooting.md)
42-
* [Docker](README_docker.md)
41+
* [Containers](README_container.md)

.github/template/removal-list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LICENSE
2-
.github/FUNDING.yml

0 commit comments

Comments
 (0)