Skip to content

Commit

Permalink
Enable Flake8 E302 and E305
Browse files Browse the repository at this point in the history
These enforce double spacing before and after function and class
definitions.
  • Loading branch information
jbytheway committed Sep 24, 2020
1 parent ef3d21a commit 8e19644
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ignore =
# to be triaged to determine which we should fix and which we should leave
# permanently ignored
E265,
E302,
E305,
E501,
E713,
# W503 and W504 require line breaks after or before binary operators; you
Expand Down
2 changes: 2 additions & 0 deletions build-data/osx/dmgsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
application = defines.get('app', 'Cataclysm.app')
appname = os.path.basename(application)


def icon_from_app(app_path):
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
plist = biplist.readPlist(plist_path)
Expand All @@ -23,6 +24,7 @@ def icon_from_app(app_path):
icon_name = icon_root + icon_ext
return os.path.join(app_path, 'Contents', 'Resources', icon_name)


# .. Basics ....................................................................

# Uncomment to override the output filename
Expand Down
5 changes: 4 additions & 1 deletion lang/extract_json_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def gender_options(subject):
# SPECIALIZED EXTRACTION FUNCTIONS
#


def extract_achievement(a):
outfile = get_outfile(a["type"])
for f in ("name", "description"):
Expand Down Expand Up @@ -949,7 +950,8 @@ def extract_snippets(item):

#
# FUNCTIONS
##
#


def tlcomment(fs, string):
"Write the string to the file as a comment for translators."
Expand Down Expand Up @@ -1291,6 +1293,7 @@ def prepare_git_file_list():
if len(f) > 0:
git_files_list.add(os.path.normpath(f[:-1].decode('utf8')))


#
# EXTRACTION
#
Expand Down
3 changes: 3 additions & 0 deletions tools/fix-compilation-database.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
import shlex
import sys


def print_help():
print("\n"
"Fix compilation database used by run-clang-tidy.py on Windows.\n"
"\n"
" --help prints this message\n"
" --compile-db=<path> specify the path to compilation database. Defaults to build/compile_commands.json\n")


def main(argv):
compile_db = "build/compile_commands.json"

Expand Down Expand Up @@ -60,5 +62,6 @@ def main(argv):
with open(compile_db, 'w', encoding="utf-8") as fs:
json.dump(data, fs, indent=2)


if __name__ == "__main__":
main(sys.argv[1:])
1 change: 1 addition & 0 deletions tools/gfx_tools/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def finalize_merges(self, merge_pngs):
out_image = Vips.Image.arrayjoin(merge_pngs, across=16)
out_image.pngsave(self.ts_path)


if __name__ == '__main__':
args = argparse.ArgumentParser(description="Merge all the individal tile_entries and pngs in a tileset's directory into a tile_config.json and 1 or more tilesheet pngs.")
args.add_argument("tileset_dir", action="store",
Expand Down
1 change: 1 addition & 0 deletions tools/gfx_tools/png_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def convert_tile_entry_file(file_path, old_name, new_name):
new_tile_data = new_tile_data[0]
write_to_json(file_path, new_tile_data)


if __name__ == '__main__':
args = argparse.ArgumentParser(description="Rename a png file, its associated tile_entry.json, and update all other tile_entry.json in the tileset dir to reflect the new name.")
args.add_argument("tileset_dir", action="store",
Expand Down
1 change: 1 addition & 0 deletions tools/vehicle_reformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

LINE_LIMIT = 58


def get_data(argsDict, resource_name):
resource = []
resource_sources = argsDict.get(resource_name, [])
Expand Down
1 change: 1 addition & 0 deletions utilities/make_iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
# Indexed by (tile_num, initial_rotation) tuple, True if iso-converted
converted_tile_ids = dict()


def iso_ize(tile_num, new_tile_num=-1, initial_rotation=0, override=False):
if override or (tile_num, initial_rotation) not in converted_tile_ids:
print(" iso-izing " + str(tile_num))
Expand Down

0 comments on commit 8e19644

Please sign in to comment.