通过PyLint简单地按类别表创建消息



通过运行pylint --load-plugins pylint_django ~/src/github.com/<repo>/ ||,它创建了这个非常有用的表,显示所有消息类型,以及每种代码库的数量。还有很多其他的信息

pylint messages table

我的问题是,我怎样才能让pylint只输出这个表,以及填充前一个和不同的列?我希望有一组命令可以根据Master的提示(上一个)和我当前的分支运行这个表。

之类的
### pseudocode
pylint table <git hash of previous> <git hash of current> 

如果您在相同的环境中启动pylint两次并激活报告选项(并且在此环境中具有写文件的权限),那么只需在提交时启动pylint -r y --load-plugins pylint_django ~/src/github.com/<repo>/即可。

首次运行:

Raw metrics
-----------
+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |14276  |53.52 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |6904   |25.88 |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |1887   |7.07  |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |3606   |13.52 |NC       |NC         |
+----------+-------+------+---------+-----------+

主动添加问题后的第二次运行:

Raw metrics
-----------
+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |14277  |53.52 |14276    |+1.00      |
+----------+-------+------+---------+-----------+
|docstring |6904   |25.88 |6904     |=          |
+----------+-------+------+---------+-----------+
|comment   |1887   |7.07  |1887     |=          |
+----------+-------+------+---------+-----------+
|empty     |3606   |13.52 |3606     |=          |
+----------+-------+------+---------+-----------+

你可以这样做:

git checkout hash1
pylint -r y ...
git checkout hash2
pylint -r y ...

最新更新