Skip to content

Commit

Permalink
Delete linting functionality #159
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Nov 8, 2019
1 parent 1099074 commit 6276c13
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 337 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ All notable changes to this project will be documented in this file. This change
* (Breaking) Required vim/neovim version is changed.
** Vim `8.1.0614` or later
** Neovim `0.4` or later
* Bump iced-nrepl to 0.6.7.
* Bump iced-nrepl to 0.7.0.

=== Fixed
* Fixed clearing virtual text to work correctly in neovim.

=== Removed
* (Breaking) https://github.com/liquidz/vim-iced/issues/159[#159]: Remove linting functionality.
* (Breaking) Remove `:IcedDefBack` command.
** You can use built-in https://vim-jp.org/vimdoc-en/tagsrch.html#CTRL-T[<C-t>] key mapping instead.

Expand Down
6 changes: 0 additions & 6 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ Function dependencies and references https://twitter.com/uochan/status/113954087
Supports cider-nrepl's debugger https://twitter.com/uochan/status/1034404572368842752[:movie_camera:]
Browsing tapped values https://twitter.com/uochan/status/1146982101662572544[:movie_camera:]

|:eyes:
|Linting
|Powered by https://github.com/jonase/eastwood[jonase/eastwood]
https://twitter.com/uochan/status/1038050122062413824[:movie_camera:]
and https://github.com/candid82/joker[joker]

|:notebook:
|Skeleton
|Provides code skeleton when you open new file
Expand Down
72 changes: 0 additions & 72 deletions autoload/iced/lint.vim

This file was deleted.

3 changes: 1 addition & 2 deletions autoload/iced/nrepl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,7 @@ endfunction " }}}

" EVAL {{{
function! iced#nrepl#is_evaluating() abort
return !empty(s:messages)
\ && (len(s:messages) != 1 || s:messages[keys(s:messages)[0]]['op'] !=# 'iced-lint-file')
return !empty(s:messages) && len(s:messages) != 1
endfunction

function! iced#nrepl#eval(code, ...) abort
Expand Down
17 changes: 3 additions & 14 deletions autoload/iced/nrepl/auto.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let s:save_cpo = &cpo
set cpo&vim
let s:save_cpo = &cpoptions
set cpoptions&vim

let g:iced#nrepl#auto#does_switch_session = get(g:, 'iced#nrepl#auto#does_switch_session', v:false)
let s:leaving = v:false
Expand Down Expand Up @@ -56,17 +56,6 @@ function! iced#nrepl#auto#bufread() abort
call iced#format#set_indentexpr()
endfunction

function! iced#nrepl#auto#bufwrite_post() abort
let timer = {}
function! timer.callback(_) abort
if !s:leaving
call iced#lint#current_file()
endif
endfunction

call iced#system#get('timer').start(500, timer.callback)
endfunction

function! iced#nrepl#auto#newfile() abort
if !iced#nrepl#is_connected() | return | endif
call iced#skeleton#new()
Expand All @@ -83,5 +72,5 @@ function! iced#nrepl#auto#enable_bufenter(bool) abort
let s:is_bufenter_enabled = a:bool
endfunction

let &cpo = s:save_cpo
let &cpoptions = s:save_cpo
unlet s:save_cpo
25 changes: 0 additions & 25 deletions autoload/iced/nrepl/op/iced.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,6 @@ function! s:concat_handler(key, resp, last_result) abort
return result
endfunction

""" lint-file {{{
function! iced#nrepl#op#iced#is_lint_running() abort
return iced#nrepl#is_op_running('iced-lint-file')
endfunction

function! iced#nrepl#op#iced#lint_file(file, opt, callback) abort
if !iced#nrepl#is_connected() | return | endif

let msg = {
\ 'id': iced#nrepl#id(),
\ 'op': 'iced-lint-file',
\ 'session': iced#nrepl#current_session(),
\ 'env': iced#nrepl#current_session_key(),
\ 'file': a:file,
\ 'callback': a:callback,
\ }

if !empty(a:opt) && type(a:opt) == v:t_dict
let msg['opt'] = a:opt
endif

call iced#nrepl#send(msg)
endfunction " }}}

""" spec-check {{{
function! iced#nrepl#op#iced#spec_check(symbol, num_tests, callback) abort
if !iced#nrepl#is_connected() | return iced#message#error('not_connected') | endif
Expand Down Expand Up @@ -117,7 +93,6 @@ function! iced#nrepl#op#iced#complete_tapped(keys, callback) abort
\ })
endfunction " }}}

call iced#nrepl#register_handler('iced-lint-file', function('s:concat_handler', ['lint-warnings']))
call iced#nrepl#register_handler('iced-pseudo-ns-path', function('iced#nrepl#path_translation_handler', [['path']]))

let &cpoptions = s:save_cpo
Expand Down
2 changes: 1 addition & 1 deletion bin/iced
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCRIPT_DIR=$(cd $(dirname $0); pwd)
PROJECT_DIR=$(cd $SCRIPT_DIR; cd ..; pwd)
VERSION=$(grep 'Version: ' ${SCRIPT_DIR}/../doc/vim-iced.txt | cut -d' ' -f2)

BASE_DEPENDENCIES='nrepl:0.6.0 refactor-nrepl:2.4.0 cider/cider-nrepl:0.22.4 iced-nrepl:0.6.7-SNAPSHOT'
BASE_DEPENDENCIES='nrepl:0.6.0 refactor-nrepl:2.4.0 cider/cider-nrepl:0.22.4 iced-nrepl:0.7.0'
BASE_MIDDLEWARES='cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-debug cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-spec cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-undef cider.nrepl/wrap-xref refactor-nrepl.middleware/wrap-refactor iced.nrepl/wrap-iced'

CLJS_DEPENDENCIES='cider/piggieback:0.4.1'
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:deps {nrepl {:mvn/version "0.6.0"}
refactor-nrepl {:mvn/version "2.4.0"}
cider/cider-nrepl {:mvn/version "0.22.4"}
iced-nrepl {:mvn/version "0.6.7-SNAPSHOT"}}
iced-nrepl {:mvn/version "0.7.0"}}
:__middlewares__
["cider.nrepl/wrap-classpath"
"cider.nrepl/wrap-clojuredocs"
Expand Down
2 changes: 1 addition & 1 deletion doc/iced-tips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ SIGN *iced-tips-sign*
------------------------------------------------------------------------------
JUMPING SIGNS *iced-tips-jumping-signs*

vim-iced uses |signs| on tracing, linting, and testing.
vim-iced uses |signs| on tracing, and testing.
For jumping between signs, following commands are usable.

- |:IcedJumpToNextSign|
Expand Down
87 changes: 4 additions & 83 deletions doc/vim-iced.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ CONTENTS *vim-iced-contents*
Formatting |vim-iced-formatting|
Indenting |vim-iced-indenting|
Refactoring |vim-iced-refactoring|
Linting |vim-iced-linting|
Interface |vim-iced-interface|
Commands |vim-iced-commands|
Functions |vim-iced-functions|
Expand All @@ -46,7 +45,6 @@ CONTENTS *vim-iced-contents*
Documents |vim-iced-customizing-documents|
Auto document |vim-iced-customizing-auto-document|
Auto indent |vim-iced-customizing-auto-indent|
Linters |vim-iced-customizing-linters|
Signs |vim-iced-customizing-signs|
Command palettes |vim-iced-customizing-palette|
Hooks |vim-iced-customizing-hooks|
Expand Down Expand Up @@ -111,7 +109,7 @@ LEININGEN~
>
{:user
{:dependencies [[nrepl "0.6.0"]
[iced-nrepl "0.6.7-SNAPSHOT"]
[iced-nrepl "0.7.0"]
[cider/cider-nrepl "0.22.4"]]
:repl-options {:nrepl-middleware [cider.nrepl/wrap-classpath
cider.nrepl/wrap-clojuredocs
Expand Down Expand Up @@ -141,7 +139,7 @@ BOOT~
(swap! boot.repl/*default-dependencies* concat
'[[refactor-nrepl "2.4.0"]
[cider/cider-nrepl "0.22.4"]
[iced-nrepl "0.6.7-SNAPSHOT"]])
[iced-nrepl "0.7.0"]])
(swap! boot.repl/*default-middleware* concat
'[cider.nrepl/wrap-classpath
Expand Down Expand Up @@ -171,7 +169,7 @@ SHADOW-CLJS~
{
:dependencies [[refactor-nrepl "2.4.0"]
[cider/cider-nrepl "0.22.4"]
[iced-nrepl "0.6.7-SNAPSHOT"]]
[iced-nrepl "0.7.0"]]
:nrepl {:cider false
:middleware [cider.nrepl/wrap-classpath
Expand Down Expand Up @@ -484,33 +482,6 @@ REFACTORING *vim-iced-refactoring*
- |:IcedAddArity| (|<Plug>(iced_add_arity)|)
- |:IcedMoveToLet| (|<Plug>(iced_move_to_let)|)

------------------------------------------------------------------------------
LINTING *vim-iced-linting*

vim-iced can collaborate with `jonase/eastwood` and `joker`.
- https://github.com/jonase/eastwood
- works for Clojure
- https://github.com/candid82/joker
- works for ClojureScript
- needs to be installed separately from vim-iced
- Command
- |:IcedLintCurrentFile| (|<Plug>(iced_lint_current_file)|)

To run linter automatically, set |g:iced_enable_auto_linting| to `v:true`.
>
let g:iced_enable_auto_linting = v:true
<
If you would like to set manually, following autcmd is useful.
>
aug vim_iced_lint_setting
au!
au BufWritePost *.clj,*.cljs,*.cljc call iced#lint#current_file()
au CursorMoved *.clj,*.cljs,*.cljc call iced#lint#echo_message()
aug END
<
To define which linters to use, see |g:iced#eastwood#option|.
To show warnings as virtual text, see |g:iced#lint#use_virtual_text|.

==============================================================================
INTERFACE *vim-iced-interface*

Expand Down Expand Up @@ -994,16 +965,6 @@ COMMANDS *vim-iced-commands*
Sets `*ns*` to the REPL session's namespace name.
Key is mapped to |<Plug>(iced_in_repl_ns)|.

*:IcedLintCurrentFile*
:IcedLintCurrentFile
Lint codes in current file.
Key is mapped to |<Plug>(iced_lint_current_file)|.

*:IcedLintToggle*
:IcedLintToggle
Toggle linting.
Key is mapped to |<Plug>(iced_lint_toggle)|.

*:IcedJumpToNextSign*
:IcedJumpToNextSign
Jump cursor to next sign in current buffer.
Expand Down Expand Up @@ -1391,14 +1352,6 @@ KEY MAPPINGS *vim-iced-key-mappings*
<Plug>(iced_in_repl_ns)
Same as |:IcedInReplNs|.

*<Plug>(iced_lint_current_file)*
<Plug>(iced_lint_current_file)
Same as |:IcedLintCurrentFile|.

*<Plug>(iced_lint_toggle)*
<Plug>(iced_lint_toggle)
Same as |:IcedLintToggle|.

*<Plug>(iced_jump_to_next_sign)*
<Plug>(iced_jump_to_next_sign)
Same as |:IcedJumpToNextSign|.
Expand Down Expand Up @@ -1639,35 +1592,6 @@ g:iced_enable_auto_indent
Default value is `v:true`.
See details: |vim-iced-indenting|.

------------------------------------------------------------------------------
LINTERS *vim-iced-customizing-linters*

*g:iced#eastwood#option*
g:iced#eastwood#option
Linting option which is used by `jonase/eastwood`.
See details: |vim-iced-linting|

Specific linter names are shown at:
- https://github.com/jonase/eastwood#whats-there

Ex. enable all linters excluding `implicit-dependencies` linter
>
let g:iced#eastwood#option = {
\ 'linters': ['all'],
\ 'exclude-linters': ['implicit-dependencies'],
\ }
<
*g:iced#lint#use_virtual_text*
g:iced#lint#use_virtual_text
If {v:true}, use virtual text to show lint warning text.
Default value is `v:false`.

*g:iced_enable_auto_linting*
g:iced_enable_auto_linting
If {v:true}, enable linting automatically.
Linting is worked when |BufWritePost|.
See details: |vim-iced-linting|

------------------------------------------------------------------------------
SIGNS *vim-iced-customizing-signs*

Expand All @@ -1677,22 +1601,19 @@ g:iced_sign
vim-iced provides following signs.
- iced_error (for test failure position)
- iced_trace (for tracing var position)
- iced_lint (for lint warning position)

Each sign has default setting as follows. >
{
'error': '🔥',
'trace': '👁',
'lint': '💔',
'errorhl': 'ErrorMsg',
'tracehl': 'Search',
'linthl': 'WarningMsg',
}
<
You can change the setting by `g:iced_sign` variable.
Ex. changing sign text
>
let g:iced_sign = {'error': 'E', 'trace': 'T', 'lint': 'L'}
let g:iced_sign = {'error': 'E', 'trace': 'T'}
<
------------------------------------------------------------------------------
COMMAND PALETTES *vim-iced-customizing-palette*
Expand Down
Loading

0 comments on commit 6276c13

Please sign in to comment.