From ba13d34978f43571bc50508c9d44c2428ccf2471 Mon Sep 17 00:00:00 2001 From: tyru Date: Fri, 27 Dec 2019 19:55:34 +0900 Subject: [PATCH] fix message (unused function) --- vint/linting/policy/prohibit_unused_variable.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vint/linting/policy/prohibit_unused_variable.py b/vint/linting/policy/prohibit_unused_variable.py index 238210e..2eb01bd 100644 --- a/vint/linting/policy/prohibit_unused_variable.py +++ b/vint/linting/policy/prohibit_unused_variable.py @@ -55,5 +55,9 @@ def is_valid(self, identifier, lint_context): )) return True - self.description = 'Unused variable: {var_name}'.format(var_name=identifier_value) + if scope_plugin.is_function_identifier(identifier): + node_type = 'function' + else: + node_type = 'variable' + self.description = 'Unused {node_type}: {var_name}'.format(node_type = node_type, var_name=identifier_value) return False