Vimjas / vint

Fast and Highly Extensible Vim script Language Lint implemented in Python.
MIT License
703 stars 33 forks source link

An idea of new rule: "Use <Space> for space at tail in mapping" #246

Open thinca opened 7 years ago

thinca commented 7 years ago
" bad (there is space at the tail)
nnoremap <C-h> :<C-u>help 
# good
nnoremap <C-h> :<C-u>help<Space>
Kuniwak commented 7 years ago

@thinca I have a question. What is a severity of the rule?

For example, Vint has three levels of the severity:

Error
This code is determinately wrong / This code will be cause of errors.
Warning
This code is perhaps wrong / This code can be cause of errors.
Style Problem
This code has a coding-style problem / This code cannot be cause of errors.
thinca commented 7 years ago

I think this is warning.

Kuniwak commented 7 years ago

@thinca I have an additional question.

I don't know why trailing space in map leads to errors. Could you explain me please?

thinca commented 7 years ago
Kuniwak commented 7 years ago

Hmm, I think the severity of the rule is Style Problem. Because trailing white spaces cannot be cause of errors at that time.

But I think this rule is useful. Could you send the PR?

thinca commented 7 years ago

I think style problem is just preference. There is no good or bad. Warning is for a bad one, also when there is no error. It should be avoided.

I think there is no merit in the trailing blank. We should not select this way. Therefore this is warning.

Could you send the PR?

Very sorry, I have no time now... 🙇