[jira] [Commented] (DISPATCH-1974) Fix and remove ignores in flake8 configuration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DISPATCH-1974) Fix and remove ignores in flake8 configuration

ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/DISPATCH-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17292116#comment-17292116 ]

ASF GitHub Bot commented on DISPATCH-1974:
------------------------------------------

jiridanek commented on a change in pull request #1058:
URL: https://github.com/apache/qpid-dispatch/pull/1058#discussion_r584110392



##########
File path: python/qpid_dispatch_internal/display_name/display_name.py
##########
@@ -29,14 +29,10 @@
 from __future__ import absolute_import
 from __future__ import print_function
 
-
+import json
 import traceback
-from traceback import format_exc
 
-from ..router.message import Message
-
-from ..dispatch import IoAdapter, LogAdapter, LOG_INFO, LOG_ERROR, LOG_TRACE, LOG_STACK_LIMIT
-import json
+from qpid_dispatch_internal import dispatch

Review comment:
       I admit going this far in this particular case is somewhat gratuitous, but referring to imported names with `import module; module.name` imo generally works better overall than `from module import name; name`.

##########
File path: tests/system_tests_topology_disposition.py.in
##########
@@ -423,12 +417,6 @@ class TopologyDispositionTests (TestCase):
         if self.skip[name] :
             self.skipTest("Test skipped during development.")
 
-        try:
-            import ast

Review comment:
       ast is available everywhere since Python 2.6

##########
File path: tests/system_tests_tcp_adaptor.py
##########
@@ -61,7 +55,7 @@ class TCP_echo_server(object):
 DISABLE_SELECTOR_TESTS = False
 DISABLE_SELECTOR_REASON = ''
 try:
-    import selectors
+    import selectors  # noqa F401: 'selectors' imported but unused

Review comment:
       btw, this is the way to do line-suppressions for flake8; afaik dispatch did not yet have any such

##########
File path: tests/tox.ini.in
##########
@@ -96,10 +96,6 @@ ignore =
     H301,
     # H306: imports not in alphabetical order
     H306,
-    # imported but unused
-    F401,
-    # 'from proton import *' used; unable to detect undefined names
-    F403,

Review comment:
       here goes the main part, everything else is just to fix the warnings that creep up when this here is removed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


> Fix and remove ignores in flake8 configuration
> ----------------------------------------------
>
>                 Key: DISPATCH-1974
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1974
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>    Affects Versions: 1.16.0
>            Reporter: Jiri DanÄ›k
>            Priority: Major
>
> Fixes with autopep8 in DISPATCH-1814 resolved many flake8 warnings. There are still warnings left that require human consideration and fixing.
> For example, usage of bare {{except}} in the code.
> This must be fixed manually. Fixed issues should then be removed from the tox.ini flake8 ignore section.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]