davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=2d0668c54810aaf799116c1d1c0a2ea400c418f3

commit 2d0668c54810aaf799116c1d1c0a2ea400c418f3
Author: Dave Andreoli <[email protected]>
Date:   Thu Nov 18 07:22:27 2021 +0100

    A bit of linting
---
 .pylintrc   |  9 +++++++++
 doc/conf.py | 63 ++++++++++++++++++++++++++++++-------------------------------
 setup.py    |  4 ++--
 3 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/.pylintrc b/.pylintrc
new file mode 100644
index 0000000..5e3f8a0
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,9 @@
+[MESSAGES CONTROL]
+
+#enable=
+
+disable=consider-using-f-string,  # for older python we still support
+        redundant-u-string-prefix,  # for older python we still support
+        missing-function-docstring, 
+        missing-class-docstring, 
+        missing-module-docstring,
diff --git a/doc/conf.py b/doc/conf.py
index 466a366..3e46417 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -6,32 +6,36 @@
 # list see the documentation:
 # https://www.sphinx-doc.org/en/master/usage/configuration.html
 
-import sys, os, platform
+# pylint: disable=invalid-name
+
+import os
+import sys
+import platform
 
 
 # -- Path setup --------------------------------------------------------------
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here.
-d = "lib.%s-%s-%d.%d" % (
-        platform.system().lower(),
-        platform.machine(),
-        sys.version_info[0],
-        sys.version_info[1]
-    )
-sys.path.insert(0, os.path.abspath("../build/"+d))
-#sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
+d = 'lib.%s-%s-%d.%d' % (
+    platform.system().lower(),
+    platform.machine(),
+    sys.version_info[0],
+    sys.version_info[1]
+)
+sys.path.insert(0, os.path.abspath('../build/' + d))
+# sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
 
 # Delete any previously imported efl package
-if "efl" in sys.modules:
-    del sys.modules["efl"]
+if 'efl' in sys.modules:
+    del sys.modules['efl']
 
 
 # -- Project information -----------------------------------------------------
 
-project = u'Python EFL'
+project = 'Python EFL'
 author = 'The Python-EFL community (see AUTHORS)'
-copyright = u'2008-2021, ' + author
+copyright = '2008-2021, ' + author  # pylint: disable=redefined-builtin
 
 
 # -- General configuration ----------------------------------------------------
@@ -73,16 +77,15 @@ autodoc_default_options = {
 autoclass_content = 'both'
 
 def setup(app):
-    from sphinx.ext.autodoc import cut_lines
     app.connect('autodoc-process-signature', autodoc_process_signature)
 
-def autodoc_process_signature(app, what, name, obj, options, signature, 
return_annotation):
+def autodoc_process_signature(_app, what, _name, _obj, _options, signature, 
return_annotation):
     """Cleanup params: remove the 'self' param and all the cython types"""
 
     if what not in ('function', 'method'):
-        return
+        return None
 
-    params = list()
+    params = []
     for param in (p.strip() for p in signature[1:-1].split(',')):
         if param != 'self':
             params.append(param.rpartition(' ')[2])
@@ -93,28 +96,28 @@ def autodoc_process_signature(app, what, name, obj, 
options, signature, return_a
 # -- Inheritance Diagram ------------------------------------------------------
 
 try:
-    import gv
+    import gv  # pylint: disable=unused-import
 except ImportError:
     pass
 else:
     extensions.append('sphinx.ext.inheritance_diagram')
     # svg scale better (look at the full elm dia)
     # but svg links are broken :(
-    graphviz_output_format = "svg" # png (default) or svg
+    graphviz_output_format = 'svg'  # png (default) or svg
     inheritance_graph_attrs = dict(
-        bgcolor = 'gray25', #404040
+        bgcolor = 'gray25',  #404040
     )
     inheritance_node_attrs = dict(
-        style = 'rounded', # or 'filled',
-        # fillcolor = "gray20", # bg color (should be #CCCCCC)
-        color = 'gray10',     # border color (should be #202020)
+        style = 'rounded',  # or 'filled',
+        # fillcolor = 'gray20',  # bg color (should be #CCCCCC)
+        color = 'gray10',  # border color (should be #202020)
         fontcolor = 'white',
         font = 'sans',
 
     )
     inheritance_edge_attrs = dict(
-        color = 'dodgerblue3', # arrow color (should be #4399FF)
-        dir = 'none', # arrow direction (back, forward, both or none)
+        color = 'dodgerblue3',  # arrow color (should be #4399FF)
+        dir = 'none',  # arrow direction (back, forward, both or none)
     )
 
 
@@ -142,16 +145,16 @@ html_theme_path = ['themes']
 #html_title = None
 
 # A shorter title for the navigation bar.  Default is the same as html_title.
-html_short_title = "Python EFL"
+html_short_title = 'Python EFL'
 
 # The name of an image file (relative to this directory) to place at the top
 # of the sidebar.
-html_logo = "images/logo.png"
+html_logo = 'images/logo.png'
 
 # The name of an image file (within the static path) to use as favicon of the
 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
 # pixels large.
-html_favicon = "images/logo.ico"
+html_favicon = 'images/logo.ico'
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
@@ -162,10 +165,6 @@ html_static_path = ['images']
 # using the given strftime format.
 html_last_updated_fmt = '%b %d, %Y'
 
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
 # Custom sidebar templates, maps document names to template names.
 #html_sidebars = {}
 
diff --git a/setup.py b/setup.py
index 56c08e8..e39d618 100755
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ import subprocess
 from distutils.core import setup, Command
 from distutils.extension import Extension
 from distutils.command.build_ext import build_ext
-from distutils.version import StrictVersion, LooseVersion
+from distutils.version import LooseVersion
 from efl import __version__, __version_info__ as vers
 
 script_path = os.path.dirname(os.path.abspath(__file__))
@@ -36,7 +36,7 @@ if vers[2] == 99:
         RELEASE += "a0"
 
 
-# XXX: Force default visibility. See phab T504
+# Force default visibility. See phab T504
 if os.getenv("CFLAGS") is not None and "-fvisibility=" in os.environ["CFLAGS"]:
     os.environ["CFLAGS"] += " -fvisibility=default"
 

-- 


Reply via email to