fix linter errors in etcdb/converters.py

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by running the reported pylint command against etcdb/converters.py and review the listed 57 convention and warning messages. Make the file pass pylint without changing its converter behavior, then rerun pylint to confirm there are no remaining reported issues.

Written by the indexing model from the issue text.

Description

  • Etcd Database Driver version: 1.0.3
Description

pylint fails on etcdb/converters.py

What I Did
$ pylint etcdb/converters.py
************* Module etcdb.converters
C:  1, 0: Missing module docstring (missing-docstring)
C: 11, 0: Invalid argument name "o" (invalid-name)
C: 11, 0: Invalid argument name "d" (invalid-name)
C: 11, 0: Missing function docstring (missing-docstring)
W: 11,22: Unused argument 'd' (unused-argument)
W: 11,19: Unused argument 'o' (unused-argument)
C: 15, 0: Invalid function name "Thing2Literal" (invalid-name)
C: 15, 0: Invalid argument name "o" (invalid-name)
C: 15, 0: Invalid argument name "d" (invalid-name)
C: 25, 0: Invalid function name "Thing2Str" (invalid-name)
C: 25, 0: Invalid argument name "s" (invalid-name)
C: 25, 0: Invalid argument name "d" (invalid-name)
W: 25,17: Unused argument 'd' (unused-argument)
C: 30, 0: Invalid constant name "Long2Int" (invalid-name)
C: 33, 0: Invalid function name "Float2Str" (invalid-name)
C: 33, 0: Invalid argument name "o" (invalid-name)
C: 33, 0: Invalid argument name "d" (invalid-name)
C: 33, 0: Missing function docstring (missing-docstring)
W: 33,17: Unused argument 'd' (unused-argument)
C: 37, 0: Invalid function name "None2NULL" (invalid-name)
C: 37, 0: Invalid argument name "o" (invalid-name)
C: 37, 0: Invalid argument name "d" (invalid-name)
W: 37,17: Unused argument 'd' (unused-argument)
W: 37,14: Unused argument 'o' (unused-argument)
C: 42, 0: Invalid argument name "o" (invalid-name)
C: 42, 0: Invalid argument name "d" (invalid-name)
W: 42,23: Unused argument 'd' (unused-argument)
C: 47, 0: Invalid argument name "o" (invalid-name)
C: 47, 0: Invalid argument name "d" (invalid-name)
W: 47,19: Unused argument 'd' (unused-argument)
C: 52, 0: Invalid function name "Instance2Str" (invalid-name)
C: 52, 0: Invalid argument name "o" (invalid-name)
C: 52, 0: Invalid argument name "d" (invalid-name)
C: 66, 4: Invalid variable name "cl" (invalid-name)
W: 66, 9: Used builtin function 'filter'. Using a list comprehension can be clearer. (bad-builtin)
W: 66, 9: map/filter on lambda could be replaced by comprehension (deprecated-lambda)
C: 67,16: Using type() instead of isinstance() for a typecheck. (unidiomatic-typecheck)
C: 80, 0: Invalid function name "array2Str" (invalid-name)
C: 80, 0: Invalid argument name "o" (invalid-name)
C: 80, 0: Invalid argument name "d" (invalid-name)
C: 80, 0: Missing function docstring (missing-docstring)
C: 84, 0: Invalid function name "Unicode2Str" (invalid-name)
C: 84, 0: Invalid argument name "s" (invalid-name)
C: 84, 0: Invalid argument name "d" (invalid-name)
W: 84,19: Unused argument 'd' (unused-argument)
C: 91, 0: Invalid function name "Bool2Str" (invalid-name)
C: 91, 0: Invalid argument name "s" (invalid-name)
C: 91, 0: Invalid argument name "d" (invalid-name)
C: 91, 0: Missing function docstring (missing-docstring)
W: 91,16: Unused argument 'd' (unused-argument)
C: 95, 0: Invalid function name "Set2Str" (invalid-name)
C: 95, 0: Invalid argument name "s" (invalid-name)
C: 95, 0: Invalid argument name "d" (invalid-name)
C: 95, 0: Missing function docstring (missing-docstring)
C: 99, 0: Invalid function name "Str2Set" (invalid-name)
C: 99, 0: Invalid argument name "s" (invalid-name)
C: 99, 0: Missing function docstring (missing-docstring)
C:103, 0: Invalid argument name "s" (invalid-name)
C:108, 0: Invalid function name "DateTime_or_None" (invalid-name)
C:108, 0: Invalid argument name "s" (invalid-name)
C:108, 0: Missing function docstring (missing-docstring)
C:112, 0: Invalid function name "TimeDelta_or_None" (invalid-name)
C:112, 0: Invalid argument name "s" (invalid-name)
C:112, 0: Missing function docstring (missing-docstring)
C:116, 0: Invalid function name "Date_or_None" (invalid-name)
C:116, 0: Invalid argument name "s" (invalid-name)
C:116, 0: Missing function docstring (missing-docstring)
C:120, 0: Invalid constant name "conversions" (invalid-name)
C:  8, 0: standard import "import array" comes before "from etcdb import NULL" (wrong-import-order)


Report
======
47 statements analysed.

Statistics by type
------------------

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |1      |1          |=          |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |0      |0          |=          |0           |0        |
+---------+-------+-----------+-----------+------------+---------+
|method   |0      |0          |=          |0           |0        |
+---------+-------+-----------+-----------+------------+---------+
|function |17     |17         |=          |47.06       |76.47    |
+---------+-------+-----------+-----------+------------+---------+



External dependencies
---------------------
::

    etcdb (etcdb.converters)
      \-constants 
        \-FIELD_TYPE (etcdb.converters)
        \-FLAG (etcdb.converters)



Raw metrics
-----------

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |91     |55.15 |91       |=          |
+----------+-------+------+---------+-----------+
|docstring |21     |12.73 |21       |=          |
+----------+-------+------+---------+-----------+
|comment   |8      |4.85  |8        |=          |
+----------+-------+------+---------+-----------+
|empty     |45     |27.27 |45       |=          |
+----------+-------+------+---------+-----------+



Duplication
-----------

+-------------------------+------+---------+-----------+
|                         |now   |previous |difference |
+=========================+======+=========+===========+
|nb duplicated lines      |0     |0        |=          |
+-------------------------+------+---------+-----------+
|percent duplicated lines |0.000 |0.000    |=          |
+-------------------------+------+---------+-----------+



Messages by category
--------------------

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |57     |57       |=          |
+-----------+-------+---------+-----------+
|refactor   |0      |0        |=          |
+-----------+-------+---------+-----------+
|warning    |12     |12       |=          |
+-----------+-------+---------+-----------+
|error      |0      |0        |=          |
+-----------+-------+---------+-----------+



Messages
--------

+----------------------+------------+
|message id            |occurrences |
+======================+============+
|invalid-name          |45          |
+----------------------+------------+
|unused-argument       |10          |
+----------------------+------------+
|missing-docstring     |10          |
+----------------------+------------+
|wrong-import-order    |1           |
+----------------------+------------+
|unidiomatic-typecheck |1           |
+----------------------+------------+
|deprecated-lambda     |1           |
+----------------------+------------+
|bad-builtin           |1           |
+----------------------+------------+



Global evaluation
-----------------
Your code has been rated at -4.68/10 (previous run: -4.68/10, +0.00)


Dominant language
Python
Stars
10
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from box/etcdb

All issues in box/etcdb

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.