Skip to content

Commit

Permalink
support cmake&shell&python auto-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
xingchensong committed Nov 23, 2021
1 parent 5a941f9 commit 6fabe3f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions scripts/install_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh
# update vim (>= 8.2)
conda update -n base conda -y && conda install -y pip
conda install -c conda-forge vim zsh -y
pip3 install --user pynvim neovim jedi autopep8 cpplint -i https://pypi.tuna.tsinghua.edu.cn/simple
conda install -c conda-forge vim zsh shellcheck -y
pip3 install --user pynvim neovim jedi autopep8 cpplint pylint isort cmakelint cmake-format flake8==3.8.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
26 changes: 21 additions & 5 deletions vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,34 @@ let g:asyncrun_open = 8
"" ale cppcheck
"使用clang对c和c++进行语法检查,对python使用pylint进行语法检查
let g:ale_linters = {
\ 'c': ['cpplint', 'clang', 'gcc'],
\ 'cpp': ['cpplint', 'clang', 'g++'],
\ 'python3': ['pylint'],
\ 'c': ['clang', 'gcc'],
\ 'cpp': ['cpplint', 'clang++', 'g++'],
\ 'python': ['flake8', 'pylint'],
\ 'sh': ['shellcheck'],
\ 'cmake': ['cmakelint']
\ }
let g:ale_c_gcc_options = '-Wall -O2 -std=c99 -isystem
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['autopep8', 'isort'],
\ 'cmake': ['cmakeformat']
\ }
let g:ale_c_cc_options = '-Wall -O2 -std=c99 -isystem
\ -I .
\ -I /usr/include
\ -I /usr/local/include'
let g:ale_cpp_cc_options = '-Wall -O2 -std=c++11 -isystem
\ -I .
\ -I /usr/include
\ -I /usr/local/include'
let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++11 -isystem
let g:ale_cpp_cpplint_options = '-Wall -O2 -std=c++11 -isystem
\ -I .
\ -I /usr/include
\ -I /usr/local/include'
let g:ale_python_auto_pipenv = 1
let g:ale_python_auto_poetry = 1
let g:ale_python_flake8_auto_pipenv = 1
let g:ale_python_pylint_auto_pipenv = 1
let g:ale_python_pylint_use_msg_id = 1
"自定义error和warning图标
let g:ale_sign_error = ''
let g:ale_sign_warning = ''
Expand Down

0 comments on commit 6fabe3f

Please sign in to comment.