-2

I have vim 9.0 with Python support: I have auto complete and Syntax checking for Python installed. Here is my ~/.vimrc file contents:

set nocompatible              " required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

" ...

Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Bundle 'Valloric/YouCompleteMe'


set clipboard=unnamed

set nu

let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree

"if has('gui_running')
"  set background=dark
"  colorscheme solarized
"else
"  colorscheme zenburn
"endif

"so ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim


let python_highlight_all=1
syntax on

let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration<CR>

set splitbelow
set splitright

"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Enable folding
set foldmethod=indent
set foldlevel=99

" Enable folding with the spacebar
nnoremap <space> za

"au BufNewFile,BufRead *.py
"    \ setlocal tabstop=4 set softtabstop=4 set shiftwidth=4 set textwidth=79 set expandtab set autoindent set fileformat=unix

au FileType *.js, *.html, *.css
    \ setlocal tabstop=2 set softtabstop=2 set shiftwidth=2

"au BufNewFile,BufRead *.js,*.html,*.css,*.vue
"\ set tabstop=2 |
"\ set softtabstop=2 |
"\ set shiftwidth=2

"Flagging Unnecessary Whitespace
highlight BadWhitespace ctermbg=red guibg=darkred
au FileType *.py, *.pyw, *.c, *.h match BadWhitespace /\s\+$/

"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/


set encoding=utf-8

"All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

To test the Python support, I created a simple script as the Figure below shows. It has weird warning in two of its lines: [missing-function-docstring] Missing function or method docstring.

Sample code with Autocomplete and Syntax checking for Python

How can I suppress such kind of error/warning?

mad
  • 2,677
  • 8
  • 35
  • 78
  • 1
    By figuring out which of your plugins is responsible for it, and figuring out how to disable the feature by reading its documentation. – romainl Aug 12 '22 at 05:48

1 Answers1

1

Nothing to worry about. It's a normal behaviour of the YCM Plugin:

The GetDoc subcommand:

Displays the preview window populated with quick info about the identifier under the cursor. Depending on the file type, this includes things like:

  • The type or declaration of identifier,
  • Doxygen/javadoc comments,
  • Python docstrings,
  • etc.

Thus, when trying to perform its GetDoc functionality in order to display information about the function under the cursor, YCM simply tells you that the function testing() does not have a documentation associated with it.

Thirsty4K
  • 68
  • 8