@easy.task<EOL>@easy.cmdopts([<EOL>('<STR_LIT>', '<STR_LIT:o>', '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT:r>', '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT:m>', '<STR_LIT>'),<EOL>])<EOL>@support.task_requires("<STR_LIT>")<EOL>def lint():
<EOL>report_formats = {<EOL>"<STR_LIT>": "<STR_LIT:html>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT:text>",<EOL>}<EOL>lint_build_dir = easy.path("<STR_LIT>")<EOL>lint_build_dir.exists() or lint_build_dir.makedirs()  <EOL>argv = []<EOL>rcfile = easy.options.lint.get("<STR_LIT>")<EOL>if not rcfile and easy.path("<STR_LIT>").exists():<EOL><INDENT>rcfile = "<STR_LIT>"<EOL><DEDENT>if rcfile:<EOL><INDENT>argv += ["<STR_LIT>", os.path.abspath(rcfile)]<EOL><DEDENT>if easy.options.lint.get("<STR_LIT>", False):<EOL><INDENT>argv += ["<STR_LIT>"]<EOL><DEDENT>argv += [<EOL>"<STR_LIT>", (lint_build_dir / "<STR_LIT>").abspath(),<EOL>]<EOL>argv += support.toplevel_packages()<EOL>sys.stderr.write("<STR_LIT>" % (sys.argv[<NUM_LIT:0>], "<STR_LIT>".join(argv)))<EOL>outfile = easy.options.lint.get("<STR_LIT>", None)<EOL>if outfile:<EOL><INDENT>outfile = os.path.abspath(outfile)<EOL><DEDENT>try:<EOL><INDENT>with easy.pushd("<STR_LIT:src>" if easy.path("<STR_LIT:src>").exists() else "<STR_LIT:.>"):<EOL><INDENT>if outfile:<EOL><INDENT>argv.extend(["<STR_LIT>", report_formats.get(easy.path(outfile).ext, "<STR_LIT:text>")])<EOL>sys.stderr.write("<STR_LIT>" % (str(outfile),))<EOL>outhandle = open(outfile, "<STR_LIT:w>")<EOL>try:<EOL><INDENT>subprocess.check_call(["<STR_LIT>"] + argv, stdout=outhandle)<EOL><DEDENT>finally:<EOL><INDENT>outhandle.close()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>subprocess.check_call(["<STR_LIT>"] + argv, )<EOL><DEDENT>sys.stderr.write("<STR_LIT>")<EOL><DEDENT><DEDENT>except subprocess.CalledProcessError as exc:<EOL><INDENT>if exc.returncode & <NUM_LIT:32>:<EOL><INDENT>sys.stderr.write("<STR_LIT>" % (argv,))<EOL>sys.exit(exc.returncode)<EOL><DEDENT>else:<EOL><INDENT>bits = {<EOL><NUM_LIT:1>: "<STR_LIT>",<EOL><NUM_LIT:2>: "<STR_LIT:error>",<EOL><NUM_LIT:4>: "<STR_LIT>",<EOL><NUM_LIT:8>: "<STR_LIT>",<EOL><NUM_LIT:16>: "<STR_LIT>",<EOL>}<EOL>sys.stderr.write("<STR_LIT>" % (<EOL>"<STR_LIT:U+002CU+0020>".join([text for bit, text in bits.items() if exc.returncode & bit])<EOL>))<EOL>if exc.returncode & <NUM_LIT:3>:<EOL><INDENT>sys.stderr.write("<STR_LIT>")<EOL>sys.exit(exc.returncode)<EOL><DEDENT><DEDENT><DEDENT>
report pylint results