/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Models/ConventionalCommitType.cs
48 строк
2 KB
leo
feature: allows to customize conventional commit types (#1861)
20 окт 2025, 16:24
20 окт 2025, 16:24
aed9dde
Код
Авторство
О чём код?
using System.Collections.Generic; using System.IO; using System.Text.Json; namespace SourceGit.Models { public class ConventionalCommitType { public string Name { get; set; } public string Type { get; set; } public string Description { get; set; } public ConventionalCommitType(string name, string type, string description) { Name = name; Type = type; Description = description; } public static List<ConventionalCommitType> Load(string storageFile) { try { if (!string.IsNullOrEmpty(storageFile) && File.Exists(storageFile)) return JsonSerializer.Deserialize(File.ReadAllText(storageFile), JsonCodeGen.Default.ListConventionalCommitType) ?? []; } catch { // Ignore errors. } return new List<ConventionalCommitType> { new("Features", "feat", "Adding a new feature"), new("Bug Fixes", "fix", "Fixing a bug"), new("Work In Progress", "wip", "Still being developed and not yet complete"), new("Reverts", "revert", "Undoing a previous commit"), new("Code Refactoring", "refactor", "Restructuring code without changing its external behavior"), new("Performance Improvements", "perf", "Improves performance"), new("Builds", "build", "Changes that affect the build system or external dependencies"), new("Continuous Integrations", "ci", "Changes to CI configuration files and scripts"), new("Documentations", "docs", "Updating documentation"), new("Styles", "style", "Elements or code styles without changing the code logic"), new("Tests", "test", "Adding or updating tests"), new("Chores", "chore", "Other changes that don't modify src or test files"), }; } } }