🔧 Added support for building socketw with conan v2

This commit is contained in:
2022-10-15 13:07:30 +02:00
parent ab4b1a8202
commit 87a934a722
16 changed files with 506 additions and 6 deletions

View File

@ -0,0 +1,30 @@
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import nodes, Const, AssignName
class NoPackageName(BaseChecker):
"""
Conanfile used for testing a package should NOT provide a name
"""
__implements__ = IAstroidChecker
name = "conan-test-package-name"
msgs = {
"E9007": (
"No 'name' attribute in test_package conanfile",
"conan-test-no-name",
"No 'name' attribute in test_package conanfile."
)
}
def visit_classdef(self, node: nodes) -> None:
if node.basenames == ['ConanFile']:
for attr in node.body:
children = list(attr.get_children())
if len(children) == 2 and \
isinstance(children[0], AssignName) and \
children[0].name == "name" and \
isinstance(children[1], Const):
self.add_message("conan-test-no-name", node=attr, line=attr.lineno)