mirror of
https://github.com/go-task/task.git
synced 2026-06-11 09:51:50 +00:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user