summaryrefslogtreecommitdiff
path: root/test/handler/test_unimport_handler.vader
diff options
context:
space:
mode:
authorJon Parise <jon@indelible.org>2022-02-07 22:54:25 -0800
committerGitHub <noreply@github.com>2022-02-08 15:54:25 +0900
commit8b1ea33cc0cb18bec3bf19d1131b322b313cea4e (patch)
tree754da607ffda3bf955187e6194e4b182fa3ebfde /test/handler/test_unimport_handler.vader
parent2428d4d81d964a3be83bea649c882012acd4b210 (diff)
downloadale-8b1ea33cc0cb18bec3bf19d1131b322b313cea4e.zip
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.
Diffstat (limited to 'test/handler/test_unimport_handler.vader')
-rw-r--r--test/handler/test_unimport_handler.vader18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/handler/test_unimport_handler.vader b/test/handler/test_unimport_handler.vader
new file mode 100644
index 00000000..5acdcbb9
--- /dev/null
+++ b/test/handler/test_unimport_handler.vader
@@ -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',
+ \ ])