File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ extension SwiftFormatCommand {
25
25
@Flag (
26
26
name: . shortAndLong,
27
27
help: " Overwrite the current file when formatting. " )
28
- var inPlace : Bool
28
+ var inPlace : Bool = false
29
29
30
30
@OptionGroup ( )
31
31
var formatOptions : LintFormatOptions
Original file line number Diff line number Diff line change @@ -28,9 +28,8 @@ extension SwiftFormatCommand {
28
28
/// If not specified, the tool will be run in format mode.
29
29
@Option (
30
30
name: . shortAndLong,
31
- default: . format,
32
31
help: " The mode to run swift-format in. Either 'format', 'lint', or 'dump-configuration'. " )
33
- var mode : ToolMode
32
+ var mode : ToolMode = . format
34
33
35
34
@OptionGroup ( )
36
35
var lintFormatOptions : LintFormatOptions
@@ -41,7 +40,7 @@ extension SwiftFormatCommand {
41
40
@Flag (
42
41
name: . shortAndLong,
43
42
help: " Overwrite the current file when formatting ('format' mode only). " )
44
- var inPlace : Bool
43
+ var inPlace : Bool = false
45
44
46
45
mutating func validate( ) throws {
47
46
if inPlace && ( mode != . format || lintFormatOptions. paths. isEmpty) {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ struct LintFormatOptions: ParsableArguments {
37
37
@Flag (
38
38
name: . shortAndLong,
39
39
help: " Recursively run on '.swift' files in any provided directories. " )
40
- var recursive : Bool
40
+ var recursive : Bool = false
41
41
42
42
/// Whether unparsable files, due to syntax errors or unrecognized syntax, should be ignored or
43
43
/// treated as containing an error. When ignored, unparsable files are output verbatim in format
@@ -47,14 +47,14 @@ struct LintFormatOptions: ParsableArguments {
47
47
Ignores unparsable files, disabling all diagnostics and formatting for files that contain \
48
48
invalid syntax.
49
49
""" )
50
- var ignoreUnparsableFiles : Bool
50
+ var ignoreUnparsableFiles : Bool = false
51
51
52
52
/// The list of paths to Swift source files that should be formatted or linted.
53
53
@Argument ( help: " Zero or more input filenames. " )
54
54
var paths : [ String ] = [ ]
55
55
56
- @Flag ( help: . hidden) var debugDisablePrettyPrint : Bool
57
- @Flag ( help: . hidden) var debugDumpTokenStream : Bool
56
+ @Flag ( help: . hidden) var debugDisablePrettyPrint : Bool = false
57
+ @Flag ( help: . hidden) var debugDumpTokenStream : Bool = false
58
58
59
59
mutating func validate( ) throws {
60
60
if recursive && paths. isEmpty {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import ArgumentParser
15
15
/// Encapsulates `--version` flag behavior.
16
16
struct VersionOptions : ParsableArguments {
17
17
@Flag ( name: . shortAndLong, help: " Print the version and exit " )
18
- var version : Bool
18
+ var version : Bool = false
19
19
20
20
func validate( ) throws {
21
21
if version {
You can’t perform that action at this time.
0 commit comments