Skip to content

Commit

Permalink
[nvim] configure and use ruff instead of flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitmel committed Apr 16, 2023
1 parent fe034ef commit e6ade7b
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 437 deletions.
35 changes: 35 additions & 0 deletions misc/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
line-length = 99

# <https://beta.ruff.rs/docs/rules/>
select = [
"E", # pycodestyle (errors)
"W", # pycodestyle (warnings)
"F", # pyflakes
"Q", # flake8-quotes
"ANN", # flake8-annotations
"N", # pep8-naming
"I", # isort
# "COM", # flake8-commas
"S", # flake8-bandit
"B", # flake8-bugbear
"PLC", # pylint (convention)
"PLE", # pylint (errors)
"PLW", # pylint (warnings)
]

ignore = [
"E402", # module level import not at top of file
"E501", # line too long
"S101", # use of `assert` detected
"S311", # standard PRNGs are not suitable for cryptography
"ANN101", # missing type annotation for `self`
"ANN102", # missing type annotation for `cls`
"ANN401", # dynamically typed expressions are disallowed
"PLW0603", # using the global statement is discouraged
"PLW2901", # outer loop variable overwritten by inner loop target
]

[flake8-quotes]
inline-quotes = "double"
multiline-quotes = "double"
docstring-quotes = "double"
4 changes: 3 additions & 1 deletion nvim/coc-languages/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ let g:coc_user_config['python'] = {
\ },
\ 'linting': {
\ 'pylintEnabled': v:false,
\ 'flake8Enabled': v:true,
\ 'flake8Enabled': v:false,
\ 'flake8Args': ['--config=' . g:dotfiles_dir.'/misc/flake8.ini'],
\ 'ruffEnabled': v:true,
\ 'ruffArgs': ['--config=' . g:dotfiles_dir.'/misc/ruff.toml'],
\ },
\ 'analysis': {
\ 'autoSearchPaths': v:true,
Expand Down
Loading

0 comments on commit e6ade7b

Please sign in to comment.