diff --git a/.pylintrc-bin b/.pylintrc-bin index 93125393e9ab1f423e5b892c44f1d5f7c5a9959e..f6b3365fcfa710c424ee63fb9b4701cfc618794e 100644 --- a/.pylintrc-bin +++ b/.pylintrc-bin @@ -50,7 +50,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=line-too-long,bad-whitespace,logging-format-interpolation,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call +disable=line-too-long,logging-format-interpolation,raw-checker-failed,bad-inline-option,file-ignored,suppressed-message,useless-suppression,deprecated-pragma # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/.pylintrc-lib b/.pylintrc-lib index fe1b18f2d7e8b2cedb59a0ad59edf32c7cf9e8c3..9d2b348ec163ee8a61825e9e1417f0f5a7c19f96 100644 --- a/.pylintrc-lib +++ b/.pylintrc-lib @@ -50,7 +50,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=line-too-long,bad-whitespace,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call +disable=line-too-long,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/lib/hawat/base.py b/lib/hawat/base.py index 8ad59bc4dd876c4d60f50603273a9355f7d6fa78..dd27354ff557c189d249fe06047616d7647a980f 100644 --- a/lib/hawat/base.py +++ b/lib/hawat/base.py @@ -1194,7 +1194,7 @@ class HawatBlueprint(flask.Blueprint): """ return 'module-{}'.format(self.name).replace('_', '-') - def register_app(self, app): # pylint: disable=locally-disabled,no-self-use,unused-argument + def register_app(self, app): # pylint: disable=locally-disabled,unused-argument """ *Hook method:* Custom callback, which will be called from :py:func:`hawat.app.Hawat.register_blueprint` method and which can @@ -1243,7 +1243,7 @@ class PsycopgMixin: """ SEARCH_QUERY_QUOTA_CHECK = True - def fetch(self, item_id): # pylint: disable=locally-disabled,no-self-use + def fetch(self, item_id): # pylint: disable=locally-disabled """ Fetch item with given primary identifier from the database. """ diff --git a/lib/hawat/blueprints/auth_pwd/__init__.py b/lib/hawat/blueprints/auth_pwd/__init__.py index 5c5d6d954e8d70ce23e4ec2eb0be3a5ce08f942c..97b07f2696dd7b56510d27ce8ce69fa404777b4a 100644 --- a/lib/hawat/blueprints/auth_pwd/__init__.py +++ b/lib/hawat/blueprints/auth_pwd/__init__.py @@ -113,7 +113,7 @@ class RegisterView(HTMLMixin, SQLAlchemyMixin, BaseRegisterView): choices_locales=locales ) - def do_before_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_action(self, item): # pylint: disable=locally-disabled,unused-argument super().do_before_action(item) item.set_password(item.password) diff --git a/lib/hawat/blueprints/events/__init__.py b/lib/hawat/blueprints/events/__init__.py index 835a65a39c10991fa3022b194b111e7a198258a0..16ea6e89810890103724ef8265261fc4bd88bcaa 100644 --- a/lib/hawat/blueprints/events/__init__.py +++ b/lib/hawat/blueprints/events/__init__.py @@ -94,7 +94,7 @@ class AbstractSearchView(PsycopgMixin, BaseSearchView): # pylint: disable=local def get_search_form(request_args): return _get_search_form(request_args) - def do_before_search(self, form_data): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_search(self, form_data): # pylint: disable=locally-disabled,unused-argument form_data['groups'] = [item.name for item in form_data['groups']] def do_before_response(self, **kwargs): diff --git a/lib/hawat/blueprints/filters/__init__.py b/lib/hawat/blueprints/filters/__init__.py index 6bc2bfc90a3076f95c1071e8290064cc48e4de2f..c289ed8ac7e34d9746e7eeb23c4ea0a84632b5ad 100644 --- a/lib/hawat/blueprints/filters/__init__.py +++ b/lib/hawat/blueprints/filters/__init__.py @@ -411,7 +411,7 @@ class CreateView(HTMLMixin, SQLAlchemyMixin, ItemCreateView): # pylint: disable choices_categories=list(zip(categories, categories)) ) - def do_before_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_action(self, item): # pylint: disable=locally-disabled,unused-argument process_rule(item) def do_before_response(self, **kwargs): @@ -516,7 +516,7 @@ class CreateForView(HTMLMixin, SQLAlchemyMixin, def add_parent_to_item(item, parent): item.group = parent - def do_before_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_action(self, item): # pylint: disable=locally-disabled,unused-argument process_rule(item) def do_before_response(self, **kwargs): @@ -606,7 +606,7 @@ class UpdateView(HTMLMixin, SQLAlchemyMixin, ItemUpdateView): # pylint: disable choices_categories=list(zip(categories, categories)) ) - def do_before_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_action(self, item): # pylint: disable=locally-disabled,unused-argument process_rule(item) def do_before_response(self, **kwargs): diff --git a/lib/hawat/blueprints/groups/__init__.py b/lib/hawat/blueprints/groups/__init__.py index ccbad173a786678c138dd6bec661b564ac37d46b..bd252e9cf0f004a2fea48dcafc7b19b6bf855e43 100644 --- a/lib/hawat/blueprints/groups/__init__.py +++ b/lib/hawat/blueprints/groups/__init__.py @@ -254,7 +254,7 @@ class ShowView(HTMLMixin, SQLAlchemyMixin, ItemShowView): ) return action_menu - def do_before_response(self, **kwargs): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_response(self, **kwargs): # pylint: disable=locally-disabled,unused-argument action_menu = hawat.menu.Menu() action_menu.add_entry( 'endpoint', diff --git a/lib/hawat/blueprints/timeline/__init__.py b/lib/hawat/blueprints/timeline/__init__.py index 1b14dd61967b376c4309f0546ba15a01b71a9f94..3b6928c79fa656bc5007dbd6c7e77fdf0d22df70 100644 --- a/lib/hawat/blueprints/timeline/__init__.py +++ b/lib/hawat/blueprints/timeline/__init__.py @@ -122,7 +122,7 @@ class AbstractSearchView(PsycopgMixin, CustomSearchView): # pylint: disable=loc def get_search_form(request_args): return _get_search_form(request_args) - def do_before_search(self, form_data): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_search(self, form_data): # pylint: disable=locally-disabled,unused-argument self.response_context.update( sqlqueries=[] ) @@ -444,7 +444,7 @@ class AbstractLegacySearchView(PsycopgMixin, BaseSearchView): # pylint: disable def get_search_form(request_args): return _get_search_form(request_args) - def do_before_search(self, form_data): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_search(self, form_data): # pylint: disable=locally-disabled,unused-argument form_data['groups'] = [item.name for item in form_data['groups']] def do_after_search(self, items): diff --git a/lib/hawat/blueprints/users/__init__.py b/lib/hawat/blueprints/users/__init__.py index 7f4bbc2ebae917ee0c11fd299a9f6ca8710c56c8..4e415d1897f0762276d46a3aaaa43221b3f9ddc5 100644 --- a/lib/hawat/blueprints/users/__init__.py +++ b/lib/hawat/blueprints/users/__init__.py @@ -250,7 +250,7 @@ class ShowView(HTMLMixin, SQLAlchemyMixin, ItemShowView): ) return action_menu - def do_before_response(self, **kwargs): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_response(self, **kwargs): # pylint: disable=locally-disabled,unused-argument item = self.response_context['item'] action_menu = hawat.menu.Menu() action_menu.add_entry( diff --git a/lib/hawat/view/__init__.py b/lib/hawat/view/__init__.py index ed16e442975d9b5328b14a1caec32e37f0677dac..ba92c592e9e336569dbeb31bc2fa207a0eda2679 100644 --- a/lib/hawat/view/__init__.py +++ b/lib/hawat/view/__init__.py @@ -478,7 +478,7 @@ class RenderableView(BaseView): # pylint: disable=locally-disabled,abstract-met ) raise RuntimeError("Unable to guess default view template, because module name was not yet set.") - def do_before_response(self, **kwargs): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_response(self, **kwargs): # pylint: disable=locally-disabled,unused-argument """ This method will be called just before generating the response. By providing some meaningfull implementation you can use it for some simple item and @@ -588,7 +588,7 @@ class BaseLoginView(SimpleView): """ raise NotImplementedError() - def authenticate_user(self, user): # pylint: disable=locally-disabled,no-self-use,unused-argument + def authenticate_user(self, user): # pylint: disable=locally-disabled,unused-argument """ Authenticate given user. """ @@ -860,12 +860,12 @@ class BaseSearchView(RenderableView, HawatUtils): #--------------------------------------------------------------------------- - def do_before_search(self, form_data): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_search(self, form_data): # pylint: disable=locally-disabled,unused-argument """ This hook method will be called before search attempt. """ - def do_after_search(self, items): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_after_search(self, items): # pylint: disable=locally-disabled,unused-argument """ This hook method will be called after successfull search. """ @@ -996,7 +996,7 @@ class CustomSearchView(BaseSearchView): """ raise NotImplementedError() - def do_after_search(self): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_after_search(self): # pylint: disable=locally-disabled,unused-argument """ This hook method will be called after successfull search. """ @@ -1407,7 +1407,7 @@ class ItemActionView(RenderableView): # pylint: disable=locally-disabled,abstra """ raise NotImplementedError() - def get_url_next(self): # pylint: disable=locally-disabled,no-self-use + def get_url_next(self): # pylint: disable=locally-disabled """ *Hook method*. Must return URL for redirection after action *success*. In most cases there should be call for :py:func:`flask.url_for` function @@ -1431,12 +1431,12 @@ class ItemActionView(RenderableView): # pylint: disable=locally-disabled,abstra return None - def do_before_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_action(self, item): # pylint: disable=locally-disabled,unused-argument """ *Hook method*. Will be called before any action handling tasks. """ - def do_after_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_after_action(self, item): # pylint: disable=locally-disabled,unused-argument """ *Hook method*. Will be called after successfull action handling tasks. """ @@ -2062,11 +2062,11 @@ class BaseRegisterView(ItemCreateView): # pylint: disable=locally-disabled,abst ) flask.current_app.mailer.send(msg) - def do_before_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_before_action(self, item): # pylint: disable=locally-disabled,unused-argument item.roles = [hawat.const.ROLE_USER] item.enabled = False - def do_after_action(self, item): # pylint: disable=locally-disabled,no-self-use,unused-argument + def do_after_action(self, item): # pylint: disable=locally-disabled,unused-argument self.inform_admins(item, self.response_context['form_data']) self.inform_managers(item, self.response_context['form_data']) self.inform_user(item, self.response_context['form_data']) diff --git a/lib/hawat/view/mixin.py b/lib/hawat/view/mixin.py index 972d4b7a8f09d6ae79938ba4fdfe8601fcfb4702..4c19bf246374ca4217d1aaac0a5ed0206d4cc983 100644 --- a/lib/hawat/view/mixin.py +++ b/lib/hawat/view/mixin.py @@ -59,7 +59,7 @@ class HTMLMixin: """ flask.abort(status_code, message) - def flash(self, message, level = 'info'): # pylint: disable=locally-disabled,no-self-use + def flash(self, message, level = 'info'): # pylint: disable=locally-disabled """ Display a one time message to the user. This implementation uses the :py:func:`flask.flash` method. @@ -69,7 +69,7 @@ class HTMLMixin: """ flask.flash(message, level) - def redirect(self, target_url = None, default_url = None, exclude_url = None): # pylint: disable=locally-disabled,no-self-use + def redirect(self, target_url = None, default_url = None, exclude_url = None): # pylint: disable=locally-disabled """ Redirect user to different page. This implementation uses the :py:func:`flask.redirect` method to return valid HTTP redirection response. @@ -118,7 +118,7 @@ class AJAXMixin: ) ) - def flash(self, message, level = 'info'): # pylint: disable=locally-disabled,no-self-use + def flash(self, message, level = 'info'): # pylint: disable=locally-disabled """ Display a one time message to the user. This implementation uses the ``flash_messages`` subkey in returned JSON document to store the messages. @@ -232,7 +232,7 @@ class SnippetMixin(AJAXMixin): **self.response_context ) - def flash(self, message, level = 'info'): # pylint: disable=locally-disabled,no-self-use + def flash(self, message, level = 'info'): # pylint: disable=locally-disabled """ Display a one time message to the user. This implementation uses the ``flash_messages`` subkey in returned JSON document to store the messages. diff --git a/lib/mentat/datatype/sqldb.py b/lib/mentat/datatype/sqldb.py index 6eebde5d42e4025083d21aa346fcc7408fb325f0..dd13a3ae64b76922efba322a484e0bbfa6a8fb9d 100644 --- a/lib/mentat/datatype/sqldb.py +++ b/lib/mentat/datatype/sqldb.py @@ -220,7 +220,7 @@ class UserModel(MODEL): return '{}'.format(self.login) @validates('login', 'email') - def convert_lower(self, key, value): # pylint: disable=locally-disabled,no-self-use,unused-argument + def convert_lower(self, key, value): # pylint: disable=locally-disabled,unused-argument """ Convert login and email to lowercase. """ diff --git a/lib/mentat/services/test_eventstorage.py b/lib/mentat/services/test_eventstorage.py index b4f6db73d3840e9c11a1c381705753e79fc16800..5d6341f80b50c4550a1686ee00b06de9568f274b 100644 --- a/lib/mentat/services/test_eventstorage.py +++ b/lib/mentat/services/test_eventstorage.py @@ -185,7 +185,7 @@ class TestMentatStorage(unittest.TestCase): storage.database_create() return storage - def test_01_service(self): # pylint: disable=locally-disabled,no-self-use + def test_01_service(self): # pylint: disable=locally-disabled """ Perform the basic tests of storage service. """