Beispiel #1
0
def get_change_file_list(base):
    diff = [GitExe(), 'diff', '--name-only', base]
    output = GetCommandOutput(diff)
    changes = [line.strip() for line in output.strip().split('\n')]
    pyfiles = []
    others = []
    # pylint: disable=W0612
    for change in changes:
        root, ext = os.path.splitext(change)
        if ext.lower() in PYTHON_EXTS:
            pyfiles.append(change)
        else:
            others.append(change)
    return pyfiles, others
Beispiel #2
0
def get_change_file_list(base):
  diff = [GitExe(), 'diff', '--name-only', base]
  output = GetCommandOutput(diff)
  changes = [line.strip() for line in output.strip().split('\n')]
  pyfiles = []
  others = []
  # pylint: disable=W0612
  for change in changes:
    root, ext = os.path.splitext(change)
    if ext.lower() in PYTHON_EXTS:
      pyfiles.append(change)
    else:
      others.append(change)
  return pyfiles, others
def get_change_file_list(base):
  diff = [GitExe(), 'diff', '--name-only', base]
  output = GetCommandOutput(diff)
  changes = [line.strip() for line in output.strip().split('\n')]
  pyfiles = []
  jsfiles = []
  others = []
  common_regex = re.compile('common')
  # pylint: disable=W0612
  for change in changes:
    root, ext = os.path.splitext(change)
    if common_regex.match(os.path.dirname(change)):
      print 'Skip common dir'
      continue
    if ext.lower() in PYTHON_EXTS:
      pyfiles.append(change)
    elif ext.lower() in JS_EXTS:
      jsfiles.append(change)
    else:
      others.append(change)
  return pyfiles, jsfiles, others
def get_change_file_list(base):
    diff = [GitExe(), 'diff', '--name-only', base]
    output = GetCommandOutput(diff)
    changes = [line.strip() for line in output.strip().split('\n')]
    pyfiles = []
    jsfiles = []
    others = []
    common_regex = re.compile('common')
    # pylint: disable=W0612
    for change in changes:
        root, ext = os.path.splitext(change)
        if common_regex.match(os.path.dirname(change)):
            print 'Skip common dir'
            continue
        if ext.lower() in PYTHON_EXTS:
            pyfiles.append(change)
        elif ext.lower() in JS_EXTS:
            jsfiles.append(change)
        else:
            others.append(change)
    return pyfiles, jsfiles, others
def get_change_file_list(base, ignore_array):
    diff = [GitExe(), "diff", "--name-only", base]
    output = GetCommandOutput(diff)
    changes = [line.strip() for line in output.strip().split("\n")]
    pyfiles = []
    jsfiles = []
    others = []
    common_regex = re.compile("common")
    # pylint: disable=W0612
    for change in changes:
        if change in ignore_array:
            print "Linting for %s ignored!" % change
            continue
        root, ext = os.path.splitext(change)
        if common_regex.match(os.path.dirname(change)):
            print "Skip common dir"
            continue
        if ext.lower() in PYTHON_EXTS:
            pyfiles.append(change)
        elif ext.lower() in JS_EXTS:
            jsfiles.append(change)
        else:
            others.append(change)
    return pyfiles, jsfiles, others