Files
galaxy/.ci/check_controller.sh
John Chilton ce6cd03f6c Enforce metrics related to moving toward modern client infrastructure.
Having a CI enforced blacklist and then a whitelist of files failing to meet style guidelines (as well as expanding list of rules enforced) may have helped create incentive to rework Galaxy toward a more compliant and uniform Python styling.

We briefly discussed the possibility of doing this with other team code base objectives on a conference call - in particular to help the transition toward replacing all of the web controllers with API controllers and eliminating the use of Python mako files for rendering web content and replacing it with client side templates.

To do this I have created two rough metrics - the number of lines of web controller code in the Galaxy app and the number of mako files in the templates directory. The hope is that people feel ... compelled to lower these numbers. While these metrics are admittedly rough, they do also encourage de-duplication of mako templates and transition of API code into managers (in addition to elimination of functions) both of these secondary incentives are also good things and should be project objectives.
2015-12-10 14:47:35 +00:00

7 lines
227 B
Bash

#!/bin/bash
set -e
MAX_LINE_COUNT=19900
project_dir=`dirname $0`/..
cd $project_dir
bash -c "[ `find lib/galaxy/webapps/galaxy/controllers/ -name '*.py' | xargs wc -l | tail -n 1 | awk '{ printf \$1; }'` -lt $MAX_LINE_COUNT ]"