2017-02-13 141 views
2

有沒有辦法在PyLint中配置bad-whitespace檢查的檢查?我目前可以禁用檢查,但我寧願強制執行一個空白約定而不是禁用它。PyLint bad-whitespace配置

回答

0

有兩個選項可以使用:

  1. 在全球範圍內禁止壞空白警告:

    pylint --disable=C0326 
    
  2. 使用pylint的配置文件:

    pylint --rcfile=/path/to/config.file 
    

    這是你放什麼在配置文件中禁用壞空白警告:

    disable=C0326 
    
0

從pylint 1.1.0開始,bad-whitespace約定檢查的編號爲C0326。您可以在.pylintrc配置文件中使用此代碼來啓用/禁用bad-whitespace檢查。

[MESSAGES CONTROL] 
enable=C0326 

[MESSAGES CONTROL] 
disable=C0326 
1

的.pylintrc文件時提供的空白規則有限的編輯,使用屬性no-space-check

# List of optional constructs for which whitespace checking is disabled. `dict- 
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. 
# `trailing-comma` allows a space between comma and closing bracket: (a,). 
# `empty-line` allows space-only lines. 
no-space-check= 

可能在不久的將來更多的選擇,雖然。