Provide pylint plugin to avoid warnings in IDE when working with conanfile.py
See original GitHub issueProblem
When editing conanfile.py
with editor which has linter support (VS Code with Python extension in my case) there are a bunch of errors related to dynamic fields (like self.copy is not callable
or Instance of ConanFile doesn't have package_folder member
).
Proposal
Conan has a built-in linting support for conanfile.py, but it deals with dynamic fields by post-processing json output.
It would be useful if this logic is moved to a pylint plugin which can be reused by editor/IDE or via command line options.
There are few tutorials on the Internet about how to do it.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Linting conanfile.py — conan 1.8.4 documentation
The conan create command verifies the recipe file using pylint. However, if you have an IDE that supports Python and may do linting...
Read more >How do I disable a Pylint warning? - python - Stack Overflow
pylint --generate-rcfile shows it like this: [MESSAGES CONTROL] # Enable the message, report, category or checker with the given id(s).
Read more >Frequently Asked Questions — Pylint 1.5.4 documentation
3.1 Can I give pylint a file as an argument instead of a module?¶ ... “pylint mymodule.py” should always work since the current...
Read more >conan Changelog - pyup.io
Bugfix: Fix crash in pylint plugin with pylint >= 2.14.0. ... Feature: Adding ``root`` to layout model to allow conanfile.py in subfolders.
Read more >Messages control - Pylint 2.16.0-dev documentation
W various warnings. E errors, for probable bugs in the code. F fatal, if an error occurred which prevented pylint from doing further...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mmatrosov It works better if you install conan via pip. If you have standalone installer which provides python modules (not sure if the official one does, pyinstaller explicitly hides modules so they can’t be imported) you can add it to
sys.path
. For example my.pylintrc
looks like:(the plugin is in PR yet)
Hi all!
Many thanks to @ytimenkov for implementing it! It will be released in next 1.6, keep tuned for testing it!