diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:51:45 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:51:45 +0300 |
| commit | d3261e64152397db2dca4d691a990c6bc2a6f4dd (patch) | |
| tree | fac2f7be638651181a72453d714f0f96675c2b8b /archived/projt-launcher/ci/code-quality.nix | |
| parent | 31b9a8949ed0a288143e23bf739f2eb64fdc63be (diff) | |
| download | Project-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.tar.gz Project-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.zip | |
NOISSUE add archived projects
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'archived/projt-launcher/ci/code-quality.nix')
| -rw-r--r-- | archived/projt-launcher/ci/code-quality.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/archived/projt-launcher/ci/code-quality.nix b/archived/projt-launcher/ci/code-quality.nix new file mode 100644 index 0000000000..b5706dc83f --- /dev/null +++ b/archived/projt-launcher/ci/code-quality.nix @@ -0,0 +1,51 @@ +{ + lib, + runCommand, + clang-tools, + cmake, + cmake-format, +}: +{ + src ? ../., +}: + +let + sourceFiles = lib.fileset.toSource { + root = src; + fileset = lib.fileset.unions [ + (src + /launcher) + (src + /tests) + (src + /buildconfig) + ]; + }; +in +runCommand "projt-code-check" + { + nativeBuildInputs = [ + clang-tools + cmake + cmake-format + ]; + } + '' + echo "Running ProjT Launcher code quality checks..." + + echo "Checking C++ code formatting..." + find ${sourceFiles} -type f \( -name "*.cpp" -o -name "*.h" \) | while read file; do + if ! clang-format --dry-run --Werror "$file" 2>/dev/null; then + echo "Format error in: $file" + fi + done + + echo "Checking for common code issues..." + + todoCount=$(grep -r "TODO\\|FIXME" ${sourceFiles} --include="*.cpp" --include="*.h" 2>/dev/null | wc -l) + echo "Found $todoCount TODO/FIXME comments" + + if grep -r "qDebug\\|std::cout" ${sourceFiles} --include="*.cpp" 2>/dev/null | grep -v "// DEBUG" > /dev/null; then + echo "Warning: Debug statements found in code" + fi + + echo "Code quality check completed!" + touch $out + '' |
