summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorJustin Searls <searls@gmail.com>2018-12-10 16:02:32 -0500
committerBjorn Neergaard <bjorn@neersighted.com>2018-12-10 14:02:32 -0700
commit2cfa09e02d65cd06649fb1ae5f988b7a110a124d (patch)
treed92176e4ddc7dfa5b42c7018ca568d0a73b156a5 /test/handler
parentc899ff3523e716efb71907234d7ca2e740c9e761 (diff)
downloadale-2cfa09e02d65cd06649fb1ae5f988b7a110a124d.zip
Adds standardrb linter (#2133)
See: https://github.com/testdouble/standard StandardRB is to RuboCop what StandardJS is to ESLint. This commit naively copies the RuboCop linter and fixer to point at the standardrb executable. Any other adjustments are very minor (the only I can think of is that standardrb takes a `--fix` option instead of `--auto-correct`). This raises a confusing point to me as both developer and a user: since ale enables all linters by default, won't this run both RuboCop and StandardRB (the results of which will almost always be in conflict with one another)? How does ale already solve for this for the similar case of StandardJS and ESLint?
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_rubocop_handler.vader12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/handler/test_rubocop_handler.vader b/test/handler/test_rubocop_handler.vader
index ef0137d6..d7868f26 100644
--- a/test/handler/test_rubocop_handler.vader
+++ b/test/handler/test_rubocop_handler.vader
@@ -41,21 +41,21 @@ Execute(The rubocop handler should parse lines correctly):
\ 'type': 'E',
\ },
\ ],
- \ ale_linters#ruby#rubocop#Handle(347, [
+ \ ale#ruby#HandleRubocopOutput(347, [
\ '{"metadata":{"rubocop_version":"0.47.1","ruby_engine":"ruby","ruby_version":"2.1.5","ruby_patchlevel":"273","ruby_platform":"x86_64-linux-gnu"},"files":[{"path":"my_great_file.rb","offenses":[{"severity":"convention","message":"Prefer single-quoted strings...","cop_name":"Style/SomeCop","corrected":false,"location":{"line":83,"column":29,"length":7}},{"severity":"fatal","message":"Some error","cop_name":"Style/SomeOtherCop","corrected":false,"location":{"line":12,"column":2,"length":1}},{"severity":"warning","message":"Regular warning","cop_name":"Style/WarningCop","corrected":false,"location":{"line":10,"column":5,"length":8}},{"severity":"error","message":"Another error","cop_name":"Style/SpaceBeforeBlockBraces","corrected":false,"location":{"line":11,"column":1,"length":1}}]}],"summary":{"offense_count":4,"target_file_count":1,"inspected_file_count":1}}'
\ ])
Execute(The rubocop handler should handle when files are checked and no offenses are found):
AssertEqual
\ [],
- \ ale_linters#ruby#rubocop#Handle(347, [
+ \ ale#ruby#HandleRubocopOutput(347, [
\ '{"metadata":{"rubocop_version":"0.47.1","ruby_engine":"ruby","ruby_version":"2.1.5","ruby_patchlevel":"273","ruby_platform":"x86_64-linux-gnu"},"files":[{"path":"my_great_file.rb","offenses":[]}],"summary":{"offense_count":0,"target_file_count":1,"inspected_file_count":1}}'
\ ])
Execute(The rubocop handler should handle when no files are checked):
AssertEqual
\ [],
- \ ale_linters#ruby#rubocop#Handle(347, [
+ \ ale#ruby#HandleRubocopOutput(347, [
\ '{"metadata":{"rubocop_version":"0.47.1","ruby_engine":"ruby","ruby_version":"2.1.5","ruby_patchlevel":"273","ruby_platform":"x86_64-linux-gnu"},"files":[],"summary":{"offense_count":0,"target_file_count":0,"inspected_file_count":0}}'
\ ])
@@ -66,11 +66,11 @@ Execute(The rubocop handler should handle output without any errors):
AssertEqual
\ [],
- \ ale_linters#ruby#rubocop#Handle(347, g:lines)
+ \ ale#ruby#HandleRubocopOutput(347, g:lines)
\
AssertEqual
\ [],
- \ ale_linters#ruby#rubocop#Handle(347, ['{}'])
+ \ ale#ruby#HandleRubocopOutput(347, ['{}'])
AssertEqual
\ [],
- \ ale_linters#ruby#rubocop#Handle(347, [])
+ \ ale#ruby#HandleRubocopOutput(347, [])