Skip to content

Commit d56c94d

Browse files
committed
excise crlf from the codebase
1 parent 3540691 commit d56c94d

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

mage/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ type Invocation struct {
113113
GoCmd string // the go binary command to run
114114
CacheDir string // the directory where we should store compiled binaries
115115
HashFast bool // don't rely on GOCACHE, just hash the magefiles
116-
Multiline bool // whether to retain CRLF line endings in comments for the generated main file
116+
Multiline bool // whether to retain line returns in help text for the generated main file
117117
}
118118

119119
// MagefilesDirName is the name of the default folder to look for if no directory was specified,
@@ -209,7 +209,7 @@ func Parse(stderr, stdout io.Writer, args []string) (inv Invocation, cmd Command
209209
fs.BoolVar(&inv.Force, "f", false, "force recreation of compiled magefile")
210210
fs.BoolVar(&inv.Debug, "debug", mg.Debug(), "turn on debug messages")
211211
fs.BoolVar(&inv.Verbose, "v", mg.Verbose(), "show verbose output when running mage targets")
212-
fs.BoolVar(&inv.Multiline, "multiline", mg.Multiline(), "retain CRLF line endings in descriptions")
212+
fs.BoolVar(&inv.Multiline, "multiline", mg.Multiline(), "retain line returns in help text")
213213
fs.BoolVar(&inv.Help, "h", false, "show this help")
214214
fs.DurationVar(&inv.Timeout, "t", 0, "timeout in duration parsable format (e.g. 5m30s)")
215215
fs.BoolVar(&inv.Keep, "keep", false, "keep intermediate mage files around after running")

mage/main_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -616,17 +616,17 @@ func TestMultiline(t *testing.T) {
616616
name: "list",
617617
args: []string{"-d", "testdata/multiline", "-l"},
618618
// line returns at the end here are important to show that we don't add an extra line return.
619-
output: "This is a global comment for the mage output.\nIt should be retained with CRLF.\n\nTargets:",
619+
output: "This is a global comment for the mage output.\nIt should retain line returns.\n\nTargets:",
620620
},
621621
{
622622
name: "help-func",
623623
args: []string{"-d", "testdata/multiline", "-h", "doit"},
624-
output: "DoIt is a dummy function with a crlf comment.\nThat should show up with multiple lines.\n\nUsage:",
624+
output: "DoIt is a dummy function with a multiline comment.\nThat should show up with multiple lines.\n\nUsage:",
625625
},
626626
{
627627
name: "help-func",
628628
args: []string{"-d", "testdata/multiline", "-h", "sub:doittoo"},
629-
output: "DoItToo is a dummy function with a crlf comment.\nHere's the second line.\n\nUsage:",
629+
output: "DoItToo is a dummy function with a multiline comment.\nHere's the second line.\n\nUsage:",
630630
},
631631
} {
632632
t.Run(tc.name, func(t *testing.T) {
@@ -656,17 +656,17 @@ func TestMultilineTag(t *testing.T) {
656656
name: "list",
657657
args: []string{"-d", "testdata/multiline/tag", "-l"},
658658
// line returns at the end here are important to show that we don't add an extra line return.
659-
output: "This is a global comment for the mage output.\nIt should be retained with CRLF.\n\nTargets:",
659+
output: "This is a global comment for the mage output.\nIt should retain line returns.\n\nTargets:",
660660
},
661661
{
662662
name: "help-func",
663663
args: []string{"-d", "testdata/multiline/tag", "-h", "doit"},
664-
output: "DoIt is a dummy function with a crlf comment.\nThat should show up with multiple lines.\n\nUsage:",
664+
output: "DoIt is a dummy function with a multiline comment.\nThat should show up with multiple lines.\n\nUsage:",
665665
},
666666
{
667667
name: "help-func",
668668
args: []string{"-d", "testdata/multiline/tag", "-h", "sub:doittoo"},
669-
output: "DoItToo is a dummy function with a crlf comment.\nHere's the second line.\n\nUsage:",
669+
output: "DoItToo is a dummy function with a multiline comment.\nHere's the second line.\n\nUsage:",
670670
},
671671
} {
672672
// The tests should be the same regardless of the environment variable, because the tag should override.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
//go:build mage
22

33
// This is a global comment for the mage output.
4-
// It should be retained with CRLF.
4+
// It should retain line returns.
55
package main
66

77
import "github.com/magefile/mage/mg"
88

9-
// DoIt is a dummy function with a crlf comment.
9+
// DoIt is a dummy function with a multiline comment.
1010
// That should show up with multiple lines.
1111
func DoIt() {
1212
}
1313

1414
// Sub is a namespace.
15-
// It also has a crlf.
15+
// It also has a line return.
1616
type Sub mg.Namespace
1717

18-
// DoItToo is a dummy function with a crlf comment.
18+
// DoItToo is a dummy function with a multiline comment.
1919
// Here's the second line.
2020
func (Sub) DoItToo() {
2121
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
//go:build mage
22

33
// This is a global comment for the mage output.
4-
// It should be retained with CRLF.
4+
// It should retain line returns.
55
package main
66

77
//mage:multiline // Enable multiline description output.
88

99
import "github.com/magefile/mage/mg"
1010

11-
// DoIt is a dummy function with a crlf comment.
11+
// DoIt is a dummy function with a multiline comment.
1212
// That should show up with multiple lines.
1313
func DoIt() {
1414
}
1515

1616
// Sub is a namespace.
17-
// It also has a crlf.
17+
// It also has a line return.
1818
type Sub mg.Namespace
1919

20-
// DoItToo is a dummy function with a crlf comment.
20+
// DoItToo is a dummy function with a multiline comment.
2121
// Here's the second line.
2222
func (Sub) DoItToo() {
2323
}

mg/runtime.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ func HashFast() bool {
9999
return b
100100
}
101101

102-
// Multiline reports whether the user has requested to retain CRLF line endings
103-
// in comments for the generated main file.
102+
// Multiline reports whether the user has requested to retain line returns
103+
// in help text for the generated main file.
104104
func Multiline() bool {
105105
b, _ := strconv.ParseBool(os.Getenv(MultilineEnv))
106106
return b

0 commit comments

Comments
 (0)