Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to pylint #134

Merged
merged 8 commits into from
May 21, 2022
Merged

change to pylint #134

merged 8 commits into from
May 21, 2022

Conversation

kemingy
Copy link
Member

@kemingy kemingy commented May 12, 2022

Signed-off-by: Keming kemingy94@gmail.com

Signed-off-by: Keming <kemingy94@gmail.com>
@kemingy kemingy marked this pull request as draft May 12, 2022 15:55
@kemingy kemingy mentioned this pull request May 12, 2022
Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
@kemingy
Copy link
Member Author

kemingy commented May 16, 2022

There are still some lint warnings that may need to discuss:

pylint -j 4 mosec/ --reports=yes                                                                                                             (base) 
************* Module mosec.worker
mosec/worker.py:61:4: R0201: Method could be a function (no-self-use)
mosec/worker.py:65:4: R0201: Method could be a function (no-self-use)
mosec/worker.py:76:4: C0103: Attribute name "id" doesn't conform to snake_case naming style (invalid-name)
mosec/worker.py:84:4: R0201: Method could be a function (no-self-use)
mosec/worker.py:102:4: R0201: Method could be a function (no-self-use)
************* Module mosec.coordinator
mosec/coordinator.py:49:4: R0913: Too many arguments (10/5) (too-many-arguments)
mosec/coordinator.py:137:23: W0703: Catching too general exception Exception (broad-except)
mosec/coordinator.py:163:28: W0212: Access to a protected member _stage of a client class (protected-access)
mosec/coordinator.py:165:15: W0212: Access to a protected member _deserialize_ipc of a client class (protected-access)
mosec/coordinator.py:172:27: W0212: Access to a protected member _stage of a client class (protected-access)
mosec/coordinator.py:174:15: W0212: Access to a protected member _serialize_ipc of a client class (protected-access)
mosec/coordinator.py:183:28: W0212: Access to a protected member _stage of a client class (protected-access)
mosec/coordinator.py:198:27: W0212: Access to a protected member _stage of a client class (protected-access)
mosec/coordinator.py:250:19: W0703: Catching too general exception Exception (broad-except)
mosec/coordinator.py:228:23: W0212: Access to a protected member _max_batch_size of a client class (protected-access)
************* Module mosec.server
mosec/server.py:44:0: R0902: Too many instance attributes (13/7) (too-many-instance-attributes)
mosec/server.py:176:39: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
mosec/server.py:298:4: R0913: Too many arguments (6/5) (too-many-arguments)
mosec/server.py:333:15: W0703: Catching too general exception Exception (broad-except)
mosec/server.py:339:60: C0103: Argument name "id" doesn't conform to snake_case naming style (invalid-name)
mosec/server.py:339:60: W0622: Redefining built-in 'id' (redefined-builtin)


Report
======
469 statements analysed.

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

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |11     |11         |=          |18.18       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |8      |8          |=          |100.00      |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |43     |43         |=          |100.00      |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |8      |8          |=          |100.00      |0.00     |
+---------+-------+-----------+-----------+------------+---------+



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

    mosec 
      \-args (mosec.server)
      \-coordinator (mosec.server)
      \-errors (mosec.coordinator,mosec.worker)
      \-ipc (mosec.coordinator,mosec.plugins.plasma_shm,mosec.server)
      \-protocol (mosec.coordinator)
      \-worker (mosec.coordinator,mosec.server)
    pkg_resources (mosec.server)
    pyarrow 
      \-plasma (mosec.plugins.plasma_shm)



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

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |634    |52.88 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |254    |21.18 |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |159    |13.26 |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |152    |12.68 |NC       |NC         |
+----------+-------+------+---------+-----------+



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

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



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

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |2      |2        |2          |
+-----------+-------+---------+-----------+
|refactor   |8      |8        |8          |
+-----------+-------+---------+-----------+
|warning    |11     |11       |11         |
+-----------+-------+---------+-----------+
|error      |0      |0        |0          |
+-----------+-------+---------+-----------+



Messages
--------

+-----------------------------+------------+
|message id                   |occurrences |
+=============================+============+
|protected-access             |7           |
+-----------------------------+------------+
|no-self-use                  |4           |
+-----------------------------+------------+
|broad-except                 |3           |
+-----------------------------+------------+
|too-many-arguments           |2           |
+-----------------------------+------------+
|invalid-name                 |2           |
+-----------------------------+------------+
|too-many-instance-attributes |1           |
+-----------------------------+------------+
|redefined-builtin            |1           |
+-----------------------------+------------+
|consider-using-with          |1           |
+-----------------------------+------------+




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

Signed-off-by: Keming <kemingy94@gmail.com>
mosec/worker.py Outdated Show resolved Hide resolved
@kemingy kemingy requested a review from lkevinzc May 19, 2022 17:20
@kemingy kemingy marked this pull request as ready for review May 19, 2022 17:20
@kemingy kemingy changed the title Draft: change to pylint change to pylint May 19, 2022
@kemingy
Copy link
Member Author

kemingy commented May 19, 2022

TODO: make sure examples and tests can pass the pylint check.

mosec/coordinator.py Outdated Show resolved Hide resolved
mosec/coordinator.py Outdated Show resolved Hide resolved
mosec/worker.py Outdated Show resolved Hide resolved
Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
@kemingy kemingy requested a review from lkevinzc May 21, 2022 07:11
Copy link
Member

@lkevinzc lkevinzc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Awesome work!

@kemingy kemingy merged commit cef38bb into main May 21, 2022
@kemingy kemingy deleted the fix_pylint branch May 21, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants