style: fix formatting and indentation consistency

- Remove extra blank lines and fix indentation in test files
- Ensure consistent struct field alignment in git types
This commit is contained in:
carraes
2025-07-05 23:44:48 -03:00
parent ca7821b015
commit 48848b2cbd
3 changed files with 18 additions and 25 deletions
-2
View File
@@ -93,7 +93,6 @@ func TestGitFlagValidation(t *testing.T) {
} }
} }
func validateGitFlags(cli types.CLI) error { func validateGitFlags(cli types.CLI) error {
gitFlags := []bool{cli.ChangesOnly, cli.Staged, cli.Unstaged} gitFlags := []bool{cli.ChangesOnly, cli.Staged, cli.Unstaged}
@@ -119,7 +118,6 @@ func validateGitFlags(cli types.CLI) error {
return nil return nil
} }
type GitFlagError struct { type GitFlagError struct {
message string message string
} }
+15 -16
View File
@@ -43,7 +43,7 @@ func TestParseGitDiffUnified(t *testing.T) {
input: `@@ -10,2 +10,0 @@ input: `@@ -10,2 +10,0 @@
-deleted line 1 -deleted line 1
-deleted line 2`, -deleted line 2`,
expected: []LineRange{}, expected: []LineRange{},
}, },
{ {
name: "no count specified (single line)", name: "no count specified (single line)",
@@ -83,26 +83,26 @@ func TestIsInLineRanges(t *testing.T) {
ranges := []LineRange{ ranges := []LineRange{
{Start: 5, End: 7}, {Start: 5, End: 7},
{Start: 10, End: 12}, {Start: 10, End: 12},
{Start: 20, End: 20}, {Start: 20, End: 20},
} }
tests := []struct { tests := []struct {
lineNum int lineNum int
expected bool expected bool
}{ }{
{1, false}, {1, false},
{4, false}, {4, false},
{5, true}, {5, true},
{6, true}, {6, true},
{7, true}, {7, true},
{8, false}, {8, false},
{10, true}, {10, true},
{11, true}, {11, true},
{12, true}, {12, true},
{15, false}, {15, false},
{20, true}, {20, true},
{21, false}, {21, false},
{100, false}, {100, false},
} }
for _, tt := range tests { for _, tt := range tests {
@@ -118,7 +118,6 @@ func TestIsInLineRanges(t *testing.T) {
func TestIsInLineRangesEmptyRanges(t *testing.T) { func TestIsInLineRangesEmptyRanges(t *testing.T) {
var emptyRanges []LineRange var emptyRanges []LineRange
testLines := []int{1, 5, 10, 100} testLines := []int{1, 5, 10, 100}
for _, lineNum := range testLines { for _, lineNum := range testLines {
result := IsInLineRanges(lineNum, emptyRanges) result := IsInLineRanges(lineNum, emptyRanges)
+3 -7
View File
@@ -1,12 +1,10 @@
package git package git
type GitStatus struct { type GitStatus struct {
IsRepo bool IsRepo bool
RootDir string RootDir string
} }
type FileStatus int type FileStatus int
const ( const (
@@ -15,15 +13,13 @@ const (
StatusUntracked StatusUntracked
) )
type FileChange struct { type FileChange struct {
Path string Path string
Status FileStatus Status FileStatus
LineRanges []LineRange LineRanges []LineRange
} }
type LineRange struct { type LineRange struct {
Start int Start int
End int End int
} }