Tool classes

Contents are subject to change.

ToolBase

class ToolBase[source]
abstract configure(prospector_config, found_files)Tuple[str, Optional[Iterable[prospector.message.Message]]][source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

abstract run(found_files)List[prospector.message.Message][source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

BanditTool

DodgyTool

class DodgyTool[source]
configure(prospector_config, found_files)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(found_files: prospector.finder.FileFinder)[source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

FrostedTool

McCabeTool

class McCabeTool(*args, **kwargs)[source]
configure(prospector_config, _)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(found_files)[source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

MypyTool

PycodestyleTool

class PycodestyleTool(*args, **kwargs)[source]
configure(prospector_config, found_files: prospector.finder.FileFinder)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(_)[source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

PydocstyleTool

class PydocstyleTool(*args, **kwargs)[source]
configure(prospector_config, found_files)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(found_files: prospector.finder.FileFinder)[source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

ProfileValidationTool

class ProfileValidationTool[source]
configure(prospector_config, found_files)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(found_files: prospector.finder.FileFinder)[source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

PyFlakesTool

class PyFlakesTool(*args, **kwargs)[source]
configure(prospector_config, _)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(found_files)[source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

PylintTool

class PylintTool[source]
combine(messages)[source]

Combine repeated messages.

Some error messages are repeated, causing many errors where only one is strictly necessary.

For example, having a wildcard import will result in one ‘Unused Import’ warning for every unused import. This method will combine these into a single warning.

configure(prospector_config, found_files: prospector.finder.FileFinder)[source]

Tools have their own way of being configured from configuration files on the current path - for example, a .pep8rc file. Prospector will use its own configuration settings unless this method discovers some tool-specific configuration that should be used instead.

Returns

A tuple: the first element is a string indicating how or where this tool was configured from. For example, this can be a path to the .pylintrc file used, if used. None means that prospector defaults were used. The second element should be an iterable of Message objects representing any issues which were found when trying to load configuration - for example, bad values in a .pylintrc file. It is also possible to simply return None if neither value is useful.

run(found_files)List[prospector.message.Message][source]

Actually run the tool and collect the various messages emitted by the tool. It is expected that this will convert whatever output of the tool into the standard prospector Message and Location objects.

PyromaTool

VultureTool