mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 13:02:28 +08:00
Add a unimport linter for Python files (#4058)
Unimport (https://github.com/hakancelik96/unimport/) is a linter, formatter for finding and removing unused import statements. This introduces linting support, although fixer support could come later.
This commit is contained in:
18
test/handler/test_unimport_handler.vader
Normal file
18
test/handler/test_unimport_handler.vader
Normal file
@@ -0,0 +1,18 @@
|
||||
Before:
|
||||
runtime ale_linters/python/unimport.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The unimport handler should handle import warnings):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 9,
|
||||
\ 'type': 'W',
|
||||
\ 'text': 'unused: urllib.parse',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#python#unimport#Handle(1, [
|
||||
\ 'urllib.parse at path/to/file.py:9',
|
||||
\ ])
|
||||
Reference in New Issue
Block a user