Skip to content

Commit

Permalink
Merge bc815c0 into b90f06d
Browse files Browse the repository at this point in the history
  • Loading branch information
migurski committed Jul 29, 2020
2 parents b90f06d + bc815c0 commit 8a53cc5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ script:
- sed -e "/idle_in_transaction_session_timeout/d" -e 's/ IMMUTABLE / /' -e "/^--/d" db/structure.sql > db/structure.actual
- diff -uw db/structure.expected db/structure.actual
- bundle exec rake test:db
# Locale files (in config/locales) are updated via Translatewiki.
# Look for other authors and fail this test if any are found.
- config/locales/check-authors.sh $TRAVIS_PULL_REQUEST $TRAVIS_COMMIT_RANGE
37 changes: 37 additions & 0 deletions config/locales/check-authors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh -e
#
# Note from CONTRIBUTING.md: If you make a change that involve the locale
# files (in config/locales) then please only submit changes to the en.yml
# file. The other files are updated via Translatewiki and should not be
# included in your pull request.
#
cd `dirname $0`

# Name of current pull request, otherwise "false"
PULL_REQUEST=$1

# Look at just a specific commit range, expressed as "SHA1...SHA2"
COMMIT_RANGE=$2

# Assume everything will be fine
STATUS=0

# Check nothing if we're not in a PR
if [ "$PULL_REQUEST" = "false" ]; then
echo "Not checking locale authorship outside a pull request"
exit $STATUS;
fi

for FILE in *.yml; do
# Don't check authorship of en.yml
if [ $FILE != en.yml ]; then
HUMAN_AUTHOR=`git log --format='%ae' $COMMIT_RANGE -- $FILE | grep -v @translatewiki.net | head -n1`
if [ $HUMAN_AUTHOR ]; then
# Mark for failure if changes were made by anyone other than translatewiki.net
echo "Unexpectedly found ${HUMAN_AUTHOR} in ${FILE} (see CONTRIBUTING.md, i18n)"
STATUS=1
fi
fi
done

exit $STATUS

0 comments on commit 8a53cc5

Please sign in to comment.