mirror of
https://github.com/conan-io/conan-center-index.git
synced 2025-09-26 08:18:46 +00:00
(#12254) linter v2 - Request migration of conans.errors
to conan.errors
* linter v2 - errors should be imported from module conan * Add docs * revert - test linter * fix typo * touch
This commit is contained in:
@@ -44,6 +44,8 @@ Here is a list of different imports and their new equivalent (note that the inte
|
||||
| conans.tools.cross_building | [conan.tools.build.cross_building](https://docs.conan.io/en/latest/reference/conanfile/tools/build.html#conan-tools-build-cross-building) |
|
||||
| conans.tools.rmdir | [conan.tools.files.rmdir](https://docs.conan.io/en/latest/reference/conanfile/tools/files/basic.html#conan-tools-files-rmdir) |
|
||||
| conans.tools.Version | [conan.tools.scm.Version](https://docs.conan.io/en/latest/reference/conanfile/tools/scm/other.html#version) |
|
||||
| conans.errors.ConanInvalidConfiguration | [conan.errors.ConanInvalidConfiguration](https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#migrating-the-recipes) |
|
||||
| conans.errors.ConanException | [conan.errors.ConanException](https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#migrating-the-recipes) |
|
||||
|
||||
|
||||
# Disable linter for `test_v1_*/conanfile.py`
|
||||
|
@@ -25,7 +25,17 @@ def transform_tools(module):
|
||||
if 'Version' in module.locals:
|
||||
del module.locals['Version']
|
||||
|
||||
def transform_errors(module):
|
||||
if 'ConanInvalidConfiguration' in module.locals:
|
||||
del module.locals['ConanInvalidConfiguration']
|
||||
if 'ConanException' in module.locals:
|
||||
del module.locals['ConanException']
|
||||
|
||||
|
||||
astroid.MANAGER.register_transform(
|
||||
astroid.Module, transform_tools,
|
||||
lambda node: node.qname() == "conans.tools")
|
||||
|
||||
astroid.MANAGER.register_transform(
|
||||
astroid.Module, transform_errors,
|
||||
lambda node: node.qname() == "conans.errors")
|
||||
|
Reference in New Issue
Block a user