Annotate tools/minify-js.

This commit is contained in:
Eklavya Sharma 2016-07-24 21:58:02 +05:30
parent 1e0a971178
commit 61ffd835e1
2 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,8 @@ import optparse
import sys import sys
import six import six
from typing import Optional, Set
parser = optparse.OptionParser() parser = optparse.OptionParser()
parser.add_option('--prev-deploy', nargs=1, metavar='DIR', parser.add_option('--prev-deploy', nargs=1, metavar='DIR',
help='A previous deploy from which to reuse files if possible') help='A previous deploy from which to reuse files if possible')
@ -34,6 +36,7 @@ subprocess.check_call(['tools/compile-handlebars-templates'])
subprocess.check_call(['tools/webpack']) subprocess.check_call(['tools/webpack'])
def get_changed_source_files(other_checkout): def get_changed_source_files(other_checkout):
# type: (Optional[str]) -> Optional[Set[str]]
""" Get list of changed static files since other_checkout. """ Get list of changed static files since other_checkout.
If git fails to return a reasonable looking list, this returns None, If git fails to return a reasonable looking list, this returns None,
in which case it should be assumed no files can be reused from in which case it should be assumed no files can be reused from
@ -55,7 +58,7 @@ def get_changed_source_files(other_checkout):
% (other_checkout,)) % (other_checkout,))
return None return None
changed = set() changed = set() # type: Set[str]
for filename in git_diff.split('\n'): for filename in git_diff.split('\n'):
if not filename.startswith(STATIC_PATH): if not filename.startswith(STATIC_PATH):
continue # Ignore non-static files. continue # Ignore non-static files.
@ -68,7 +71,7 @@ def get_changed_source_files(other_checkout):
return changed return changed
changed_files = set() changed_files = set() # type: Set[str]
if prev_deploy: if prev_deploy:
changed_files = get_changed_source_files(prev_deploy) changed_files = get_changed_source_files(prev_deploy)
if changed_files is None: if changed_files is None:

View File

@ -62,7 +62,6 @@ bots/githook-post-receive
tools/deprecated/inject-messages/inject-messages tools/deprecated/inject-messages/inject-messages
tools/deprecated/review tools/deprecated/review
tools/get-handlebar-vars tools/get-handlebar-vars
tools/minify-js
tools/update-deployment tools/update-deployment
tools/zulip-export/zulip-export tools/zulip-export/zulip-export
""".split() """.split()