diff --git a/prospector/formatters/base_summary.py b/prospector/formatters/base_summary.py index 125d31ff..540ccd28 100644 --- a/prospector/formatters/base_summary.py +++ b/prospector/formatters/base_summary.py @@ -36,3 +36,8 @@ def render_summary(self) -> str: output.append(f" {label.rjust(label_width)}: {value}") return "\n".join(output) + + def render_profile(self) -> str: + output = ["Profile", "=======", "", self.profile.as_yaml().strip()] + + return "\n".join(output) diff --git a/prospector/formatters/pylint.py b/prospector/formatters/pylint.py index 2030ad76..8593dbc6 100644 --- a/prospector/formatters/pylint.py +++ b/prospector/formatters/pylint.py @@ -41,6 +41,9 @@ def render(self, summary: bool = True, messages: bool = True, profile: bool = Fa } ) + if profile: + output.append("") + output.append(self.render_profile()) if summary: output.append("") output.append(self.render_summary()) diff --git a/prospector/formatters/text.py b/prospector/formatters/text.py index e84673ce..525765e7 100644 --- a/prospector/formatters/text.py +++ b/prospector/formatters/text.py @@ -45,11 +45,6 @@ def render_messages(self) -> str: return "\n".join(output) - def render_profile(self) -> str: - output = ["Profile", "=======", "", self.profile.as_yaml().strip()] - - return "\n".join(output) - def render(self, summary: bool = True, messages: bool = True, profile: bool = False) -> str: output = [] if messages and self.messages: # if there are no messages, don't render an empty header diff --git a/prospector/formatters/vscode.py b/prospector/formatters/vscode.py index b552ef25..e7df5108 100644 --- a/prospector/formatters/vscode.py +++ b/prospector/formatters/vscode.py @@ -34,6 +34,9 @@ def render(self, summary: bool = True, messages: bool = True, profile: bool = Fa "message": message.message.strip(), } ) + if profile: + output.append("") + output.append(self.render_profile()) if summary: output.append("") output.append(self.render_summary())