feat(algorithm): Реализация движка интервального повторения (C) и настройка CI/CD#28
Merged
Conversation
Использовать Ninja для сборки, чтобы создавался json lkz последующей проверки линтерами.
- Add CardState and ReviewResult structures - Implement calculate_next_review function with math constraints - Map cosine similarity percentages to 0-5 quality grades
- Configure CMake with FetchContent for GTest - Add unit tests for boundary conditions and score calculation
- Enforce Google C++ style formatting - Enable strict static analysis (cert, bugprone, readability) - Disable MISRA checks for test directory to allow GTest macros
- Automate clang-format and clang-tidy checks on PRs - Generate compile_commands.json via CMake for accurate linting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание (Description)
В этом PR реализовано математическое ядро алгоритма интервального повторения (модификация SM-2) на чистом C. Код подготовлен для безопасной линковки с Go-бэкендом через
cgo. Также заложен фундамент инфраструктуры монорепозитория: настроены независимые линтеры и CI/CD пайплайны для всех трех языков проекта (C, Go, Python).Что сделано (Changes)
Ядро алгоритма (C/C++):
calculate_next_review, переводящая косинусное сходство (cosine similarity) в оценку качества (0-5) и высчитывающая новые интервалы.int64_t,int32_t) для бинарной совместимости с Go и PostgreSQL.FetchContent. Написаны unit-тесты для пограничных сценариев алгоритма.CI/CD и Линтеры (GitHub Actions):
C/C++,GoиPython. Actions запускаются только при изменении файлов в соответствующих директориях (paths)..clang-format(Google Style) и строгий.clang-tidy(включены правилаcert-*,bugprone-*,performance-*). Для папки с тестамиMISRAотключена локальным конфигом.golangci-lint(под Go 1.26).Ruff.Как проверить (How to test)