Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

Optional Pylint checkers in the extensions module

Message Control

  1. Show ERROR messages only.

     :::bash 
     pylint -E some_script.py
  2. Show ERROR and WARNING messages only.

     :::bash 
     pylint --disable=R,C some_script.py
  3. Disable warning associated with a specific line.

     :::bash
     proc = sp.run(cmd, shell=True)  # pylint: disable=W1510

Configuration

It is suggessted that you configure pylint using pyproject.toml. Below is an example.

[tool.pylint.master]
unsafe-load-any-extension=no
extension-pkg-whitelist=numpy,cv2

[tool.pylint.typecheck]
ignored-classes=Fysom,MyClass

Similar Lines

Similar lines detection has a high chance of yielding false positives. It is suggested that you either set min-similarity-lines to a large value or disable check of similar lines. Please refer to the issue The duplicate-code (R0801) can’t be disabled for more discussions.

[tool.pylint.similarities]
min-similarity-lines=11
ignore-docstrings=yes
ignore-comments=yes
ignore-imports=yes

Examples

xinstall/data/pylint/pylintrc

.pylintrc

Please refer to settings.json for an example of pylint configuration for Visual Studio Code.

References

https://stackoverflow.com/questions/31907762/pylint-to-show-only-warnings-and-errors

https://stackoverflow.com/questions/35990313/avoid-pylint-warning-e1101-instance-of-has-no-member-for-class-with-dyn

PyCQA/pylint#2426

https://stackoverflow.com/questions/40163106/cannot-find-col-function-in-pyspark