Skip to content

Latest commit

 

History

History
153 lines (100 loc) · 8.21 KB

File metadata and controls

153 lines (100 loc) · 8.21 KB
title CodeOwner
sidebarTitle CodeOwner
icon
description CodeOwner is a class that represents a code owner in a codebase. It is used to iterate over all files that are owned by a specific owner.

import {Parameter} from '/snippets/Parameter.mdx'; import {ParameterWrapper} from '/snippets/ParameterWrapper.mdx'; import {Return} from '/snippets/Return.mdx'; import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx';

Attributes

### classes list[ Class ] } description="Get a recursive list of all classes in files container." />

exports

list[ TSExport ] } description="Get a recursive list of all exports in files container." />

files_source

Callable [FilesParam, Iterable[TFile]] } description="A callable that returns an iterable of all files in the codebase." />

functions

list[ Function ] } description="Get a recursive list of all functions in files container." />

global_vars

list[ Assignment ] } description="Get a recursive list of all global variables in files container." />

import_statements

list[ ImportStatement ] } description="Get a recursive list of all import statements in files container." />

imports

list[ Import ] } description="Get a recursive list of all imports in files container." />

name

str } description="The name of the code owner." />

owner_type

Literal[USERNAME, TEAM, EMAIL] } description="The type of the owner (USERNAME, TEAM, EMAIL)." />

owner_value

str } description="The value of the owner." />

symbols

list[ Symbol ] } description="Get a recursive list of all symbols in files container." />

Methods

### files Recursively iterate over all files in the codebase that are owned by the current code owner.

<Return return_type={ Iterable[TFile] } description=""/>

from_parser

Create a list of CodeOwner objects from a CodeOwnersParser.

CodeOwnersParser } description="The CodeOwnersParser to use." defaultValue="" /> Callable [FilesParam, Iterable[TFile]] } description="A callable that returns an iterable of all files in the codebase." defaultValue="" />

<Return return_type={ <>list[ <a href="/api-reference/core/CodeOwner" style={ {fontWeight: "inherit", fontSize: "inherit"} }>CodeOwner ]</> } description="A list of CodeOwner objects."/>

get_class

Get a class by name in files container.

<Return return_type={ <><a href="/api-reference/core/Class" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Class | None</> } description=""/>

get_export

Get an export by name in files container (supports only typescript).

<Return return_type={ <><a href="/api-reference/typescript/TSExport" style={ {fontWeight: "inherit", fontSize: "inherit"} }>TSExport | None</> } description=""/>

get_function

Get a function by name in files container.

<Return return_type={ <><a href="/api-reference/core/Function" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Function | None</> } description=""/>

get_global_var

Get a global variable by name in files container.

<Return return_type={ <><a href="/api-reference/core/Assignment" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Assignment | None</> } description=""/>

get_import

Get an import by name in files container.

<Return return_type={ <><a href="/api-reference/core/Import" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Import | None</> } description=""/>

get_import_statement

Get an import statement by name in files container.

<Return return_type={ <><a href="/api-reference/core/ImportStatement" style={ {fontWeight: "inherit", fontSize: "inherit"} }>ImportStatement | None</> } description=""/>

get_symbol

Get a symbol by name in files container.

<Return return_type={ <><a href="/api-reference/core/Symbol" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Symbol | None</> } description=""/>