All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#test#SetDirectory('/testplugin/test/handler')
4 runtime ale_linters/ruby/brakeman.vim
7 call ale#test#RestoreDirectory()
8 call ale#linter#Reset()
10 Execute(The brakeman handler should parse JSON correctly):
11 call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/models/thing.rb')
16 \ 'filename': expand('%:p'),
18 \ 'text': 'SQL Injection Possible SQL injection (Medium)',
22 \ 'filename': expand('%:p'),
24 \ 'text': 'Mass Assignment Potentially dangerous attribute available for mass assignment (Weak)',
28 \ ale_linters#ruby#brakeman#Handle(bufnr(''), [
32 \ '"warning_type": "SQL Injection",',
33 \ '"warning_code": 0,',
34 \ '"fingerprint": "1234",',
35 \ '"check_name": "SQL",',
36 \ '"message": "Possible SQL injection",',
37 \ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
39 \ '"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",',
40 \ '"code": "Thing.connection.execute(params[:data])",',
41 \ '"render_path": null,',
43 \ '"type": "method",',
44 \ '"class": "Thing",',
45 \ '"method": "run_raw_sql_from_internet"',
47 \ '"user_input": "whatever",',
48 \ '"confidence": "Medium"',
51 \ '"warning_type": "Mass Assignment",',
52 \ '"warning_code": 60,',
53 \ '"fingerprint": "1235",',
54 \ '"check_name": "ModelAttrAccessible",',
55 \ '"message": "Potentially dangerous attribute available for mass assignment",',
56 \ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
58 \ '"link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",',
60 \ '"render_path": null,',
65 \ '"user_input": null,',
66 \ '"confidence": "Weak"',
72 Execute(The brakeman handler should parse JSON correctly when there is no output from brakeman):
75 \ ale_linters#ruby#brakeman#Handle(347, [
78 Execute(The brakeman handler should handle garbage output):
81 \ ale_linters#ruby#brakeman#Handle(347, [
82 \ 'No such command in 2.4.1 of ruby',