Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix message ("Unused variable" -> "Unused function" for function identifier) #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyru
Copy link
Collaborator

@tyru tyru commented Dec 27, 2019

Fixed message for function identifer.

Sample script

function! s:foo()
endfunction

Before

vint test.vim 
test.vim:1:11: Unused variable: s:foo (see :help E738)

After

vint test.vim 
test.vim:1:11: Unused function: s:foo (see :help E738)

@coveralls
Copy link

coveralls commented Dec 27, 2019

Coverage Status

Coverage increased (+0.03%) to 95.48% when pulling ba13d34 on tyru:unused-function into e44dedf on Kuniwak:master.

@tyru
Copy link
Collaborator Author

tyru commented Dec 27, 2019

@Kuniwak @blueyed I forgot about true_value if condition else false_value because I don't write python so much.
Should I rewrite with it?

node_type = 'function'
else:
node_type = 'variable'
self.description = 'Unused {node_type}: {var_name}'.format(node_type = node_type, var_name=identifier_value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.description = 'Unused {node_type}: {var_name}'.format(node_type = node_type, var_name=identifier_value)
self.description = 'Unused {node_type}: {var_name}'.format(node_type=node_type, var_name=identifier_value)

@blueyed
Copy link
Member

blueyed commented Dec 27, 2019

@Kuniwak @blueyed I forgot about true_value if condition else false_value because I don't write python so much.
Should I rewrite with it?

I think it's fine - and actually makes it clearer for code coverage.

@blueyed
Copy link
Member

blueyed commented Dec 30, 2019

Maybe this should be split into a separate ProhibitUnusedFunction instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants