diff --git a/wpiformat/test/test_config.py b/wpiformat/test/test_config.py index 966b05b9..cd8a9b96 100644 --- a/wpiformat/test/test_config.py +++ b/wpiformat/test/test_config.py @@ -5,14 +5,14 @@ def test_config(): config_file = Config(os.path.abspath(os.getcwd()), ".styleguide") - assert config_file.is_modifiable_file( - "." + os.sep + "wpiformat" + os.sep + "javaguidelink.png") + assert config_file.is_modifiable_file("." + os.sep + "wpiformat" + os.sep + + "javaguidelink.png") assert config_file.is_generated_file("." + os.sep + "wpiformat" + os.sep + "wpiformat" + os.sep + "cpplint.py") - assert not config_file.is_generated_file( - "." + os.sep + "wpiformat" + os.sep + "diff_cpplint.py") - assert not config_file.is_generated_file( - "." + os.sep + "wpiformat" + os.sep + "update_cpplint.py") - assert not config_file.is_modifiable_file( - "." + os.sep + "wpiformat" + os.sep + "license.txt") + assert not config_file.is_generated_file("." + os.sep + "wpiformat" + + os.sep + "diff_cpplint.py") + assert not config_file.is_generated_file("." + os.sep + "wpiformat" + + os.sep + "update_cpplint.py") + assert not config_file.is_modifiable_file("." + os.sep + "wpiformat" + + os.sep + "license.txt") diff --git a/wpiformat/test/test_licenseupdate.py b/wpiformat/test/test_licenseupdate.py index 1a753bc2..c5f4cfb1 100644 --- a/wpiformat/test/test_licenseupdate.py +++ b/wpiformat/test/test_licenseupdate.py @@ -133,11 +133,12 @@ def test_licenseupdate(): format(year) + os.linesep + os.linesep + file_appendix, True, True) # File excluded from license update isn't modified - test.add_input("./Excluded.h", - "/* Copyright (c) Company Name 2011-{}. */".format(year) + - os.linesep + os.linesep + file_appendix) - test.add_output("/* Copyright (c) Company Name 2011-{}. */".format(year) + - os.linesep + os.linesep + file_appendix, False, True) + test.add_input( + "./Excluded.h", "/* Copyright (c) Company Name 2011-{}. */".format(year) + + os.linesep + os.linesep + file_appendix) + test.add_output( + "/* Copyright (c) Company Name 2011-{}. */".format(year) + os.linesep + + os.linesep + file_appendix, False, True) # Ensure excluded files won't be processed config_file = Config(os.path.abspath(os.getcwd()), ".styleguide") diff --git a/wpiformat/wpiformat/__init__.py b/wpiformat/wpiformat/__init__.py index e8ab5b5e..e50334d7 100644 --- a/wpiformat/wpiformat/__init__.py +++ b/wpiformat/wpiformat/__init__.py @@ -317,8 +317,8 @@ def main(): ["git", "diff", "--name-only", "master"], stdout=subprocess.PIPE).stdout.split() for line in output_list: - changed_file_list.append( - root_path + os.sep + line.strip().decode("ascii")) + changed_file_list.append(root_path + os.sep + + line.strip().decode("ascii")) # Don't run tasks on modifiable or generated files work = [] diff --git a/wpiformat/wpiformat/cidentlist.py b/wpiformat/wpiformat/cidentlist.py index 82fe5535..70f2ff8b 100644 --- a/wpiformat/wpiformat/cidentlist.py +++ b/wpiformat/wpiformat/cidentlist.py @@ -43,9 +43,9 @@ def run_pipeline(self, config_file, name, lines): extern_str = "(?Pextern \"C(\+\+)?\")\s+(?P\{)?|" braces_str = "\{|\}|;|def\s+\w+|\w+\s+\w+\s*(?P\(\))" postfix_str = "(?=\s*(;|\{))" - token_regex = regex.compile( - preproc_str + comment_str + string_str + char_str + extern_str + - braces_str + postfix_str) + token_regex = regex.compile(preproc_str + comment_str + string_str + + char_str + extern_str + braces_str + + postfix_str) EXTRA_POP_OFFSET = 2