Skip to content

Commit 416a7c4

Browse files
committed
Make the default value of the --recursive flag false
This may be the path of least astonishment.
1 parent 22f0ad2 commit 416a7c4

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

internal/cli/cli.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func Root() *cobra.Command {
3535
rootCommand.PersistentFlags().String("format", "text", "The output format can be {text|json}.")
3636
rootCommand.PersistentFlags().String("library-manager", "", "Configure the rules for libraries in the Arduino Library Manager index. Can be {submit|update|false}.\nsubmit: Also run additional rules required to pass before a library is accepted for inclusion in the index.\nupdate: Also run additional rules required to pass before new releases of a library already in the index are accepted.\nfalse: Don't run any Library Manager-specific rules.")
3737
rootCommand.PersistentFlags().String("project-type", "all", "Only check projects of the specified type and their subprojects. Can be {sketch|library|all}.")
38-
rootCommand.PersistentFlags().Bool("recursive", true, "Search path recursively for Arduino projects to check. Can be {true|false}.")
38+
rootCommand.PersistentFlags().Bool("recursive", false, "Search path recursively for Arduino projects to check. Can be {true|false}.")
3939
rootCommand.PersistentFlags().String("report-file", "", "Save a report on the rules to this file.")
4040
rootCommand.PersistentFlags().BoolP("verbose", "v", false, "Show more information while running rules.")
4141
rootCommand.PersistentFlags().Bool("version", false, "Print version and timestamp of the build.")

test/test_all.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626

2727

2828
def test_defaults(run_command):
29-
result = run_command(cmd=[], custom_working_dir=test_data_path.joinpath("recursive"))
29+
result = run_command(cmd=[], custom_working_dir=test_data_path.joinpath("ValidSketch"))
3030
assert result.ok
3131

32+
result = run_command(cmd=[], custom_working_dir=test_data_path.joinpath("recursive"))
33+
assert not result.ok
34+
3235

3336
@pytest.mark.parametrize(
3437
"project_folder, compliance_level",
@@ -115,16 +118,11 @@ def test_project_type_invalid(run_command):
115118

116119
def test_recursive(run_command):
117120
valid_projects_path = test_data_path.joinpath("recursive")
118-
result = run_command(cmd=["--recursive", "true", valid_projects_path])
119-
assert result.ok
120-
121-
result = run_command(cmd=["--recursive", "false", valid_projects_path])
121+
result = run_command(cmd=[valid_projects_path])
122122
assert not result.ok
123123

124-
125-
def test_recursive_invalid(run_command):
126-
result = run_command(cmd=["--recursive", "foo", test_data_path.joinpath("ValidSketch")])
127-
assert not result.ok
124+
result = run_command(cmd=["--recursive", valid_projects_path])
125+
assert result.ok
128126

129127

130128
def test_report_file(run_command, working_dir):
@@ -142,7 +140,6 @@ def test_report_file(run_command, working_dir):
142140
"--project-type",
143141
project_type,
144142
"--recursive",
145-
"true",
146143
"--report-file",
147144
report_file_name,
148145
project_path,
@@ -206,7 +203,7 @@ def test_version(run_command):
206203

207204

208205
def test_arduino_lint_official(run_command):
209-
project_path = test_data_path.joinpath("ARDUINO_LINT_OFFICIAL")
206+
project_path = test_data_path.joinpath("ARDUINO_LINT_OFFICIAL", "Arduino_Lib")
210207

211208
result = run_command(cmd=[project_path])
212209
assert not result.ok

0 commit comments

Comments
 (0)