blob: f26e0a5b2ed8c03ed298887628ea95ddede901ed [file] [log] [blame]
from __future__ import print_function
import argparse
import io
import json
import sys
from typing import Optional
from typing import Sequence
def main(argv=None): # type: (Optional[Sequence[str]]) -> int
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to check.')
args = parser.parse_args(argv)
retval = 0
for filename in args.filenames:
json.load(, encoding='UTF-8'))
except (ValueError, UnicodeDecodeError) as exc:
print('{}: Failed to json decode ({})'.format(filename, exc))
retval = 1
return retval
if __name__ == '__main__':