Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
help='Rules to always warn (rather than error)')
parser.add_argument('-e', '--error',
help='Rules to always error (rather than warn)')
parser.add_argument('-v', '--verbose', action='store_true', default=False)
parser.add_argument('--version', action='store_true',
help='show bashate version number and exit',
default=False)
parser.add_argument('-s', '--show', action='store_true', default=False)
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)