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

Roger Meier commented on THRIFT-2741:
-------------------------------------

+1 ready to commit!

probably also worth to mention *pylint*, which produces this:
{noformat}
$ pylint lib/py/src/Thrift.py 
No config file found, using default configuration
************* Module Thrift
W: 24,0: Bad indentation. Found 2 spaces, expected 4
W: 25,0: Bad indentation. Found 2 spaces, expected 4
W: 26,0: Bad indentation. Found 2 spaces, expected 4
W: 27,0: Bad indentation. Found 2 spaces, expected 4
W: 28,0: Bad indentation. Found 2 spaces, expected 4
W: 29,0: Bad indentation. Found 2 spaces, expected 4
W: 30,0: Bad indentation. Found 2 spaces, expected 4
W: 31,0: Bad indentation. Found 2 spaces, expected 4
W: 32,0: Bad indentation. Found 2 spaces, expected 4
W: 33,0: Bad indentation. Found 2 spaces, expected 4
W: 34,0: Bad indentation. Found 2 spaces, expected 4
W: 35,0: Bad indentation. Found 2 spaces, expected 4
W: 36,0: Bad indentation. Found 2 spaces, expected 4
W: 37,0: Bad indentation. Found 2 spaces, expected 4
W: 38,0: Bad indentation. Found 2 spaces, expected 4
W: 39,0: Bad indentation. Found 2 spaces, expected 4
W: 40,0: Bad indentation. Found 2 spaces, expected 4
W: 42,0: Bad indentation. Found 2 spaces, expected 4
W: 63,0: Bad indentation. Found 2 spaces, expected 4
W: 64,0: Bad indentation. Found 2 spaces, expected 4
W: 65,0: Bad indentation. Found 2 spaces, expected 4
W: 66,0: Bad indentation. Found 2 spaces, expected 4
W: 70,0: Bad indentation. Found 2 spaces, expected 4
W: 72,0: Bad indentation. Found 2 spaces, expected 4
W: 73,0: Bad indentation. Found 4 spaces, expected 8
W: 77,0: Bad indentation. Found 2 spaces, expected 4
W: 80,0: Bad indentation. Found 2 spaces, expected 4
W: 81,0: Bad indentation. Found 4 spaces, expected 8
W: 82,0: Bad indentation. Found 6 spaces, expected 12
W: 84,0: Bad indentation. Found 4 spaces, expected 8
W: 85,0: Bad indentation. Found 6 spaces, expected 12
W: 86,0: Bad indentation. Found 4 spaces, expected 8
W: 88,0: Bad indentation. Found 2 spaces, expected 4
W: 89,0: Bad indentation. Found 4 spaces, expected 8
W: 90,0: Bad indentation. Found 4 spaces, expected 8
W: 94,0: Bad indentation. Found 2 spaces, expected 4
W: 96,0: Bad indentation. Found 2 spaces, expected 4
W: 97,0: Bad indentation. Found 2 spaces, expected 4
W: 98,0: Bad indentation. Found 2 spaces, expected 4
W: 99,0: Bad indentation. Found 2 spaces, expected 4
W:100,0: Bad indentation. Found 2 spaces, expected 4
W:101,0: Bad indentation. Found 2 spaces, expected 4
W:102,0: Bad indentation. Found 2 spaces, expected 4
W:103,0: Bad indentation. Found 2 spaces, expected 4
W:104,0: Bad indentation. Found 2 spaces, expected 4
W:105,0: Bad indentation. Found 2 spaces, expected 4
W:106,0: Bad indentation. Found 2 spaces, expected 4
W:108,0: Bad indentation. Found 2 spaces, expected 4
W:109,0: Bad indentation. Found 4 spaces, expected 8
W:110,0: Bad indentation. Found 4 spaces, expected 8
W:112,0: Bad indentation. Found 2 spaces, expected 4
W:113,0: Bad indentation. Found 4 spaces, expected 8
W:114,0: Bad indentation. Found 6 spaces, expected 12
W:115,0: Bad indentation. Found 4 spaces, expected 8
W:116,0: Bad indentation. Found 6 spaces, expected 12
W:117,0: Bad indentation. Found 4 spaces, expected 8
W:118,0: Bad indentation. Found 6 spaces, expected 12
W:119,0: Bad indentation. Found 4 spaces, expected 8
W:120,0: Bad indentation. Found 6 spaces, expected 12
W:121,0: Bad indentation. Found 4 spaces, expected 8
W:122,0: Bad indentation. Found 6 spaces, expected 12
W:123,0: Bad indentation. Found 4 spaces, expected 8
W:124,0: Bad indentation. Found 6 spaces, expected 12
W:125,0: Bad indentation. Found 4 spaces, expected 8
W:126,0: Bad indentation. Found 6 spaces, expected 12
W:127,0: Bad indentation. Found 4 spaces, expected 8
W:128,0: Bad indentation. Found 6 spaces, expected 12
W:129,0: Bad indentation. Found 4 spaces, expected 8
W:130,0: Bad indentation. Found 6 spaces, expected 12
W:131,0: Bad indentation. Found 4 spaces, expected 8
W:132,0: Bad indentation. Found 6 spaces, expected 12
W:133,0: Bad indentation. Found 4 spaces, expected 8
W:134,0: Bad indentation. Found 6 spaces, expected 12
W:135,0: Bad indentation. Found 4 spaces, expected 8
W:136,0: Bad indentation. Found 6 spaces, expected 12
W:138,0: Bad indentation. Found 2 spaces, expected 4
W:139,0: Bad indentation. Found 4 spaces, expected 8
W:140,0: Bad indentation. Found 4 spaces, expected 8
W:141,0: Bad indentation. Found 6 spaces, expected 12
W:142,0: Bad indentation. Found 6 spaces, expected 12
W:143,0: Bad indentation. Found 8 spaces, expected 16
W:144,0: Bad indentation. Found 6 spaces, expected 12
W:145,0: Bad indentation. Found 8 spaces, expected 16
W:146,0: Bad indentation. Found 10 spaces, expected 20
W:147,0: Bad indentation. Found 8 spaces, expected 16
W:148,0: Bad indentation. Found 10 spaces, expected 20
W:149,0: Bad indentation. Found 6 spaces, expected 12
W:150,0: Bad indentation. Found 8 spaces, expected 16
W:151,0: Bad indentation. Found 10 spaces, expected 20
W:152,0: Bad indentation. Found 8 spaces, expected 16
W:153,0: Bad indentation. Found 10 spaces, expected 20
W:154,0: Bad indentation. Found 6 spaces, expected 12
W:155,0: Bad indentation. Found 8 spaces, expected 16
W:156,0: Bad indentation. Found 6 spaces, expected 12
W:157,0: Bad indentation. Found 4 spaces, expected 8
W:159,0: Bad indentation. Found 2 spaces, expected 4
W:160,0: Bad indentation. Found 4 spaces, expected 8
W:161,0: Bad indentation. Found 4 spaces, expected 8
W:162,0: Bad indentation. Found 6 spaces, expected 12
W:163,0: Bad indentation. Found 6 spaces, expected 12
W:164,0: Bad indentation. Found 6 spaces, expected 12
W:165,0: Bad indentation. Found 4 spaces, expected 8
W:166,0: Bad indentation. Found 6 spaces, expected 12
W:167,0: Bad indentation. Found 6 spaces, expected 12
W:168,0: Bad indentation. Found 6 spaces, expected 12
W:169,0: Bad indentation. Found 4 spaces, expected 8
W:170,0: Bad indentation. Found 4 spaces, expected 8
C:  1,0: Missing docstring
W: 23,0:TType: Class has no __init__ method
C: 23,0:TType: Missing docstring
R: 23,0:TType: Too few public methods (0/2)
W: 62,0:TMessageType: Class has no __init__ method
C: 62,0:TMessageType: Missing docstring
R: 62,0:TMessageType: Too few public methods (0/2)
W: 69,0:TProcessor: Class has no __init__ method
E: 72,2:TProcessor.process: Method should have "self" as first argument
C: 72,2:TProcessor.process: Missing docstring
R: 69,0:TProcessor: Too few public methods (1/2)
C: 81,4:TException._get_message: Missing docstring
C: 84,4:TException._set_message: Missing docstring
W: 85,6:TException._set_message: Attribute '_message' defined outside __init__
W:108,21:TApplicationException.__init__: Redefining built-in 'type'
R:112,2:TApplicationException.__str__: Too many return statements (12/6)
C:138,2:TApplicationException.read: Missing docstring
W:141,7:TApplicationException.read: Unused variable 'fname'
C:159,2:TApplicationException.write: Missing docstring


Report
======
107 statements analysed.

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

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |114    |73.08 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |17     |10.90 |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |19     |12.18 |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |6      |3.85  |NC       |NC         |
+----------+-------+------+---------+-----------+



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

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



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

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |8      |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |4      |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |113    |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |1      |NC       |NC         |
+-----------+-------+---------+-----------+



Messages
--------

+-----------+------------+
|message id |occurrences |
+===========+============+
|W0311      |107         |
+-----------+------------+
|C0111      |8           |
+-----------+------------+
|W0232      |3           |
+-----------+------------+
|R0903      |3           |
+-----------+------------+
|W0622      |1           |
+-----------+------------+
|W0612      |1           |
+-----------+------------+
|W0201      |1           |
+-----------+------------+
|R0911      |1           |
+-----------+------------+
|E0213      |1           |
+-----------+------------+



Global evaluation
-----------------
Your code has been rated at -2.15/10

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

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |1      |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |5      |NC         |NC         |60.00       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |8      |NC         |NC         |37.50       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |0      |NC         |NC         |0           |0        |
+---------+-------+-----------+-----------+------------+---------+
{noformat}

check via build and fail on errors in the future...

> Python coding standards
> -----------------------
>
>                 Key: THRIFT-2741
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2741
>             Project: Thrift
>          Issue Type: Sub-task
>          Components: Python - Library
>            Reporter: Konrad Grochowski
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to