Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 1d6c00b

Browse files
committed
Fixed repeated assignments of code.
1 parent 76d7ced commit 1d6c00b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/pydocstyle/cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ def run_pydocstyle(use_pep257=False):
5151
# An illegal configuration file was found during file generation.
5252
return ReturnCode.invalid_options
5353

54-
code = ReturnCode.no_violations_found
5554
count = 0
5655
for error in errors:
5756
sys.stderr.write('%s\n' % error)
58-
code = ReturnCode.violations_found
5957
count += 1
58+
if count == 0:
59+
exit_code = ReturnCode.no_violations_found
60+
else:
61+
exit_code = ReturnCode.violations_found
6062
if run_conf.count:
6163
print(count)
62-
return code
64+
return exit_code
6365

6466

6567
def main(use_pep257=False):

0 commit comments

Comments
 (0)