-
Notifications
You must be signed in to change notification settings - Fork 33
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 invalid 'implicit scope' report on global or autoload function #136
Fix invalid 'implicit scope' report on global or autoload function #136
Conversation
今は、ユーザ定義のグローバル関数に |
すみません,説明間違ってますね.指摘ありがとうございます. |
返答が遅れてすみません 😷
これについてですが、#128 で似たようなことを議論しました。 この理由は以下の通りです:
|
ユーザ定義関数については、本来大文字で開始して なので、 初心者にとっては Vim のルール自体がわかりづらく映ってしまいそうという懸念はありますが、結局はそういうものなので、そういうものとして覚えて欲しい、むしろ間違った書き方を覚えられてしまう方がつらいかな、と思います。 |
なるほど、そのような背景を知りませんでした。 |
そうですね。それが良いと思います。 |
ありがとうございます! この修正を次リリースに含めます。 |
@rhysd テストを追加していただければ merge します!よろしくお願いします。 |
👍 |
ぬ,この PR は取り込む方向でいきますか? |
はい、取り込む方針です。 |
```vim function SomeFunc() endfunction function aaa#bbb() endfunction ```
f53a988
to
2676a92
Compare
了解です.とりあえず rebase して |
2676a92 で警告を出ないようにしたパターンについてテストケースを修正しました.ちゃんと意図通りテストが通るのを確認済みです. |
…ed variables - Added g: omitted function names as invalid case
|
これで一通り作業が完了したつもりです. |
@@ -8,7 +8,7 @@ redir END | |||
let count = 110 | |||
|
|||
function! ImplicitGlobalFunc(param) | |||
" Make fix missing a: easy | |||
" Make it easy to fix missing a: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should collect only invalid cases.
So, https://github.com/rhysd/vint/blob/fix-ProhibitImplicitScopeVariable/test/fixture/policy/prohibit_implicit_scope_variable_invalid.vim#L10-L19 should be removed from the file (and it should moved to prohibit_implicit_scope_variable_valid.vim
, but it was already done. thanks 😃 ).
ありがとうございます! |
because valid cases are already added to prohibit_implicit_scope_variable_valid.vim.
レビューありがとうございます.指摘いただいた余分なテストケースを削除しました. |
ありがとうございます! 👍 |
Fix invalid 'implicit scope' report on global or autoload function
関数名にもスコープを明示しろという警告が出てしまう問題を修正しました.
実行結果:
Vim script 的には関数名に
g:
をつけるとエラーになる(昔は通ってしまっていた)はずです.まだテストが追加できていないのでマージできる状態ではないです.
修正が正しいかどうか(Python よく知らないので変な修正になってるかも…)をレビューお願いします.問題無さそうならテスト足してみます.
直りそうな issue: #135