Is it possible to ignore one single specific line with pylint?

前端 未结 4 866
生来不讨喜
生来不讨喜 2020-11-29 00:39

I have the following line in my header:

import config.logging_settings

This actually changes my python logging settings, but pylint thinks

4条回答
  •  心在旅途
    2020-11-29 01:38

    I believe what you're looking for is...

    import config.logging_settings  # @UnusedImport
    

    Note the double space before the comment to avoid hitting other formatting warnings.

    Also, depending on your IDE (if you're using one), there's probably an option to add the correct ignore rule (eg in eclipse pressing Ctrl1 while the cursor is over the warning will auto-suggest @UnusedImport

提交回复
热议问题