[buildout] package-min-coverage = 80 parts += code-analysis i18ndude [code-analysis] recipe = plone.recipe.codeanalysis directory = src pre-commit-hook = True flake8 = True flake8-ignore = E501 return-status-codes = True [createcoverage] recipe = zc.recipe.egg eggs = createcoverage [i18ndude] recipe = zc.recipe.egg eggs = i18ndude [node] recipe = gp.recipe.node npms = csslint jshint scripts = csslint jshint [coverage-sh] recipe = collective.recipe.template output = ${buildout:directory}/bin/coverage.sh mode = 755 input = inline: #! /bin/sh # checks for report created with createcoverage and evaluate the result DEFAULT=${buildout:package-min-coverage} REPORT="htmlcov/index.html" if [ "$#" -eq 1 ] && [ $1 -ge 0 ] && [ $1 -le 100 ]; then MINIMUM=$1 else echo "Invalid value for minimum coverage; using default: $DEFAULT%" MINIMUM=$DEFAULT fi if [ ! -f "$REPORT" ]; then if [ "$CI" ]; then # Use output dir to prevent opening a browser. bin/createcoverage --output-dir=htmlcov else bin/createcoverage fi fi if [ ! -f "$REPORT" ]; then echo "createcoverage went wrong: $REPORT does not exist" exit 1 fi # find first percentage value in file (module test coverage) and return it COVERAGE=`grep "[0-9]\{1,3\}[%]" $REPORT -m 1 -o | grep "[0-9]\{1,3\}" -o` if [ $COVERAGE -lt $MINIMUM ]; then echo "Insufficient test coverage: $COVERAGE% (minimum acceptable is $MINIMUM%)" exit 1 else echo "Current test coverage: $COVERAGE%" exit 0 fi [rebuild_i18n-sh] recipe = collective.recipe.template output = ${buildout:directory}/bin/rebuild_i18n.sh mode = 755 input = inline: #! /bin/sh -e # see http://maurits.vanrees.org/weblog/archive/2010/10/i18n-plone-4 for more information I18NDOMAIN="${buildout:package-name}" if [ -z "$I18NDOMAIN" ]; then echo "You didn't set buildout:package-name variable in your buildout configuration." echo "Please add 'package-name = yourdomain.package' to [buildout] section and re-run buildout to use this script." exit 1 fi # find the locales dir LOCALES=`find . -type d | grep ${buildout:package-name} | grep -m 1 "locales"` SOURCE=`dirname $LOCALES`; merge="" if [ -f $LOCALES/manual.pot ]; then merge="--merge $LOCALES/manual.pot" fi bin/i18ndude rebuild-pot --pot $LOCALES/$I18NDOMAIN.pot $merge --create $I18NDOMAIN $SOURCE # synchronise translations for package's domain for po in $LOCALES/*/LC_MESSAGES/$I18NDOMAIN.po; do bin/i18ndude sync --pot $LOCALES/$I18NDOMAIN.pot $po done merge_plone="" if [ -f $LOCALES/plone-manual.pot ]; then merge_plone="--merge $LOCALES/plone-manual.pot" fi # rebuild pot file for Plone's domain # plone.pot is not created if you don't have entries with "plone" domain. bin/i18ndude rebuild-pot --pot $LOCALES/plone.pot --create plone $merge_plone $SOURCE/configure.zcml $SOURCE/profiles/default # - If you don't have entries with "plone" domain, "plone.pot" is not # created; # - If you have "plone-manual.pot" but don't have "plone.pot", the i18ndude # sync command needs to be done with "plone-manual.pot"; # - If you have entries in the "plone" domain, i18ndude merged # "plone-manual.pot" with "plone.pot" with the "rebuild-pot" command above. # The i18ndude sync needs to be done with "plone.pot". pot_file=$LOCALES/plone.pot if [ ! -f $LOCALES/plone.pot ] && [ -f $LOCALES/plone-manual.pot ]; then pot_file=$LOCALES/plone-manual.pot fi if [ -f $pot_file ]; then # synchronise translations for Plone's domain for po in $LOCALES/*/LC_MESSAGES/plone.po; do bin/i18ndude sync --pot $pot_file $po done fi [versions:python27] flake8 = 3.9.2 flake8-debugger = 3.2.1 flake8-deprecated= 1.3 flake8-isort = 4.0.0 flake8-pep3101 = 1.3.0 flake8-plone-api = 1.4 flake8-plone-hasattr = 0.2 flake8-print = 3.1.4 flake8-quotes = 3.3.0 isort = <5.0.0 pycodestyle = 2.7.0