module documentation

Utils for the 'pylint-config' command.

Exception InvalidUserInput Raised whenever a user input is invalid.
Function get_and_validate_format Make sure that the output format is either .toml or .ini.
Function get_and_validate_output_file Make sure that the output file is correct.
Function get_minimal_setting Ask the user if they want to use the minimal setting.
Function should_retry_after_invalid_input Decorator that handles InvalidUserInput exceptions and retries.
Function validate_yes_no Validate that a yes or no answer is correct.
Constant SUPPORTED_FORMATS Undocumented
Constant YES_NO_ANSWERS Undocumented
Constant _P Undocumented
Type Variable _ReturnValueT Undocumented
@should_retry_after_invalid_input
def get_and_validate_format() -> Literal['toml', 'ini']: (source)

Make sure that the output format is either .toml or .ini.

def get_and_validate_output_file() -> tuple[bool, Path]: (source)

Make sure that the output file is correct.

def get_minimal_setting() -> bool: (source)

Ask the user if they want to use the minimal setting.

def should_retry_after_invalid_input(func: Callable[_P, _ReturnValueT]) -> Callable[_P, _ReturnValueT]: (source)

Decorator that handles InvalidUserInput exceptions and retries.

@should_retry_after_invalid_input
def validate_yes_no(question: str, default: Literal['yes', 'no']|None) -> bool: (source)

Validate that a yes or no answer is correct.

SUPPORTED_FORMATS: set[str] = (source)

Undocumented

Value
set(['t', 'toml', 'i', 'ini'])
YES_NO_ANSWERS: set[str] = (source)

Undocumented

Value
set(['y', 'yes', 'n', 'no'])

Undocumented

Value
ParamSpec('_P')
_ReturnValueT = (source)

Undocumented

Value
TypeVar('_ReturnValueT', bool, str)