Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
opts = parser.parse_args(args)
if opts.version:
print("bashate: %s" % bashate.__version__)
sys.exit(0)
if opts.show:
messages.print_messages()
sys.exit(0)
files = opts.files
if not files:
parser.print_usage()
return 1
run = BashateRun()
run.register_ignores(opts.ignore)
run.register_warnings(opts.warn)
run.register_errors(opts.error)
try:
run.check_files(files, opts.verbose)
except IOError as e:
print("bashate: %s" % e)
return 1
if run.warning_count > 0:
print("%d bashate warning(s) found" % run.warning_count)
if run.error_count > 0:
print("%d bashate error(s) found" % run.error_count)
return 1