##// END OF EJS Templates
check-code: add a rule to forbid "cp -r"...
check-code: add a rule to forbid "cp -r" See the commit message of the previous patch for the reason. In short, according to the current POSIX standard, "-r" is "removed", and "-R" is the current standard way to do "copy file hierarchies".

File last commit:

r30435:b86a448a default
r30557:cbeb54ec default
Show More
common.py
15 lines | 453 B | text/x-python | PythonLexer
import io
class OpCountingBytesIO(io.BytesIO):
def __init__(self, *args, **kwargs):
self._read_count = 0
self._write_count = 0
return super(OpCountingBytesIO, self).__init__(*args, **kwargs)
def read(self, *args):
self._read_count += 1
return super(OpCountingBytesIO, self).read(*args)
def write(self, data):
self._write_count += 1
return super(OpCountingBytesIO, self).write(data)