8000 Prepare to become ProhibitUnusedVariable to default-enabled by Kuniwak · Pull Request #275 · Vimjas/vint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prepare to become ProhibitUnusedVariable to default-enabled #275

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

Merged
merged 36 commits into from
Jun 29, 2018

Conversation

Kuniwak
Copy link
Member
@Kuniwak Kuniwak commented Jun 17, 2018

Fix the following three false positives:

function! s:foo() abort
    let x = 'x'
    let y = l:{x}  " The first false positive.
    echo y
endfunction

call call('s:foo', [])  " The second false positive.
call function('s:foo')  " The third false positive.

And support a ignored_patterns option for ProhibitUnusedVariable to manually disable the policy by name.
This is an example for the option:

---
policies:
  ProhibitUnusedVariable:
    enabled: yes
    ignored_patterns:
      - '^_+$'
      - '^s:_vital_loaded$'
      - '^s:_vital_depends$'

And also support line comment configuration that affect only the same line:

" vint: next-line -ProhibitUnusedVariable
let s:foobar = 'x'
echo s:{'foo' . 'bar'}

And also support scope analysis for lambdas.

@Kuniwak Kuniwak self-assigned this Jun 17, 2018
@Kuniwak Kuniwak force-pushed the inspect-vital-bugs branch from e26f5f2 to ed7c1f8 Compare June 17, 2018 20:50
@Kuniwak Kuniwak changed the title WIP: Enable ProhibitUnusedVariable Enable ProhibitUnusedVariable Jun 17, 2018
@Kuniwak Kuniwak changed the title Enable ProhibitUnusedVariable Prepare to become ProhibitUnusedVariable to default-enabled Jun 17, 2018
@Kuniwak Kuniwak force-pushed the inspect-vital-bugs branch 2 times, most recently from 330c0b8 to 362e91c Compare June 18, 2018 08:21
@Kuniwak Kuniwak force-pushed the inspect-vital-bugs branch from 362e91c to 24fdd4c Compare June 18, 2018 10:13
@Kuniwak Kuniwak force-pushed the inspect-vital-bugs branch from 29a5bba to 1cc2915 Compare June 19, 2018 20:33
@Kuniwak Kuniwak force-pushed the inspect-vital-bugs branch from a8fcd9a to fcee68a Compare June 19, 2018 20:48 8632
@Kuniwak Kuniwak mentioned this pull request Jun 19, 2018
@Kuniwak Kuniwak merged commit efff450 into master Jun 29, 2018
@Kuniwak Kuniwak deleted the inspect-vital-bugs branch June 29, 2018 03:10
@Kuniwak Kuniwak mentioned this pull request Jun 29, 2018
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.

1 participant
0