This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +115
-1
lines changed
Expand file tree Collapse file tree 8 files changed +115
-1
lines changed Original file line number Diff line number Diff line change 22Language : Cpp
33BasedOnStyle : LLVM
44AlwaysBreakTemplateDeclarations : Yes
5- BreakBeforeBraces : Attach
5+ BreakBeforeBraces : Allman
66ColumnLimit : 160
77SpaceAfterTemplateKeyword : true
88Standard : c++20
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Checks: 'clang-analyzer-*,
99 -misc-non-private-member-variables-in-classes,
1010 -misc-no-recursion,
1111 modernize-*,
12+ -modernize-use-trailing-return-type,
1213 performance-*,
1314 portability-*,
1415 readability-*,
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ [[ ! $( git --version) ]] && exit 1
4+
5+ output=$( git diff)
6+
7+ if [[ " $output " != " " ]]; then
8+ echo -e " One or more source files are not formatted!\n\n$output \n"
9+ echo -e " Using $( clang-format --version) \n"
10+ exit 1
11+ fi
12+
13+ echo " All source files are formatted"
14+ exit
Original file line number Diff line number Diff line change 1+ name : ci-push
2+ on : [push]
3+ jobs :
4+ format-check :
5+ runs-on : ubuntu-latest
6+ steps :
7+ - uses : actions/checkout@v4
8+ - name : format code
9+ run : scripts/format_code.sh
10+ - name : check diff
11+ run : .github/format_check_diff.sh
12+ linux-gcc :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+ - name : init
17+ run : sudo apt update -yqq; sudo apt install -yqq ninja-build xorg-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
18+ - name : configure
19+ run : export CC=gcc-14; export CXX=g++-14; cmake -S . --preset=default -B build -DKVF_USE_FREETYPE=OFF
20+ - name : build debug
21+ run : cmake --build build --config=Debug
22+ - name : build release
23+ run : cmake --build build --config=Release
24+ linux-clang :
25+ runs-on : ubuntu-latest
26+ steps :
27+ - uses : actions/checkout@v4
28+ - name : init
29+ run : sudo apt update -yqq; sudo apt install -yqq ninja-build xorg-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
30+ - name : configure
31+ run : cmake -S . --preset=ninja-clang -B build -DKVF_USE_FREETYPE=OFF
32+ - name : build debug
33+ run : cmake --build build --config=Debug
34+ - name : build release
35+ run : cmake --build build --config=Release
36+ windows-vs22 :
37+ runs-on : windows-latest
38+ steps :
39+ - uses : actions/checkout@v4
40+ - name : configure
41+ run : cmake -S . --preset=vs22 -B build -DKVF_USE_FREETYPE=OFF
42+ - name : build debug
43+ run : cmake --build build --config=Debug
44+ - name : build release
45+ run : cmake --build build --config=Release
46+ windows-clang :
47+ runs-on : windows-latest
48+ steps :
49+ - uses : actions/checkout@v4
50+ - name : init
51+ run : choco install ninja
52+ - name : configure
53+ run : cmake -S . --preset=ninja-clang -B build -DKVF_USE_FREETYPE=OFF
54+ - name : build debug
55+ run : cmake --build build --config=Debug
56+ - name : build release
57+ run : cmake --build build --config=Release
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.24)
2+
3+ set (project_name tkge)
4+ project (${project_name} )
5+
6+ set (CMAKE_CXX_STANDARD 23)
7+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
8+ set (CMAKE_CXX_EXTENSIONS OFF )
9+ set (CMAKE_DEBUG_POSTFIX "-d" )
10+
11+ # TODO
12+ # add_subdirectory(lib)
13+ add_subdirectory (app)
Original file line number Diff line number Diff line change 1+ project (${project_name} -app)
2+
3+ add_executable (${PROJECT_NAME} )
4+
5+ file (GLOB_RECURSE sources LIST_DIRECTORIES false "src/*.[hc]pp" )
6+ target_sources (${PROJECT_NAME} PRIVATE
7+ ${sources}
8+ )
Original file line number Diff line number Diff line change 1+ int main () {}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ [[ ! $( clang-format --version) ]] && exit 1
4+
5+ if [[ ! -d ./app ]]; then
6+ echo " Please run script from the project root"
7+ exit 1
8+ fi
9+
10+ files=$( find app -name " *.?pp" )
11+
12+ if [[ " $files " == " " ]]; then
13+ echo " -- No source files found"
14+ exit
15+ fi
16+
17+ clang-format -i $files || exit 1
18+ echo -e " -- Formatted Files:\n$files \n"
19+
20+ exit
You can’t perform that action at this time.
0 commit comments