Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Héctor Velarde
file 81 lines (66 sloc) 2.044 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
[buildout]
package-min-coverage = 80

parts +=
    code-analysis

# XXX: these options are deprecated; use plone.recipe.codeanalysis instead
package-src =
package-pep8-ignores = E501

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = .
pre-commit-hook = True
flake8 = True
flake8-ignore = E501
return-status-codes = True

[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage

[flake8]
# XXX: use of this part is deprecated; use plone.recipe.codeanalysis instead
recipe = zc.recipe.egg
eggs = flake8

[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
        bin/createcoverage run bin/test
    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

[python-validation-sh]
# XXX: use of this part is deprecated; use plone.recipe.codeanalysis instead
recipe = collective.recipe.template
output = ${buildout:directory}/bin/python-validation.sh
mode = 755
input = inline:
    #! /bin/sh
    src=${buildout:package-src}
    echo Validating Python files
    bin/flake8 --ignore=${buildout:package-pep8-ignores} $src

[zptlint]
# XXX: use of this part is deprecated; use plone.recipe.codeanalysis instead
recipe = zc.recipe.egg
eggs = zptlint
Something went wrong with that request. Please try again.