-
Notifications
You must be signed in to change notification settings - Fork 12
/
qa.cfg
140 lines (120 loc) · 4.09 KB
/
qa.cfg
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[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
pep517 = 0.12.0
pycodestyle = 2.7.0