Fix ignore option and add first tests
Change-Id: I1c91853befa935137f2148169be0089365c521a8
This commit is contained in:
@@ -58,6 +58,8 @@ def should_ignore(error):
|
||||
|
||||
def print_error(error, line,
|
||||
filename=None, filelineno=None):
|
||||
if should_ignore(error):
|
||||
return
|
||||
if not filename:
|
||||
filename = fileinput.filename()
|
||||
if not filelineno:
|
||||
|
||||
@@ -19,10 +19,19 @@ test_bash8
|
||||
Tests for `bash8` module.
|
||||
"""
|
||||
|
||||
from bash8 import bash8
|
||||
from bash8.tests import base
|
||||
|
||||
|
||||
class TestBash8(base.TestCase):
|
||||
|
||||
def test_something(self):
|
||||
pass
|
||||
def test_multi_ignore(self):
|
||||
bash8.register_ignores('E001|E011')
|
||||
bash8.check_no_trailing_whitespace("if ")
|
||||
bash8.check_if_then("if ")
|
||||
self.assertEqual(bash8.ERRORS, 0)
|
||||
|
||||
def test_ignore(self):
|
||||
bash8.register_ignores('E001')
|
||||
bash8.check_no_trailing_whitespace("if ")
|
||||
self.assertEqual(bash8.ERRORS, 0)
|
||||
|
||||
Reference in New Issue
Block a user