def __init__(self, name: Union[(str, Path)], content: Optional[str]=None, kind: Optional[FileType]=None):
    'Create a Lintable instance.'
    self.filename: str = str(name)
    self.dir: str = ''
    self.kind: Optional[FileType] = None
    if isinstance(name, str):
        self.name = normpath(name)
        self.path = Path(self.name)
    else:
        self.name = str(name)
        self.path = name
    self._content = content
    self.role = ''
    parts = self.path.parent.parts
    if ('roles' in parts):
        role = self.path
        while ((role.parent.name != 'roles') and role.name):
            role = role.parent
        if role.exists:
            self.role = role.name
    if (str(self.path) in ['/dev/stdin', '-']):
        self.file = NamedTemporaryFile(mode='w+', suffix='playbook.yml')
        self.filename = self.file.name
        self._content = sys.stdin.read()
        self.file.write(self._content)
        self.file.flush()
        self.path = Path(self.file.name)
        self.name = 'stdin'
        self.kind = 'playbook'
        self.dir = '/'
    else:
        self.kind = (kind or kind_from_path(self.path))
    if (not self.dir):
        if (self.kind == 'role'):
            self.dir = str(self.path.resolve())
        else:
            self.dir = str(self.path.parent.resolve())
    self.base_kind = kind_from_path(self.path, base=True)
Create a Lintable instance.
def __init__(self, name: Union[(str, Path)], content: Optional[str]=None, kind: Optional[FileType]=None):
    
    self.filename: str = str(name)
    self.dir: str = 
    self.kind: Optional[FileType] = None
    if isinstance(name, str):
        self.name = normpath(name)
        self.path = Path(self.name)
    else:
        self.name = str(name)
        self.path = name
    self._content = content
    self.role = 
    parts = self.path.parent.parts
    if ('roles' in parts):
        role = self.path
        while ((role.parent.name != 'roles') and role.name):
            role = role.parent
        if role.exists:
            self.role = role.name
    if (str(self.path) in ['/dev/stdin', '-']):
        self.file = NamedTemporaryFile(mode='w+', suffix='playbook.yml')
        self.filename = self.file.name
        self._content = sys.stdin.read()
        self.file.write(self._content)
        self.file.flush()
        self.path = Path(self.file.name)
        self.name = 'stdin'
        self.kind = 'playbook'
        self.dir = '/'
    else:
        self.kind = (kind or kind_from_path(self.path))
    if (not self.dir):
        if (self.kind == 'role'):
            self.dir = str(self.path.resolve())
        else:
            self.dir = str(self.path.parent.resolve())
    self.base_kind = kind_from_path(self.path, base=True)