comments: Allow whitespace after the shebang marker
Basically, any character is now allowed after the shebang marker. Closes #428. Whitespace after the #! marker on shebang lines is authorized and optional, as explained on Wikipedia's entry for shebang line as can be seen from the extracts below : > White space after #! is optional and > It has been claimed[20] that some old versions of Unix expect the > normal shebang to be followed by a space and a slash (#! /), but this > appears to be untrue;[21] rather, blanks after the shebang have > traditionally been allowed, and sometimes documented with a space
This commit is contained in:
@@ -97,7 +97,7 @@ class CommentsTestCase(RuleTestCase):
|
||||
'#!/bin/env my-interpreter\n'
|
||||
'', conf,
|
||||
problem1=(1, 2), problem2=(3, 2), problem3=(4, 2))
|
||||
self.check('#! not a shebang\n',
|
||||
self.check('#! is a valid shebang too\n',
|
||||
conf, problem1=(1, 2))
|
||||
self.check('key: #!/not/a/shebang\n',
|
||||
conf, problem1=(1, 8))
|
||||
@@ -117,8 +117,7 @@ class CommentsTestCase(RuleTestCase):
|
||||
'#comment\n'
|
||||
'#!/bin/env my-interpreter\n', conf,
|
||||
problem2=(3, 2), problem3=(4, 2))
|
||||
self.check('#! not a shebang\n',
|
||||
conf, problem1=(1, 2))
|
||||
self.check('#! is a valid shebang too\n', conf)
|
||||
self.check('key: #!/not/a/shebang\n',
|
||||
conf, problem1=(1, 8))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user