module documentation

Definition of an Argument class and transformers for various argument types. An Argument instance represents a pylint option to be handled by an argparse.ArgumentParser

Constant NO_VALUES Undocumented
Constant YES_VALUES Undocumented
Class _Argument Class representing an argument to be parsed by an argparse.ArgumentsParser.
Class _BaseStoreArgument Base class for store arguments to be parsed by an argparse.ArgumentsParser.
Class _CallableArgument Class representing an callable argument to be parsed by an argparse.ArgumentsParser.
Class _DeprecationArgument Store arguments while also handling deprecation warnings for old and new names.
Class _ExtendArgument Class for extend arguments to be parsed by an argparse.ArgumentsParser.
Class _StoreArgument Class representing a store argument to be parsed by an argparse.ArgumentsParser.
Class _StoreNewNamesArgument Store arguments while also emitting deprecation warnings.
Class _StoreOldNamesArgument Store arguments while also handling old names.
Class _StoreTrueArgument Class representing a 'store_true' argument to be parsed by an argparse.ArgumentsParser.
Function _confidence_transformer Transforms a comma separated string of confidence values.
Function _csv_transformer Transforms a comma separated string.
Function _glob_paths_csv_transformer Transforms a comma separated list of paths while expanding user and variables and glob patterns.
Function _non_empty_string_transformer Check that a string is not empty and remove quotes.
Function _path_transformer Expand user and variables in a path.
Function _py_version_transformer Transforms a version string into a version tuple.
Function _regex_transformer Return `re.compile(value)`.
Function _regexp_csv_transfomer Transforms a comma separated list of regular expressions.
Function _regexp_paths_csv_transfomer Transforms a comma separated list of regular expressions paths.
Function _yn_transformer Transforms a yes/no or stringified bool into a bool.
Constant _TYPE_TRANSFORMERS Type transformers for all argument types.
Type Alias _ArgumentTypes List of possible argument types.
NO_VALUES: set[str] = (source)

Undocumented

Value
set(['n', 'no', 'false'])
YES_VALUES: set[str] = (source)

Undocumented

Value
set(['y', 'yes', 'true'])
def _confidence_transformer(value: str) -> Sequence[str]: (source)

Transforms a comma separated string of confidence values.

def _csv_transformer(value: str) -> Sequence[str]: (source)

Transforms a comma separated string.

def _glob_paths_csv_transformer(value: str) -> Sequence[str]: (source)

Transforms a comma separated list of paths while expanding user and variables and glob patterns.

def _non_empty_string_transformer(value: str) -> str: (source)

Check that a string is not empty and remove quotes.

def _path_transformer(value: str) -> str: (source)

Expand user and variables in a path.

def _py_version_transformer(value: str) -> tuple[int, ...]: (source)

Transforms a version string into a version tuple.

def _regex_transformer(value: str) -> Pattern[str]: (source)

Return `re.compile(value)`.

def _regexp_csv_transfomer(value: str) -> Sequence[Pattern[str]]: (source)

Transforms a comma separated list of regular expressions.

def _regexp_paths_csv_transfomer(value: str) -> Sequence[Pattern[str]]: (source)

Transforms a comma separated list of regular expressions paths.

def _yn_transformer(value: str) -> bool: (source)

Transforms a yes/no or stringified bool into a bool.

_TYPE_TRANSFORMERS: dict[str, Callable[[str], _ArgumentTypes]] = (source)

Type transformers for all argument types. A transformer should accept a string and return one of the supported Argument types. It will only be called when parsing 1) command-line, 2) configuration files and 3) a string default value. Non-string default values are assumed to be of the correct type.

Value
{'choice': str,
 'csv': _csv_transformer,
 'float': float,
 'int': int,
 'confidence': _confidence_transformer,
 'non_empty_string': _non_empty_string_transformer,
 'path': _path_transformer,
...
_ArgumentTypes = (source)

List of possible argument types.

Value
Union[str,
      int,
      float,
      bool,
      Pattern[str],
      Sequence[str],
      Sequence[Pattern[str]],
...