From 91e6f4c37da6dd23efb47b6fe41c45d21bf6664e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 16 Apr 2014 11:05:58 +0200 Subject: [PATCH] Better linting with config files --- .flake8 | 8 +++++ .pylintrc | 42 ++++++++++++++++++++++ qutebrowser/commands/keys.py | 4 +-- qutebrowser/commands/utils.py | 2 +- qutebrowser/models/completion.py | 4 +-- qutebrowser/network/qutescheme.py | 3 +- qutebrowser/network/schemehandler.py | 2 +- qutebrowser/utils/style.py | 2 +- qutebrowser/utils/url.py | 4 +-- run_checks.py | 54 +++++++++++----------------- 10 files changed, 82 insertions(+), 43 deletions(-) create mode 100644 .flake8 create mode 100644 .pylintrc diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..3da4e9c6b --- /dev/null +++ b/.flake8 @@ -0,0 +1,8 @@ +[flake8] +# E241: Multiple spaces after , +# E265: Block comment should start with '#' +# F401: Unused import (checked by pylint) +# E501: Line too long (checked by pylint) +ignore=E241,E265,F401,E501 +max_complexity = 10 +exclude = appdirs.py diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 000000000..22d815227 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,42 @@ +[MASTER] +ignore=appdirs.py + +[MESSAGES CONTROL] +disable=no-self-use, + super-on-old-class, + old-style-class, + abstract-class-little-used, + bad-builtin, + star-args, + fixme, + global-statement, + no-init, + locally-disabled, + too-many-ancestors, + too-few-public-methods, + too-many-public-methods + +[BASIC] +module-rgx=[a-z_]*$ +const-rgx=[A-Za-z_][A-Za-z0-9_]{0,30}$ +method-rgx=[a-z_][A-Za-z0-9_]{2,30}$ +attr-rgx=[a-z_][a-z0-9_]{0,30}$ +argument-rgx=[a-z_][a-z0-9_]{0,30}$ +variable-rgx=[a-z_][a-z0-9_]{0,30}$ +class-attribute-rgx=[A-Za-z_][A-Za-z0-9_]{1,30}$ +inlinevar-rgx=[a-z_][a-z0-9_]*$ +bad-names=foo,bar,baz,tmp + +[FORMAT] +max-line-length=79 +ignore-long-lines=