Stop being an idiot about the regex and rewrite it
There was no reason to shoehorn in zero-length assertions.GSoC/Meterpreter_Web_Console
parent
40cb09b2e2
commit
2186322134
|
@ -256,8 +256,7 @@ class Msftidy
|
||||||
|
|
||||||
# This check also enforces namespace module name reversibility
|
# This check also enforces namespace module name reversibility
|
||||||
def check_snake_case_filename
|
def check_snake_case_filename
|
||||||
# TODO: Can we add the __ check to the look{ahead,behind}?
|
if @name !~ /^[a-z0-9]+(?:_[a-z0-9]+)*\.rb$/
|
||||||
if @name !~ /^(?!_)[a-z0-9_]+(?<!_)\.rb$/ || @name.include?('__')
|
|
||||||
warn('Filenames should be lowercase alphanumeric snake case.')
|
warn('Filenames should be lowercase alphanumeric snake case.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue