Commit 54b6fa03 authored by Charles Ferguson's avatar Charles Ferguson
Browse files

Update perl and python to use the {language} specification.

The '{language}' specification meanst hat files that don't have an
extension can still be processed by the tools. This lets us name
files without extensions in order to make them implementation
agnostic, and still have them prcessed by the ci system.
parent 753e8b8d
......@@ -32,7 +32,7 @@ function perl_active() {
if [[ "$action" == 'test' || "$action" == 'coverage' ]] ; then
files="$(config -e test_perl_files '*-test.pl')"
elif [[ "$action" == 'lint' ]] ; then
files="$(config -e lint_perl_files '*.pl *.pm')"
files="$(config -e lint_perl_files '{perl}')"
else
# Unrecognised type
return 1
......@@ -169,18 +169,19 @@ function perl_run_lint() {
local file
local message="Compiling Perl files"
for file in $(config -e lint_perl_files '*.pl *.pm') ; do
for file in $(config -e lint_perl_files '{perl}') ; do
if ! perl -c "$file" 2>&1 | output_filter "$message" ; then
lint_failed=$(( lint_failed+1 ))
else
lint_passed=$(( lint_passed+1 ))
fi
message="+"
lint_total=$(( lint_total+1 ))
done
if ! perlcritic --profile "${root}/perlcriticrc" \
--color \
$(config -e lint_perl_files '*.pl *.pm') \
$(config -e lint_perl_files '{perl}') \
2>&1 | output_filter "Linting Perl files"; then
lint_failed=$(( lint_failed+1 ))
else
......
......@@ -72,12 +72,12 @@ function python_active() {
if [[ "$action" == 'test' || "$action" == 'coverage' ]] ; then
files="$(config -e test_python_files '*_test.py')"
elif [[ "$action" == 'lint' ]] ; then
files="$(config -e lint_python_files '*.py')"
files="$(config -e lint_python_files '{python}')"
elif [[ "$action" == 'docs' ]] ; then
files="$(config -e docs_python_files '*.py')"
files="$(config -e docs_python_files '{python}')"
elif [[ "$action" == 'clean' ]] ; then
files="$(config -e docs_python_files '*.py')"
files="$files $(config -e lint_python_files '*.py') "
files="$(config -e docs_python_files '{python}')"
files="$files $(config -e lint_python_files '{python}') "
files="$files $(config -e test_python_files '*_test.py')"
else
# Unrecognised type
......@@ -215,7 +215,7 @@ function python_run_coverage() {
function python_run_lint() {
if ! pylint --reports no \
--rcfile "${root}/pylintrc" \
$(config -e lint_python_files '*.py') 2>&1 \
$(config -e lint_python_files '{python}') 2>&1 \
| output_filter "Linting Python files" ; then
lint_failed=$(( lint_failed+1 ))
else
......@@ -227,7 +227,7 @@ function python_run_lint() {
function python_run_docs() {
if ! "${scripts}/python-build-docs" --initial-tag "$(config version_git_tag none)" \
--major-version "$(config version 1.0)" \
--paths "$(config docs_python_files '*.py')" \
--paths "$(config docs_python_files '{python}')" \
--output-dir "${artifact_dir}/python-docs" \
| output_filter ; then
docs_failed=$(( docs_failed+1 ))
......@@ -243,7 +243,7 @@ function python_run_clean() {
local thisdir
files="$(config -e docs_python_files '*.py')"
files="$files $(config -e lint_python_files '*.py') "
files="$files $(config -e lint_python_files '{python}') "
files="$files $(config -e test_python_files '*_test.py')"
lastdir=''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment