Skip to content

Commit

Permalink
Ran new version of yapf on wpiformat source
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed May 16, 2018
1 parent 2e280cb commit a714475
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions wpiformat/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
11 changes: 6 additions & 5 deletions wpiformat/test/test_licenseupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions wpiformat/wpiformat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
6 changes: 3 additions & 3 deletions wpiformat/wpiformat/cidentlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def run_pipeline(self, config_file, name, lines):
extern_str = "(?P<ext_decl>extern \"C(\+\+)?\")\s+(?P<ext_brace>\{)?|"
braces_str = "\{|\}|;|def\s+\w+|\w+\s+\w+\s*(?P<paren>\(\))"
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

Expand Down

0 comments on commit a714475

Please sign in to comment.