Loading .lint +32 −0 Original line number Diff line number Diff line Loading @@ -91,5 +91,37 @@ include = ; B950 is a replacement for E501 B0 B903 B950 [pylint.MASTER] persistent=yes ignore = __pycache__ .* [pylint.BASIC] const-rgx = (([A-Z_][A-Z0-9_]*)|(_[A-Za-z0-9_]+))$ good-names = db, i, a, b, ab, t, fd [pylint.REPORTS] reports = no [pylint.FORMAT] indent-string = '\t' [pylint.DESIGN] max-attributes = 10 [pylint.MESSAGES CONTROL] disable = bad-continuation, ; Would be nice to not disable but it is bugged; it trys to interpret tabs as ; spaces. trailing-whitespace, ; Would be nice to have enabled for *code* but not for comments or ; multi-line strings. wrong-import-order, ; Rely on isort, otherwise pylint and isort occasionally clash. ; vim:ft=cfg:sw=2:sts=2:expandtab .pre-commit-config.yaml +6 −0 Original line number Diff line number Diff line Loading @@ -55,3 +55,9 @@ repos: - flake8-return - flake8-sfs - flake8-tabs - repo: . rev: v0.3 hooks: - id: pylint args: ["--fail-under=9.0", "--rcfile=.lint"] pre_commit_pylint.py +7 −4 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ from pylint import lint __version__ = '0.3' @click.command() @click.command(context_settings=dict( ignore_unknown_options=True, )) @click.option( '--extras', '-e', multiple=True, Loading @@ -37,8 +39,8 @@ __version__ = '0.3' default=isfile('setup.py'), help="Use the editable install (develop) feature provided by setuptools", ) @click.argument('files', nargs=-1) def main(extras, fail_under, editable, files): @click.argument('pylint-options', nargs=-1, type=click.UNPROCESSED) def main(extras, fail_under, editable, pylint_options): """Invoke Pylint on the given files after ensuring dependencies are up to date""" join = ','.join cmd = ['pip', 'install', '--upgrade'] Loading @@ -59,7 +61,7 @@ def main(extras, fail_under, editable, files): sys.stderr.write(exc.stderr) sys.exit(3) run = lint.Run(files, do_exit=False) run = lint.Run(list(pylint_options), do_exit=False) score = run.linter.stats['global_note'] if score < fail_under: Loading @@ -67,4 +69,5 @@ def main(extras, fail_under, editable, files): if __name__ == '__main__': # pylint: disable=no-value-for-parameter main() Loading
.lint +32 −0 Original line number Diff line number Diff line Loading @@ -91,5 +91,37 @@ include = ; B950 is a replacement for E501 B0 B903 B950 [pylint.MASTER] persistent=yes ignore = __pycache__ .* [pylint.BASIC] const-rgx = (([A-Z_][A-Z0-9_]*)|(_[A-Za-z0-9_]+))$ good-names = db, i, a, b, ab, t, fd [pylint.REPORTS] reports = no [pylint.FORMAT] indent-string = '\t' [pylint.DESIGN] max-attributes = 10 [pylint.MESSAGES CONTROL] disable = bad-continuation, ; Would be nice to not disable but it is bugged; it trys to interpret tabs as ; spaces. trailing-whitespace, ; Would be nice to have enabled for *code* but not for comments or ; multi-line strings. wrong-import-order, ; Rely on isort, otherwise pylint and isort occasionally clash. ; vim:ft=cfg:sw=2:sts=2:expandtab
.pre-commit-config.yaml +6 −0 Original line number Diff line number Diff line Loading @@ -55,3 +55,9 @@ repos: - flake8-return - flake8-sfs - flake8-tabs - repo: . rev: v0.3 hooks: - id: pylint args: ["--fail-under=9.0", "--rcfile=.lint"]
pre_commit_pylint.py +7 −4 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ from pylint import lint __version__ = '0.3' @click.command() @click.command(context_settings=dict( ignore_unknown_options=True, )) @click.option( '--extras', '-e', multiple=True, Loading @@ -37,8 +39,8 @@ __version__ = '0.3' default=isfile('setup.py'), help="Use the editable install (develop) feature provided by setuptools", ) @click.argument('files', nargs=-1) def main(extras, fail_under, editable, files): @click.argument('pylint-options', nargs=-1, type=click.UNPROCESSED) def main(extras, fail_under, editable, pylint_options): """Invoke Pylint on the given files after ensuring dependencies are up to date""" join = ','.join cmd = ['pip', 'install', '--upgrade'] Loading @@ -59,7 +61,7 @@ def main(extras, fail_under, editable, files): sys.stderr.write(exc.stderr) sys.exit(3) run = lint.Run(files, do_exit=False) run = lint.Run(list(pylint_options), do_exit=False) score = run.linter.stats['global_note'] if score < fail_under: Loading @@ -67,4 +69,5 @@ def main(extras, fail_under, editable, files): if __name__ == '__main__': # pylint: disable=no-value-for-parameter main()