Skip to content

Commit 5d309ec

Browse files
feat: make noop plugin recognizable (#373)
* feat: make noop plugin recognizable context: codecov/feedback#258 Currently there's no way to disable plugins. We don't want to change the default to preserve compatibility with the uploader little magic tricks that were executed by default (as far as I know). These changes allow you to pass the `--plugin noop` option to the `create-upload` command in order to not execute any plugin. * rename test function
1 parent da50de0 commit 5d309ec

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

codecov_cli/plugins/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def _load_plugin_from_yaml(plugin_dict: typing.Dict):
6060

6161

6262
def _get_plugin(cli_config, plugin_name):
63+
if plugin_name == "noop":
64+
return NoopPlugin()
6365
if plugin_name == "gcov":
6466
return GcovPlugin()
6567
if plugin_name == "pycoverage":

tests/plugins/test_instantiation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ def test_get_plugin_xcode():
115115
assert isinstance(res, XcodePlugin)
116116

117117

118+
def test_get_plugin_noop():
119+
res = _get_plugin({}, "noop")
120+
assert isinstance(res, NoopPlugin)
121+
122+
118123
def test_get_plugin_pycoverage():
119124
res = _get_plugin({}, "pycoverage")
120125
assert isinstance(res, Pycoverage)

0 commit comments

Comments
 (0)