mirror of
https://github.com/lukaszraczylo/git-velocity.git
synced 2026-06-27 04:52:58 +00:00
Create meaningful lines calculations.
This commit is contained in:
@@ -15,6 +15,10 @@ type Commit struct {
|
||||
Repository string `json:"repository"` // owner/repo format
|
||||
URL string `json:"url"`
|
||||
|
||||
// Meaningful line counts (excludes comments and whitespace)
|
||||
MeaningfulAdditions int `json:"meaningful_additions"`
|
||||
MeaningfulDeletions int `json:"meaningful_deletions"`
|
||||
|
||||
// Derived fields
|
||||
HasTests bool `json:"has_tests"`
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ type ContributorMetrics struct {
|
||||
LinesDeleted int `json:"lines_deleted"`
|
||||
FilesChanged int `json:"files_changed"`
|
||||
|
||||
// Meaningful line counts (excludes comments and whitespace)
|
||||
MeaningfulLinesAdded int `json:"meaningful_lines_added"`
|
||||
MeaningfulLinesDeleted int `json:"meaningful_lines_deleted"`
|
||||
|
||||
// PR metrics
|
||||
PRsOpened int `json:"prs_opened"`
|
||||
PRsMerged int `json:"prs_merged"`
|
||||
@@ -97,6 +101,10 @@ type RepositoryMetrics struct {
|
||||
ActiveContributors int `json:"active_contributors"`
|
||||
TotalLinesAdded int `json:"total_lines_added"`
|
||||
TotalLinesDeleted int `json:"total_lines_deleted"`
|
||||
|
||||
// Meaningful line counts (excludes comments and whitespace)
|
||||
TotalMeaningfulLinesAdded int `json:"total_meaningful_lines_added"`
|
||||
TotalMeaningfulLinesDeleted int `json:"total_meaningful_lines_deleted"`
|
||||
}
|
||||
|
||||
// TeamMetrics holds aggregated metrics for a team
|
||||
@@ -127,6 +135,10 @@ type GlobalMetrics struct {
|
||||
TotalLinesAdded int `json:"total_lines_added"`
|
||||
TotalLinesDeleted int `json:"total_lines_deleted"`
|
||||
|
||||
// Meaningful line counts (excludes comments and whitespace)
|
||||
TotalMeaningfulLinesAdded int `json:"total_meaningful_lines_added"`
|
||||
TotalMeaningfulLinesDeleted int `json:"total_meaningful_lines_deleted"`
|
||||
|
||||
// Velocity timeline (weekly granularity)
|
||||
VelocityTimeline *VelocityTimeline `json:"velocity_timeline,omitempty"`
|
||||
}
|
||||
|
||||
@@ -32,6 +32,10 @@ type PullRequest struct {
|
||||
Reviews []Review `json:"reviews,omitempty"`
|
||||
URL string `json:"url"`
|
||||
|
||||
// Meaningful line counts (excludes comments and whitespace)
|
||||
MeaningfulAdditions int `json:"meaningful_additions"`
|
||||
MeaningfulDeletions int `json:"meaningful_deletions"`
|
||||
|
||||
// Derived fields
|
||||
TimeToMerge *time.Duration `json:"time_to_merge,omitempty"`
|
||||
TimeToFirstReview *time.Duration `json:"time_to_first_review,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user