Skip to content

Commit e639ff4

Browse files
committed
exit early on parse failures, close #31
1 parent 159e08a commit e639ff4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/shellinspector/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ def run(target_host, spec_file_paths, identity, tags, verbose, skip_retry):
112112

113113
si_user_values = {}
114114
handled_fixtures = set()
115+
parse_failed = False
115116

116117
# Parse files
117118
for spec_file_path in spec_file_paths:
118119
spec_file = parse_spec_file(spec_file_path)
119120

120121
if spec_file is None or spec_file.errors:
122+
parse_failed = True
121123
continue
122124

123125
if tags and not any(t in spec_file.tags for t in tags):
@@ -129,6 +131,9 @@ def run(target_host, spec_file_paths, identity, tags, verbose, skip_retry):
129131
else:
130132
spec_files.append(spec_file)
131133

134+
if parse_failed:
135+
return 1
136+
132137
# run RUN scoped fixtures (pre)
133138
for spec_file in spec_files:
134139
if (

0 commit comments

Comments
 (0)