Can Pylint error checking be customized?

后端 未结 6 2116
名媛妹妹
名媛妹妹 2021-02-02 07:25

I am using pydev where I have set up pylint. The problem is that even inside the comments, pylint reports warnings. I was looking to disable any sort of checking inside any line

6条回答
  •  自闭症患者
    2021-02-02 07:50

    There are two ways I customize pylint.

    Using a config file

    The first way is where you

    • call pylint to generate a template config file
    • then you tailor the config file to your needs/wants
    • then you put the config file in your the default pylint config file location or always call pylint and specify the config file path

    Using a wrapper script

    The second way is where you create a wrapper script that calls pylint and in the wrapper script you have a bunch of lines that look like:

    pylint \
           ${options_here} \
           --disable=xyz1 \
           --disable=xyz_2 \
           ${more_options} \
           --disable=xyz_N \
           --disable=abc \
           $@
    

    Currently I am using the wrapper script approach because I want the issues to be sorted by line number and I did some shell scripting to get that sorting order.

提交回复
热议问题