Merge pull request #1850 from rrosenblum/ruby_linters

Update all Ruby linters to work consistently with bundler
This commit is contained in:
w0rp
2018-09-14 13:27:07 +01:00
committed by GitHub
10 changed files with 97 additions and 48 deletions

View File

@@ -12,7 +12,8 @@ Execute(The brakeman command callback should detect absence of a valid Rails app
Execute(The brakeman command callback should find a valid Rails app root):
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
AssertLinter 'brakeman', 'brakeman -f json -q -p '
AssertLinter 'brakeman', ale#Escape('brakeman')
\ . ' -f json -q -p '
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
Execute(The brakeman command callback should include configured options):
@@ -20,5 +21,17 @@ Execute(The brakeman command callback should include configured options):
let g:ale_ruby_brakeman_options = '--combobulate'
AssertLinter 'brakeman', 'brakeman -f json -q --combobulate -p '
AssertLinter 'brakeman', ale#Escape('brakeman')
\ . ' -f json -q --combobulate -p '
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
Execute(Setting bundle appends 'exec brakeman'):
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
let g:ale_ruby_brakeman_executable = 'bundle'
let g:ale_ruby_brakeman_options = '--combobulate'
AssertLinter 'bundle', ale#Escape('bundle')
\ . ' exec brakeman'
\ . ' -f json -q --combobulate -p '
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))

View File

@@ -7,8 +7,8 @@ After:
Execute(The reek callbacks should return the correct default values):
WithChainResults ['reek 5.0.0']
AssertLinter 'reek', [
\ 'reek --version',
\ 'reek -f json --no-progress --no-color --stdin-filename %s',
\ ale#Escape('reek') . ' --version',
\ ale#Escape('reek') . ' -f json --no-progress --no-color --stdin-filename %s',
\]
" Try with older versions.
@@ -16,19 +16,35 @@ Execute(The reek callbacks should return the correct default values):
WithChainResults ['reek 4.8.2']
AssertLinter 'reek', [
\ 'reek --version',
\ 'reek -f json --no-progress --no-color',
\ ale#Escape('reek') . ' --version',
\ ale#Escape('reek') . ' -f json --no-progress --no-color',
\]
Execute(Setting bundle appends 'exec reek'):
let g:ale_ruby_reek_executable = 'bundle'
WithChainResults ['reek 5.0.0']
AssertLinter 'bundle', ale#Escape('bundle')
\ . ' exec reek'
\ . ' -f json --no-progress --no-color --stdin-filename %s',
" Try with older versions.
call ale#semver#ResetVersionCache()
WithChainResults ['reek 4.8.2']
AssertLinter 'bundle', ale#Escape('bundle')
\ . ' exec reek'
\ . ' -f json --no-progress --no-color'
Execute(The reek version check should be cached):
WithChainResults ['reek 5.0.0']
AssertLinter 'reek', [
\ 'reek --version',
\ 'reek -f json --no-progress --no-color --stdin-filename %s',
\ ale#Escape('reek') . ' --version',
\ ale#Escape('reek') . ' -f json --no-progress --no-color --stdin-filename %s',
\]
WithChainResults []
AssertLinter 'reek', [
\ '',
\ 'reek -f json --no-progress --no-color --stdin-filename %s',
\ ale#Escape('reek') . ' -f json --no-progress --no-color --stdin-filename %s',
\]