From f53fa2717c55bda542de07381b17161d7dcb4340 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 13:48:20 +0300 Subject: [PATCH 01/15] setting linterts #12 --- algorithm/.clang-format | 4 +--- algorithm/.clang-tidy | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/algorithm/.clang-format b/algorithm/.clang-format index 034dc90..43558d1 100644 --- a/algorithm/.clang-format +++ b/algorithm/.clang-format @@ -1,4 +1,3 @@ ---- Language: Cpp BasedOnStyle: Google @@ -9,5 +8,4 @@ UseTab: Never PointerAlignment: Left -SortIncludes: true ---- \ No newline at end of file +SortIncludes: true \ No newline at end of file diff --git a/algorithm/.clang-tidy b/algorithm/.clang-tidy index 71a7da5..432c638 100644 --- a/algorithm/.clang-tidy +++ b/algorithm/.clang-tidy @@ -1,7 +1,7 @@ ---- Checks: > -*, bugprone-*, + cert-*, clang-analyzer-*, performance-*, portability-*, @@ -16,5 +16,4 @@ HeaderFilterRegex: '.*' CheckOptions: - key: readability-braces-around-statements.ShortStatementLines - value: '1' ---- \ No newline at end of file + value: '1' \ No newline at end of file From 497784a428ac8e5223f48a6c26a9d25b111e3fa6 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 13:49:17 +0300 Subject: [PATCH 02/15] setting Cmakefile + test #12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Использовать Ninja для сборки, чтобы создавался json lkz последующей проверки линтерами. --- algorithm/CMakeLists.txt | 15 ++++++++++++++- algorithm/tests/test_algorithm.c | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 algorithm/tests/test_algorithm.c diff --git a/algorithm/CMakeLists.txt b/algorithm/CMakeLists.txt index 7d44ff9..715aebf 100644 --- a/algorithm/CMakeLists.txt +++ b/algorithm/CMakeLists.txt @@ -5,8 +5,21 @@ project(SpacedRepetition C) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED True) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Werror") +endif() + include_directories(include) add_library(spaced_rep STATIC src/algorithm.c -) \ No newline at end of file +) + +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_algorithm.c") + add_executable(test_algorithm + tests/test_algorithm.c + ) + target_link_libraries(test_algorithm spaced_rep) +endif() \ No newline at end of file diff --git a/algorithm/tests/test_algorithm.c b/algorithm/tests/test_algorithm.c new file mode 100644 index 0000000..f9f4ff8 --- /dev/null +++ b/algorithm/tests/test_algorithm.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Algorithm tests starting...\n"); + return 0; +} \ No newline at end of file From 712a38615c83dd99a6843661a2af89b2a868511f Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 14:21:07 +0300 Subject: [PATCH 03/15] add struct current and update card and calc #13 --- algorithm/include/algorithm.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/algorithm/include/algorithm.h b/algorithm/include/algorithm.h index e69de29..ed7c926 100644 --- a/algorithm/include/algorithm.h +++ b/algorithm/include/algorithm.h @@ -0,0 +1,35 @@ +#ifndef ALGORITHM_H +#define ALGORITHM_H + +#ifdef __cplusplus +extern "C" { +#endif + +// struct, current state card +struct CardState { + int interval; // current interval + float easiness; // diff level + int repetitions; // accurace repeat +}; + +// struct for returning new data +struct ReviewResult { + int next_interval; // new interval + float new_easiness; // update diff level + int repetitions; // update quantity repeat + int quality; // grade +}; + +/** + * main function + * @param similarity_percent match percentage + * @param current_state current param card + * @return update param card for save in DB + */ +struct ReviewResult calculate_next_review(float similarity_percent, struct CardState current_state); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file From dfe6d7977699fb2a92dde6ea535618fe31dcce10 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 14:39:35 +0300 Subject: [PATCH 04/15] realiazation algorithm #14 --- algorithm/src/algorithm.c | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/algorithm/src/algorithm.c b/algorithm/src/algorithm.c index e69de29..920db56 100644 --- a/algorithm/src/algorithm.c +++ b/algorithm/src/algorithm.c @@ -0,0 +1,54 @@ +#include "algorithm.h" + +struct ReviewResult calculate_next_review(float similarity_percent, + struct CardState current_state) { + struct ReviewResult result; + int quality = 0; + + // percent -> grade + if (similarity_percent < 40.0F) { + quality = 0; // bad + } else if (similarity_percent < 60.0F) { + quality = 2; // normal + } else if (similarity_percent < 80.0F) { + quality = 4; // good + } else { + quality = 5; // perfect + } + + result.quality = quality; + + // new Easiness Factor (EF) on formula SM-2 + // EF = EF + (0.1 - (5 - q) * (0.08 + (5 - q) * 0.02)) + float q_diff = 5.0F - (float)quality; + float new_ef = current_state.easiness + (0.1F - (q_diff * (0.08F + (q_diff * 0.02F)))); + + // EF != <1.3 + if (new_ef < 1.3F) { + new_ef = 1.3F; + } + result.new_easiness = new_ef; + + // update counter + if (quality < 3) { + // bad answer -> progress 0 + result.repetitions = 0; + result.next_interval = 1; + } else { + // good answer -> +1 counter + result.repetitions = current_state.repetitions + 1; + + // calculation new interval + if (result.repetitions == 1) { + result.next_interval = 1; + } else if (result.repetitions == 2) { + result.next_interval = 6; + } else { + // + 0.5F for correct rounding + result.next_interval = + (int)((((float)current_state.interval) * result.new_easiness) + 0.5F); + } + } + + return result; +} \ No newline at end of file From 6d9beee591e673183d97294e6f512c3992b4a820 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 14:49:14 +0300 Subject: [PATCH 05/15] test algorithm #15 --- algorithm/tests/test_algorithm.c | 66 +++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/algorithm/tests/test_algorithm.c b/algorithm/tests/test_algorithm.c index f9f4ff8..71a5065 100644 --- a/algorithm/tests/test_algorithm.c +++ b/algorithm/tests/test_algorithm.c @@ -1,6 +1,70 @@ +#include #include +#include "algorithm.h" + +// auxiliary function +struct CardState apply_result_to_card(struct ReviewResult res) { + struct CardState new_card; + new_card.interval = res.next_interval; + new_card.easiness = res.new_easiness; + new_card.repetitions = res.repetitions; + return new_card; +} + int main() { - printf("Algorithm tests starting...\n"); + printf("Starting algorithm tests...\n"); + + // new card + struct CardState card = {0, 2.5F, 0}; + struct ReviewResult result; + + // test 1: bad answer + printf("Test 1: Bad answer (< 40%%)\n"); + result = calculate_next_review(20.0F, card); + + assert(result.quality == 0); + assert(result.next_interval == 1); + assert(result.repetitions == 0); + assert(result.new_easiness < 2.5F); + card = apply_result_to_card(result); + + // test 2 perfect answer + printf("Test 2: Perfect answer (1st time)\n"); + result = calculate_next_review(95.0F, card); + + assert(result.quality == 5); + assert(result.repetitions == 1); + assert(result.next_interval == 1); + assert(result.new_easiness > card.easiness); + card = apply_result_to_card(result); + + // test 3 perfect answer (2) + printf("Test 3: Perfect answer (2nd time)\n"); + result = calculate_next_review(85.0F, card); + + assert(result.quality == 5); + assert(result.repetitions == 2); + assert(result.next_interval == 6); + card = apply_result_to_card(result); + + // test 4 perfect answer (3) + printf("Test 4: Perfect answer (3rd time)\n"); + result = calculate_next_review(100.0F, card); + + assert(result.quality == 5); + assert(result.repetitions == 3); + assert(result.next_interval > 6); + card = apply_result_to_card(result); + + // test 5 bad answer + printf("Test 5: Bad answer after streak\n"); + result = calculate_next_review(10.0F, card); + + assert(result.quality == 0); + assert(result.repetitions == 0); + assert(result.next_interval == 1); + + printf("SUCCESS! All assertions passed. Algorithm works perfectly!\n"); return 0; } \ No newline at end of file From 527be6c90d5c3fbb7f0118c67fe62d39466caca4 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 14:53:51 +0300 Subject: [PATCH 06/15] CI C code #16 --- .github/workflows/c-linter.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/c-linter.yml diff --git a/.github/workflows/c-linter.yml b/.github/workflows/c-linter.yml new file mode 100644 index 0000000..6eaaeb8 --- /dev/null +++ b/.github/workflows/c-linter.yml @@ -0,0 +1,41 @@ +name: C Algorithm CI + +on: + push: + branches: [ "main", "feature/spaced-rep-algorithm" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies (CMake, Clang) + run: | + sudo apt-get update + sudo apt-get install -y cmake clang clang-format clang-tidy ninja-build + + - name: Check Formatting (clang-format) + working-directory: ./algorithm + # --dry-run it will tell the linter not to fix the code, but to throw an error if the format is incorrect + run: clang-format --dry-run --Werror src/*.c include/*.h tests/*.c + + - name: Static Analysis (clang-tidy) + working-directory: ./algorithm + # We check the files by passing the path to the header files directly + run: clang-tidy src/*.c tests/*.c -- -I./include + + - name: Build tests + working-directory: ./algorithm + run: | + mkdir build + cd build + cmake -G Ninja .. + ninja + + - name: Run Algorithm tests + working-directory: ./algorithm/build + run: ./test_algorithm \ No newline at end of file From 54d49764389b50eb73d65c7a9f29e107110f88a9 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:00:25 +0300 Subject: [PATCH 07/15] udate c-linter #16 --- .github/workflows/c-linter.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/c-linter.yml b/.github/workflows/c-linter.yml index 6eaaeb8..cc0e0cf 100644 --- a/.github/workflows/c-linter.yml +++ b/.github/workflows/c-linter.yml @@ -9,33 +9,30 @@ on: jobs: build-and-test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Install dependencies (CMake, Clang) + - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y cmake clang clang-format clang-tidy ninja-build - name: Check Formatting (clang-format) working-directory: ./algorithm - # --dry-run it will tell the linter not to fix the code, but to throw an error if the format is incorrect - run: clang-format --dry-run --Werror src/*.c include/*.h tests/*.c + run: | + # --dry-run it will tell the linter not to fix the code, but to throw an error if the format is incorrect + find . -name "*.c" -o -name "*.h" | xargs clang-format --dry-run --Werror - name: Static Analysis (clang-tidy) working-directory: ./algorithm - # We check the files by passing the path to the header files directly - run: clang-tidy src/*.c tests/*.c -- -I./include + run: | + # We check the files by passing the path to the header files directly + clang-tidy $(find src tests -name "*.c") -- -I./include - - name: Build tests + - name: Build and Run Tests working-directory: ./algorithm run: | - mkdir build - cd build + mkdir build && cd build cmake -G Ninja .. ninja - - - name: Run Algorithm tests - working-directory: ./algorithm/build - run: ./test_algorithm \ No newline at end of file + ./test_algorithm \ No newline at end of file From e528e1c641cf2e7d1a84a0d9ff0313c79d65a708 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:04:44 +0300 Subject: [PATCH 08/15] update CI #16 --- .github/workflows/c-linter.yml | 8 +++++--- algorithm/.clang-tidy | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/c-linter.yml b/.github/workflows/c-linter.yml index cc0e0cf..3b13b5e 100644 --- a/.github/workflows/c-linter.yml +++ b/.github/workflows/c-linter.yml @@ -20,14 +20,16 @@ jobs: - name: Check Formatting (clang-format) working-directory: ./algorithm run: | - # --dry-run it will tell the linter not to fix the code, but to throw an error if the format is incorrect find . -name "*.c" -o -name "*.h" | xargs clang-format --dry-run --Werror - name: Static Analysis (clang-tidy) working-directory: ./algorithm run: | - # We check the files by passing the path to the header files directly - clang-tidy $(find src tests -name "*.c") -- -I./include + FILES=$(find src tests -name "*.c") + for FILE in $FILES; do + echo "Checking $FILE..." + clang-tidy "$FILE" -- -I./include + done - name: Build and Run Tests working-directory: ./algorithm diff --git a/algorithm/.clang-tidy b/algorithm/.clang-tidy index 432c638..27bb8ba 100644 --- a/algorithm/.clang-tidy +++ b/algorithm/.clang-tidy @@ -10,8 +10,6 @@ Checks: > -readability-magic-numbers, -bugprone-easily-swappable-parameters -WarningsAsErrors: '*' - HeaderFilterRegex: '.*' CheckOptions: From 70fd9ce7635734a017826ce269c38d4a27a67df9 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:09:33 +0300 Subject: [PATCH 09/15] update CI #16 --- .github/workflows/c-linter.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/c-linter.yml b/.github/workflows/c-linter.yml index 3b13b5e..64321b0 100644 --- a/.github/workflows/c-linter.yml +++ b/.github/workflows/c-linter.yml @@ -25,11 +25,8 @@ jobs: - name: Static Analysis (clang-tidy) working-directory: ./algorithm run: | - FILES=$(find src tests -name "*.c") - for FILE in $FILES; do - echo "Checking $FILE..." - clang-tidy "$FILE" -- -I./include - done + clang-tidy src/algorithm.c -- -I./include + clang-tidy tests/test_algorithm.c -- -I./include - name: Build and Run Tests working-directory: ./algorithm From 610cb8edffccb9a472ef09c3afbd31077d44a344 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:14:13 +0300 Subject: [PATCH 10/15] update CI #16 --- .github/workflows/c-linter.yml | 37 --------------------------- ".github/workflows/\320\241-lint.yml" | 28 ++++++++++++++++++++ algorithm/.clang-tidy | 12 +-------- 3 files changed, 29 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/c-linter.yml create mode 100644 ".github/workflows/\320\241-lint.yml" diff --git a/.github/workflows/c-linter.yml b/.github/workflows/c-linter.yml deleted file mode 100644 index 64321b0..0000000 --- a/.github/workflows/c-linter.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: C Algorithm CI - -on: - push: - branches: [ "main", "feature/spaced-rep-algorithm" ] - pull_request: - branches: [ "main" ] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake clang clang-format clang-tidy ninja-build - - - name: Check Formatting (clang-format) - working-directory: ./algorithm - run: | - find . -name "*.c" -o -name "*.h" | xargs clang-format --dry-run --Werror - - - name: Static Analysis (clang-tidy) - working-directory: ./algorithm - run: | - clang-tidy src/algorithm.c -- -I./include - clang-tidy tests/test_algorithm.c -- -I./include - - - name: Build and Run Tests - working-directory: ./algorithm - run: | - mkdir build && cd build - cmake -G Ninja .. - ninja - ./test_algorithm \ No newline at end of file diff --git "a/.github/workflows/\320\241-lint.yml" "b/.github/workflows/\320\241-lint.yml" new file mode 100644 index 0000000..4ae79a7 --- /dev/null +++ "b/.github/workflows/\320\241-lint.yml" @@ -0,0 +1,28 @@ +name: CI Check + +on: + push: + branches: [ "main", "feature/spaced-rep-algorithm" ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install + run: sudo apt-get update && sudo apt-get install -y cmake clang clang-tidy ninja-build + + - name: Run Clang-Tidy + working-directory: ./algorithm + run: | + clang-tidy src/algorithm.c -- -I./include + clang-tidy tests/test_algorithm.c -- -I./include + + - name: Build and Run + working-directory: ./algorithm + run: | + mkdir build && cd build + cmake -G Ninja .. + ninja + ./test_algorithm \ No newline at end of file diff --git a/algorithm/.clang-tidy b/algorithm/.clang-tidy index 27bb8ba..0647855 100644 --- a/algorithm/.clang-tidy +++ b/algorithm/.clang-tidy @@ -1,14 +1,4 @@ -Checks: > - -*, - bugprone-*, - cert-*, - clang-analyzer-*, - performance-*, - portability-*, - readability-*, - -readability-identifier-length, - -readability-magic-numbers, - -bugprone-easily-swappable-parameters +Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,performance-*,portability-*,readability-*, -readability-identifier-length, -readability-magic-numbers, -bugprone-easily-swappable-parameters' HeaderFilterRegex: '.*' From 7c8bd8c29a777126b9b9c1fedea140b31fbbf167 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:20:06 +0300 Subject: [PATCH 11/15] delete C-linter #16 --- ".github/workflows/\320\241-lint.yml" | 28 --------------------------- 1 file changed, 28 deletions(-) delete mode 100644 ".github/workflows/\320\241-lint.yml" diff --git "a/.github/workflows/\320\241-lint.yml" "b/.github/workflows/\320\241-lint.yml" deleted file mode 100644 index 4ae79a7..0000000 --- "a/.github/workflows/\320\241-lint.yml" +++ /dev/null @@ -1,28 +0,0 @@ -name: CI Check - -on: - push: - branches: [ "main", "feature/spaced-rep-algorithm" ] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install - run: sudo apt-get update && sudo apt-get install -y cmake clang clang-tidy ninja-build - - - name: Run Clang-Tidy - working-directory: ./algorithm - run: | - clang-tidy src/algorithm.c -- -I./include - clang-tidy tests/test_algorithm.c -- -I./include - - - name: Build and Run - working-directory: ./algorithm - run: | - mkdir build && cd build - cmake -G Ninja .. - ninja - ./test_algorithm \ No newline at end of file From 8106da0222ce9278037020a850164b339fd99319 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:23:49 +0300 Subject: [PATCH 12/15] update lint.yml #16 --- .github/workflows/lint.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e56e500..44ca3a8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,11 +24,16 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install clang-tools - run: sudo apt-get install -y clang-format clang-tidy + run: sudo apt-get update && sudo apt-get install -y clang-format clang-tidy cmake + - name: Check C formatting (clang-format) - run: find ./algorithm -name '*.c' -o -name '*.h' | xargs clang-format --Werror --dry-run + run: | + find ./algorithm -name "*.c" -o -name "*.h" | xargs clang-format --Werror --dry-run + - name: Run C linter (clang-tidy) - run: find ./algorithm -name '*.c' | xargs clang-tidy --warnings-as-errors="*" -- + run: | + clang-tidy ./algorithm/src/algorithm.c -- -I./algorithm/include + clang-tidy ./algorithm/tests/test_algorithm.c -- -I./algorithm/include # Python Ruff lint-python: From 063b61d8c625cde3b03b1393b28eecbc7b2b8857 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:38:59 +0300 Subject: [PATCH 13/15] linter go #21 --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 44ca3a8..6651814 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.25' + go-version: '1.23' - name: Run golangci-lint uses: golangci/golangci-lint-action@v6 with: From c5134ea095c8e870eb5bd24ab4d281b34d679ce1 Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:43:06 +0300 Subject: [PATCH 14/15] =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B5=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BB=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D0=B0?= =?UTF-8?q?=20Go=20#21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6651814..329f0d2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,6 +10,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Check if backend exists + run: | + if [ ! -d "./backend" ] || [ -z "$(ls -A ./backend 2>/dev/null)" ]; then + echo "No go files to lint, skipping." + exit 0 + fi + - uses: actions/setup-go@v5 with: go-version: '1.23' From 032b264249c7abe02d9e01dd920dc61f33f8a1bf Mon Sep 17 00:00:00 2001 From: TToJlkoBHuK <28arhalex@gmail.com> Date: Sat, 21 Mar 2026 15:46:01 +0300 Subject: [PATCH 15/15] =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B5=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20Go=20#21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 329f0d2..6650506 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,25 +6,25 @@ on: jobs: # Golang check - lint-go: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + # lint-go: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 - - name: Check if backend exists - run: | - if [ ! -d "./backend" ] || [ -z "$(ls -A ./backend 2>/dev/null)" ]; then - echo "No go files to lint, skipping." - exit 0 - fi + # - name: Check if backend exists + # run: | + # if [ ! -d "./backend" ] || [ -z "$(ls -A ./backend 2>/dev/null)" ]; then + # echo "No go files to lint, skipping." + # exit 0 + # fi - - uses: actions/setup-go@v5 - with: - go-version: '1.23' - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - working-directory: ./backend + # - uses: actions/setup-go@v5 + # with: + # go-version: '1.23' + # - name: Run golangci-lint + # uses: golangci/golangci-lint-action@v6 + # with: + # working-directory: ./backend # C (Google Style) lint-c: