Module Expr Str Import alias Import alias Import alias identifier FunctionDef arguments args defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str keyword AttributeLoad NameLoad attr attr Return Call AttributeLoad NameLoad attr Str handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str keyword AttributeLoad NameLoad attr attr Return Call AttributeLoad NameLoad attr Str handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body Return SubscriptLoad NameLoad Slice Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assert Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str NameLoad If NameLoad body Return Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str Str Str attr Str attr AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str Str Str Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMod Str NameLoad keyword TupleLoad Str Str Return Call NameLoad GeneratorExp TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str Str Str Str NameLoad attr Str attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str keyword TupleLoad Str Str Return Call NameLoad GeneratorExp TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad BinOpAdd NameLoad Str comprehension TupleStore NameStore NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Return ListLoad If CompareNotIn NameLoad TupleLoad Str Str Str body Return NameLoad If CompareIs NameLoad NameLoad body Assign NameStore BinOpMult Str Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd NameLoad Str keyword TupleLoad Str Return Call NameLoad Call NameLoad NameLoad NameLoad decorator_list
N/A N/A Functions to get information from git. N/A os.path N/A subprocess N/A gitlint.utils utils repository_root N/A N/A N/A N/A N/A Returns the root of the repository as an absolute path. N/A N/A N/A root N/A N/A N/A N/A subprocess check_output N/A git rev-parse --show-toplevel stderr N/A subprocess STDOUT strip N/A N/A N/A root decode utf-8 N/A N/A N/A N/A subprocess CalledProcessError N/A N/A None N/A last_commit N/A N/A N/A N/A N/A Returns the SHA1 of the last commit. N/A N/A N/A root N/A N/A N/A N/A subprocess check_output N/A git rev-parse HEAD stderr N/A subprocess STDOUT strip N/A N/A N/A root decode utf-8 N/A N/A N/A N/A subprocess CalledProcessError N/A N/A None N/A _remove_filename_quotes N/A N/A filename N/A N/A N/A Removes the quotes from a filename returned by git status. N/A N/A N/A N/A filename startswith " N/A N/A filename endswith " N/A N/A N/A filename N/A 1 -1 N/A filename N/A modified_files N/A N/A root tracked_only commit N/A False None N/A N/A Returns a list of files that has been modified since the last commit.

    Args:
      root: the root of the repository, it has to be an absolute path.
      tracked_only: exclude untracked files when True.
      commit: SHA1 of the commit. If None, it will get the modified files in the
        working copy.

    Returns: a dictionary with the modified files as keys, and additional
      information as value. In this case it adds the status returned by
      git status.
     N/A N/A N/A N/A os path isabs root N/A Root has to be absolute, got: %s root N/A commit N/A N/A N/A _modified_files_with_commit root commit N/A status_lines N/A N/A N/A N/A N/A N/A subprocess check_output N/A git status --porcelain --untracked-files=all --ignore-submodules=all decode utf-8 split N/A os linesep N/A modes N/A M   M A  AM MM N/A N/A tracked_only N/A N/A N/A N/A modes append \?\? N/A modes_str N/A N/A | join modes N/A modified_file_status N/A N/A utils filter_lines status_lines N/A (?P<mode>%s) (?P<filename>.+) modes_str groups N/A filename mode N/A N/A dict N/A N/A N/A N/A N/A os path join root N/A _remove_filename_quotes filename mode N/A N/A filename mode modified_file_status N/A _modified_files_with_commit N/A N/A root commit N/A N/A N/A status_lines N/A N/A N/A N/A N/A N/A subprocess check_output N/A git diff-tree -r --root --no-commit-id --name-status commit decode utf-8 split N/A os linesep N/A modified_file_status N/A N/A utils filter_lines status_lines (?P<mode>A|M)\s(?P<filename>.+) groups N/A filename mode N/A N/A dict N/A N/A N/A N/A N/A os path join root N/A _remove_filename_quotes filename N/A mode N/A N/A filename mode modified_file_status N/A modified_lines N/A N/A filename extra_data commit N/A None N/A N/A Returns the lines that have been modifed for this file.

    Args:
      filename: the file to check.
      extra_data: is the extra_data returned by modified_files. Additionally, a
        value of None means that the file was not modified.
      commit: the complete sha1 (40 chars) of the commit. Note that specifying
        this value will only work (100%) when commit == last_commit (with
        respect to the currently checked out revision), otherwise, we could miss
        some lines.

    Returns: a list of lines that were modified, or None in case all lines are
      new.
     N/A N/A extra_data None N/A N/A N/A N/A N/A extra_data N/A M   M MM N/A N/A None N/A N/A commit None N/A N/A commit N/A 0 40 N/A commit N/A N/A commit encode utf-8 N/A blame_lines N/A N/A N/A N/A subprocess check_output N/A git blame --porcelain filename split N/A N/A N/A os linesep encode utf-8 N/A modified_line_numbers N/A N/A utils filter_lines blame_lines N/A commit  (?P<line>\d+) (\d+) groups N/A line N/A N/A list N/A map int modified_line_numbers N/A