mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
Add check_rubocop
Uses rubocop to check syntax / style of ruby files.
This commit is contained in:
parent
616c1ebd18
commit
a2d690a0ab
7 changed files with 50 additions and 0 deletions
13
tests/check_rubocop_test.py
Normal file
13
tests/check_rubocop_test.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
from pre_commit_hooks.check_rubocop import check_rubocop
|
||||
from testing.util import get_resource_path
|
||||
|
||||
|
||||
@pytest.mark.parametrize(('filename', 'expected_retval'), (
|
||||
('invalid_ruby.rb', 1),
|
||||
('valid_ruby.rb', 0),
|
||||
))
|
||||
def test_check_rubocop(filename, expected_retval):
|
||||
ret = check_rubocop([get_resource_path(filename)])
|
||||
assert ret == expected_retval
|
||||
Loading…
Add table
Add a link
Reference in a new issue