|
|
@ -84,28 +84,43 @@ class CommentsTestCase(RuleTestCase):
|
|
|
|
conf = ('comments:\n'
|
|
|
|
conf = ('comments:\n'
|
|
|
|
' require-starting-space: true\n'
|
|
|
|
' require-starting-space: true\n'
|
|
|
|
' ignore-shebangs: false\n'
|
|
|
|
' ignore-shebangs: false\n'
|
|
|
|
'comments-indentation: disable\n')
|
|
|
|
'comments-indentation: disable\n'
|
|
|
|
|
|
|
|
'document-start: disable\n')
|
|
|
|
self.check('#!/bin/env my-interpreter\n',
|
|
|
|
self.check('#!/bin/env my-interpreter\n',
|
|
|
|
conf, problem1=(1, 2))
|
|
|
|
conf, problem1=(1, 2))
|
|
|
|
|
|
|
|
self.check('# comment\n'
|
|
|
|
|
|
|
|
'#!/bin/env my-interpreter\n', conf,
|
|
|
|
|
|
|
|
problem1=(2, 2))
|
|
|
|
self.check('#!/bin/env my-interpreter\n'
|
|
|
|
self.check('#!/bin/env my-interpreter\n'
|
|
|
|
'---\n'
|
|
|
|
'---\n'
|
|
|
|
'#comment\n'
|
|
|
|
'#comment\n'
|
|
|
|
'#!/bin/env my-interpreter\n'
|
|
|
|
'#!/bin/env my-interpreter\n'
|
|
|
|
'', conf,
|
|
|
|
'', conf,
|
|
|
|
problem1=(1, 2), problem2=(3, 2), problem3=(4, 2))
|
|
|
|
problem1=(1, 2), problem2=(3, 2), problem3=(4, 2))
|
|
|
|
|
|
|
|
self.check('#! not a shebang\n',
|
|
|
|
|
|
|
|
conf, problem1=(1, 2))
|
|
|
|
|
|
|
|
self.check('key: #!/not/a/shebang\n',
|
|
|
|
|
|
|
|
conf, problem1=(1, 8))
|
|
|
|
|
|
|
|
|
|
|
|
def test_ignore_shebang(self):
|
|
|
|
def test_ignore_shebang(self):
|
|
|
|
conf = ('comments:\n'
|
|
|
|
conf = ('comments:\n'
|
|
|
|
' require-starting-space: true\n'
|
|
|
|
' require-starting-space: true\n'
|
|
|
|
' ignore-shebangs: true\n'
|
|
|
|
' ignore-shebangs: true\n'
|
|
|
|
'comments-indentation: disable\n')
|
|
|
|
'comments-indentation: disable\n'
|
|
|
|
|
|
|
|
'document-start: disable\n')
|
|
|
|
self.check('#!/bin/env my-interpreter\n', conf)
|
|
|
|
self.check('#!/bin/env my-interpreter\n', conf)
|
|
|
|
|
|
|
|
self.check('# comment\n'
|
|
|
|
|
|
|
|
'#!/bin/env my-interpreter\n', conf,
|
|
|
|
|
|
|
|
problem1=(2, 2))
|
|
|
|
self.check('#!/bin/env my-interpreter\n'
|
|
|
|
self.check('#!/bin/env my-interpreter\n'
|
|
|
|
'---\n'
|
|
|
|
'---\n'
|
|
|
|
'#comment\n'
|
|
|
|
'#comment\n'
|
|
|
|
'#!/bin/env my-interpreter\n'
|
|
|
|
'#!/bin/env my-interpreter\n', conf,
|
|
|
|
'', conf,
|
|
|
|
|
|
|
|
problem2=(3, 2), problem3=(4, 2))
|
|
|
|
problem2=(3, 2), problem3=(4, 2))
|
|
|
|
|
|
|
|
self.check('#! not a shebang\n',
|
|
|
|
|
|
|
|
conf, problem1=(1, 2))
|
|
|
|
|
|
|
|
self.check('key: #!/not/a/shebang\n',
|
|
|
|
|
|
|
|
conf, problem1=(1, 8))
|
|
|
|
|
|
|
|
|
|
|
|
def test_spaces_from_content(self):
|
|
|
|
def test_spaces_from_content(self):
|
|
|
|
conf = ('comments:\n'
|
|
|
|
conf = ('comments:\n'
|
|
|
|