-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathConventionalCommitType.cs
More file actions
49 lines (45 loc) · 2.09 KB
/
ConventionalCommitType.cs
File metadata and controls
49 lines (45 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
namespace SourceGit.Models
{
public class ConventionalCommitType
{
public string Name { get; set; } = string.Empty;
public string Type { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string PrefillShortDesc { get; set; } = string.Empty;
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"),
};
}
}
}