How do I tell PyLint “it's a variable, not a constant” to stop message C0103?

前端 未结 6 2008
闹比i
闹比i 2020-12-13 08:27

I have a module-level variable in my Python 2.6 program named \"_log\", which PyLint complains about:

C0103: Invalid name \"_log\" (should match (([A-Z_][A-Z         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 08:52

    If you disable a message locally in your file then Pylint will report another different warning!

    Locally disabling invalid-name (C0103) [I:locally-disabled] 
    

    If your intention is for a clean lint run, and surely that should be the target otherwise why are you bothering, then you can disable that message and the corresponding locally-enabled message in your configuration file:

    disable=locally-disabled, locally-enabled
    

提交回复
热议问题