站內搜尋:Yahoo搜尋的結果,如果沒有給完整的網址,請在站內再搜尋一次!

2019-08-23

VS Code : 讓pylint 除了錯誤(error)以外,排除顯示(disabled)不影響程式執行的警告(warning)、提示訊息(infomation)的訊息

Pylint的警告(warning)、提示訊息(infomation)等訊息,通常不會影響程式的正常執行,但通常會讓程式碼看起來很不舒服,這些訊息可能包含:

  1. Missing class docstring pylint(missing-docstring)
  2. Found indentation with tabs instead of spaces pylint(mixed-indentation)
  3. Variable name "e1" doesn't conform to snake_case naming style pylint(invalid-name)
  4. No space allowed after bracket pylint(bad-whitespace)
  5. Method could be a function pylint(no-self-use)
  6. Trailing whitespace pylint(trailing-whitespace)
  7. Constant name "win" doesn't conform to UPPER_CASE naming style pylint(invalid-name)
  8.  ...
在VS Code的setting.json加入"python.linting.pylintArgs": ["--errors-only"]

沒有留言:

張貼留言