【问题标题】:How to configure VIM ALE to use cookstyle linter如何配置 VIM ALE 以使用 cookstyle linter
【发布时间】:2021-07-21 23:01:39
【问题描述】:

我正在尝试将 VIM 插件 ALE 配置为使用 chef cookstyle linter 进行厨师食谱项目。但是 ALE 没有抛出任何错误。在文档中我发现ALE 有基于厨师的烹饪风格https://github.com/dense-analysis/ale/blob/master/doc/ale.txt 的选项,但它不起作用。

我在我的 vimrc 文件中定义了以下配置

【问题讨论】:

  • :ALEInfo 的输出是什么?也有问题使用文本而不是图像。
  • 如果我在文本中粘贴 :ALEInfo 输出,它将超过 stackoverflow 强制执行的总字符限制

标签: vim chef-infra vim-plugin neovim vim-ale


【解决方案1】:

对于 Chef distributed with ALEale_linters,因此只需为这些与特定目录路径匹配的 Ruby 文件设置 filetype=chef。这可以通过以下方式完成(当然,根据您的本地目录结构进行相应调整):

autocmd BufNewFile,BufRead */recipes/*.rb set ft=chef syntax=ruby

然后在运行:ALEInfo 时,您将看到如下输出:

 Current Filetype: chef                                                                                                                
Available Linters: ['cookstyle', 'foodcritic']
  Enabled Linters: ['cookstyle', 'foodcritic']
  Ignored Linters: []
 Suggested Fixers:
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:
let g:ale_chef_cookstyle_executable = 'cookstyle'
let g:ale_chef_cookstyle_options = ''
let g:ale_chef_foodcritic_executable = 'foodcritic'
let g:ale_chef_foodcritic_options = ''
 Global Variables:
...

【讨论】:

    猜你喜欢
    • 2020-11-23
    • 1970-01-01
    • 1970-01-01
    • 2012-01-27
    • 1970-01-01
    • 2019-02-15
    • 2020-11-23
    • 2021-05-15
    • 2018-11-17
    相关资源
    最近更新 更多