Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias ClassDef bases NameLoad body FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad keyword NameLoad keyword NameLoad Return TupleLoad NameLoad Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Return With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Pass Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpAdd Str NameLoad With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad SubscriptLoad NameLoad Slice Num If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return BinOpMod Str NameLoad With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign AttributeStore NameLoad attr NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num NameLoad BinOpMod BinOpAdd Str Str TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Slice Num Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad decorator_list NameLoad decorator_list Expr Call AttributeLoad NameLoad attr FunctionDef arguments args defaults vararg kwarg body Expr Str Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Print AttributeLoad NameLoad attr Raise decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad ListLoad Str Str With Call NameLoad Str Str body Pass Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad ListLoad Str Str Str NameLoad Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad ListLoad Str Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryFinally body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call NameLoad ListLoad Str Str Str NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad With Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str body Pass Expr Call AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body FunctionDef arguments args defaults body Expr Str Expr Call NameLoad ListLoad Str Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Str Expr Call NameLoad ListLoad Str Str Str Str Str NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad ListLoad Str Str NameLoad decorator_list NameLoad decorator_list
N/A N/A io N/A os N/A shutil N/A subprocess N/A tempfile N/A unittest N/A gitlint E2EBase N/A object N/A lint N/A N/A N/A N/A N/A Returns the response and ouput of git-lint. N/A out N/A N/A io StringIO N/A response N/A N/A gitlint main N/A stdout out stderr out N/A N/A response N/A N/A out getvalue N/A staticmethod setUpClass N/A N/A cls N/A N/A N/A N/A cls original_cwd N/A N/A os getcwd N/A N/A cls temp_directory N/A N/A tempfile mkdtemp prefix gitlint N/A N/A N/A os chdir N/A cls temp_directory N/A N/A N/A cls init_repo N/A classmethod setUp N/A N/A self N/A N/A N/A N/A self filename_repo None N/A tearDownClass N/A N/A cls N/A N/A N/A N/A N/A shutil rmtree N/A cls temp_directory True N/A N/A N/A os chdir N/A cls original_cwd N/A classmethod tearDown N/A N/A self N/A N/A N/A N/A N/A self filename_repo None N/A N/A N/A N/A open N/A self filename_repo w f N/A N/A N/A N/A N/A self add N/A self filename_repo N/A N/A N/A self commit Commit teardown N/A test_extension_not_defined N/A N/A self N/A N/A N/A extension .areallyfakeextension N/A filename N/A N/A N/A os path join N/A self temp_directory N/A filename extension N/A N/A open filename w f N/A N/A N/A N/A f write Foo N/A N/A N/A self add filename N/A N/A response output N/A N/A self lint N/A N/A N/A self assertEquals 0 response N/A Response %s != 0.
Output:
%s N/A response output N/A N/A N/A self assertIn N/A N/A N/A os path relpath filename output N/A N/A N/A self assertIn SKIPPED output N/A N/A N/A self assertIn extension output N/A get_linter_output N/A N/A self linter_name file_path N/A N/A N/A cache_path N/A N/A N/A os path expanduser ~/.git-lint/cache N/A filename N/A N/A N/A os path join cache_path linter_name N/A file_path N/A 1 N/A N/A N/A N/A N/A os path exists filename N/A N/A N/A No git-lint cache found for %s filename N/A N/A open filename f N/A N/A output N/A N/A f read N/A output N/A assert_linter_works N/A N/A self linter_name extension N/A N/A N/A Checks that the given linter works well for all the extensions.

        It requires that 3 files are defined:
        - <linter>/original.<extension>: A file with errors
        - <linter>/error.<extension>: New errors are introduced.
        - <linter>/nonewerror.<extension>: A line was modified/added from the
          last file, but no new errors are introduced.
         N/A data_dirname N/A N/A N/A os path join N/A N/A N/A os path dirname N/A N/A N/A os path realpath __file__ data N/A N/A self filename_repo filename_repo N/A N/A N/A os path join N/A self temp_directory N/A %s%s N/A linter_name extension N/A filename_original N/A N/A N/A os path join data_dirname linter_name N/A original%s extension N/A filename_error N/A N/A N/A os path join data_dirname linter_name N/A error%s extension N/A filename_nonewerror N/A N/A N/A os path join data_dirname linter_name N/A nonewerror%s extension N/A N/A N/A self assertTrue N/A N/A N/A os path exists filename_original N/A You must define file "%s" filename_original N/A N/A N/A self assertTrue N/A N/A N/A os path exists filename_error N/A You must define file "%s" filename_error N/A N/A N/A self assertTrue N/A N/A N/A os path exists filename_nonewerror N/A You must define file "%s" filename_nonewerror N/A N/A N/A shutil copy filename_original filename_repo N/A N/A N/A self add filename_repo N/A N/A N/A self commit Commit 1 N/A N/A N/A shutil copy filename_error filename_repo N/A N/A response output N/A N/A self lint N/A N/A N/A self assertNotEquals 0 response N/A N/A Git lint for file %s should have failed.
 git-lint output: %s 
Linter Output:
%s N/A filename_error output N/A N/A self get_linter_output linter_name filename_repo N/A N/A N/A self add filename_repo N/A N/A N/A self commit Commit 2 N/A N/A N/A shutil copy filename_nonewerror filename_repo N/A N/A response output N/A N/A self lint N/A N/A N/A self assertEquals 0 response N/A Git lint for file %s should have not failed. 
Output:
%s N/A filename_nonewerror output N/A N/A N/A self add filename_repo N/A N/A N/A self commit Commit 3 N/A add_linter_check N/A N/A cls linter_name extension N/A N/A N/A Adds a test for the given linter and extension. test_linter N/A N/A self N/A N/A N/A N/A N/A self assert_linter_works linter_name extension N/A N/A N/A test_linter __name__ N/A test_linter_%s_with_%s N/A linter_name N/A extension N/A 1 N/A N/A setattr cls N/A test_linter __name__ test_linter N/A classmethod add_linter_checks N/A N/A cls N/A N/A N/A Add a test for each defined linter and extension. N/A N/A extension linter_list N/A N/A N/A N/A gitlint get_config None items N/A N/A linter linter_list N/A N/A N/A N/A cls add_linter_check N/A N/A linter args N/A 0 extension N/A classmethod N/A N/A N/A N/A E2EBase add_linter_checks execute N/A N/A N/A args kwargs N/A N/A Executes a command and prints the output in case of error. N/A N/A kwargs N/A stderr N/A subprocess STDOUT N/A N/A N/A N/A N/A subprocess check_output args kwargs N/A N/A N/A N/A subprocess CalledProcessError N/A error N/A N/A N/A error output N/A N/A TestGitE2E N/A E2EBase N/A unittest TestCase N/A init_repo N/A N/A cls N/A N/A N/A Initializes a git repo. N/A N/A execute N/A git init N/A N/A open README w N/A N/A N/A N/A N/A cls add README N/A N/A N/A cls commit Initial commit N/A classmethod commit N/A N/A message N/A N/A N/A Commit a changeset to the repo.

        The option --no-verify is used as a pre-commit check could be globally
        installed.
         N/A N/A execute N/A git commit -m message --no-verify N/A staticmethod add N/A N/A filename N/A N/A N/A Add a file to the repo. N/A N/A execute N/A git add filename N/A staticmethod test_submodules N/A N/A self N/A N/A N/A Check that repositories with submodules can be handled.

        Checks Issue #62:
          modifying files in a submodule produces an error as it is not possible
          to run git blame on a submodule.
         N/A N/A N/A original_cwd N/A N/A os getcwd N/A submodule_dir N/A N/A tempfile mkdtemp prefix gitlint N/A N/A N/A os chdir submodule_dir N/A N/A N/A self init_repo N/A repo_dir N/A N/A tempfile mkdtemp prefix gitlint N/A N/A N/A os chdir repo_dir N/A N/A N/A self init_repo N/A N/A execute N/A git submodule add submodule_dir N/A N/A N/A self commit Added submodule N/A submodule_name N/A N/A N/A os path basename submodule_dir N/A N/A open N/A N/A N/A os path join submodule_name LICENSE w N/A N/A N/A N/A N/A self lint N/A N/A N/A N/A os chdir original_cwd N/A submodule_dir N/A N/A N/A N/A shutil rmtree submodule_dir N/A repo_dir N/A N/A N/A N/A shutil rmtree repo_dir N/A N/A TestHgE2E N/A E2EBase N/A unittest TestCase N/A init_repo N/A N/A N/A N/A N/A Initializes a mercurial repo. N/A N/A execute N/A hg init N/A staticmethod commit N/A N/A message N/A N/A N/A Commit a changeset to the repo.

        The environment variable NO_VERIFY=1 is required as a git-lint could be
        installed as pre-commit hook.
         N/A environ N/A dict N/A os environ N/A N/A environ N/A NO_VERIFY 1 N/A N/A execute N/A hg commit -u onone -m message env environ N/A staticmethod add N/A N/A filename N/A N/A N/A Add a file to the repo. N/A N/A execute N/A hg add filename N/A staticmethod N/A