mirror of
https://github.com/go-task/task.git
synced 2026-06-27 06:34:18 +00:00
rename: gitignore -> use_gitignore for clarity
Rename the Taskfile/task option from `gitignore` to `use_gitignore` to avoid ambiguity (could be read as "ignore git" vs "use .gitignore"). Consistent with Biome's `useIgnoreFile` naming convention.
This commit is contained in:
@@ -38,7 +38,7 @@ type Task struct {
|
||||
Method string
|
||||
Prefix string `hash:"ignore"`
|
||||
IgnoreError bool
|
||||
Gitignore *bool
|
||||
UseGitignore *bool
|
||||
Run string
|
||||
Platforms []*Platform
|
||||
If string
|
||||
@@ -76,10 +76,10 @@ func (t *Task) IsSilent() bool {
|
||||
return t.Silent != nil && *t.Silent
|
||||
}
|
||||
|
||||
// IsGitignore returns true if the task has gitignore filtering explicitly enabled.
|
||||
// Returns false if Gitignore is nil (not set) or explicitly set to false.
|
||||
func (t *Task) IsGitignore() bool {
|
||||
return t.Gitignore != nil && *t.Gitignore
|
||||
// ShouldUseGitignore returns true if the task has gitignore filtering explicitly enabled.
|
||||
// Returns false if UseGitignore is nil (not set) or explicitly set to false.
|
||||
func (t *Task) ShouldUseGitignore() bool {
|
||||
return t.UseGitignore != nil && *t.UseGitignore
|
||||
}
|
||||
|
||||
// WildcardMatch will check if the given string matches the name of the Task and returns any wildcard values.
|
||||
@@ -157,7 +157,7 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
|
||||
Method string
|
||||
Prefix string
|
||||
IgnoreError bool `yaml:"ignore_error"`
|
||||
Gitignore *bool `yaml:"gitignore,omitempty"`
|
||||
UseGitignore *bool `yaml:"use_gitignore,omitempty"`
|
||||
Run string
|
||||
Platforms []*Platform
|
||||
If string
|
||||
@@ -198,7 +198,7 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
|
||||
t.Method = task.Method
|
||||
t.Prefix = task.Prefix
|
||||
t.IgnoreError = task.IgnoreError
|
||||
t.Gitignore = deepcopy.Scalar(task.Gitignore)
|
||||
t.UseGitignore = deepcopy.Scalar(task.UseGitignore)
|
||||
t.Run = task.Run
|
||||
t.Platforms = task.Platforms
|
||||
t.If = task.If
|
||||
@@ -242,7 +242,7 @@ func (t *Task) DeepCopy() *Task {
|
||||
Method: t.Method,
|
||||
Prefix: t.Prefix,
|
||||
IgnoreError: t.IgnoreError,
|
||||
Gitignore: deepcopy.Scalar(t.Gitignore),
|
||||
UseGitignore: deepcopy.Scalar(t.UseGitignore),
|
||||
Run: t.Run,
|
||||
IncludeVars: t.IncludeVars.DeepCopy(),
|
||||
IncludedTaskfileVars: t.IncludedTaskfileVars.DeepCopy(),
|
||||
|
||||
Reference in New Issue
Block a user