Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions analyzer/codechecker_analyzer/cli/fixit.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,15 @@ def main(args):
"arriving from standard input.")
sys.exit(1)

try:
reports = None if sys.stdin.isatty() else json.loads(sys.stdin.read())
except json.decoder.JSONDecodeError as ex:
LOG.error("JSON format error on standard input: %s", ex)
sys.exit(1)
reports = None
if not sys.stdin.isatty():
stdin_data = sys.stdin.read().strip()
if stdin_data:
try:
reports = json.loads(stdin_data)
except json.decoder.JSONDecodeError as ex:
LOG.error("JSON format error on standard input: %s", ex)
sys.exit(1)

# "CodeChecker fixit" can be applied on the output of
# "CodeChecker cmd diff" command. Earlier this was a simple list of
Expand Down
Loading