Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Valentin Maerten
2026-06-07 16:16:58 +02:00
committed by GitHub
parent 70fe29314f
commit 7d92de8e44
2 changed files with 6 additions and 3 deletions

View File

@@ -64,11 +64,14 @@ func readGitignoreLines(path string) []string {
var lines []string
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
line := strings.TrimRight(scanner.Text(), "\r")
if line != "" && !strings.HasPrefix(line, "#") {
lines = append(lines, line)
}
}
if err := scanner.Err(); err != nil {
return nil
}
return lines
}

View File

@@ -76,8 +76,8 @@ func (t *Task) IsSilent() bool {
return t.Silent != nil && *t.Silent
}
// ShouldUseGitignore returns true if the task has gitignore filtering explicitly enabled.
// Returns false if UseGitignore is nil (not set) or explicitly set to false.
// ShouldUseGitignore returns true if gitignore filtering is enabled for the task.
// Returns false if UseGitignore is nil or set to false.
func (t *Task) ShouldUseGitignore() bool {
return t.UseGitignore != nil && *t.UseGitignore
}