Skip to content

Commit

Permalink
Allow skipping of compilemessages for transifex PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Jun 5, 2020
1 parent dcad88e commit 63caebe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ script:
- set -e

# test that everything is well formatted, no missing migrations etc
- ./code_check.py --debug
- ./code_check.py --debug $([[ "$TRAVIS_BRANCH" =~ "translations_django-po" ]] && echo "--skip-compilemessages")

# run our Javascript tests
- node_modules/karma/bin/karma start karma.conf.coffee --single-run --browsers PhantomJS
Expand Down
11 changes: 9 additions & 2 deletions code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import polib

parser = argparse.ArgumentParser(description="Code checks")
parser.add_argument("--skip-compilemessages", action="store_true")
parser.add_argument("--debug", action="store_true")
args = parser.parse_args()

Expand Down Expand Up @@ -66,16 +67,22 @@ def get_current_msgids():

status("Make any missing migrations")
cmd("python manage.py makemigrations")

status("Running black")
cmd("black --line-length=119 --target-version=py36 temba")

status("Running flake8")
cmd("flake8")

status("Running isort")
cmd("isort -rc temba")

status("Updating locale PO files")
update_po_files()
status("Recompiling locale MO files")
cmd("python manage.py compilemessages")

if not args.skip_compilemessages:
status("Recompiling locale MO files")
cmd("python manage.py compilemessages")

# if any code changes were made, exit with error
if cmd("git diff temba locale"):
Expand Down

0 comments on commit 63caebe

Please sign in to comment.