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() { ...@@ -32,7 +32,7 @@ function perl_active() {
if [[ "$action" == 'test' || "$action" == 'coverage' ]] ; then if [[ "$action" == 'test' || "$action" == 'coverage' ]] ; then
files="$(config -e test_perl_files '*-test.pl')" files="$(config -e test_perl_files '*-test.pl')"
elif [[ "$action" == 'lint' ]] ; then elif [[ "$action" == 'lint' ]] ; then
files="$(config -e lint_perl_files '*.pl *.pm')" files="$(config -e lint_perl_files '{perl}')"
else else
# Unrecognised type # Unrecognised type
return 1 return 1
...@@ -169,18 +169,19 @@ function perl_run_lint() { ...@@ -169,18 +169,19 @@ function perl_run_lint() {
local file local file
local message="Compiling Perl files" 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 if ! perl -c "$file" 2>&1 | output_filter "$message" ; then
lint_failed=$(( lint_failed+1 )) lint_failed=$(( lint_failed+1 ))
else else
lint_passed=$(( lint_passed+1 )) lint_passed=$(( lint_passed+1 ))
fi fi
message="+" message="+"
lint_total=$(( lint_total+1 ))
done done
if ! perlcritic --profile "${root}/perlcriticrc" \ if ! perlcritic --profile "${root}/perlcriticrc" \
--color \ --color \
$(config -e lint_perl_files '*.pl *.pm') \ $(config -e lint_perl_files '{perl}') \
2>&1 | output_filter "Linting Perl files"; then 2>&1 | output_filter "Linting Perl files"; then
lint_failed=$(( lint_failed+1 )) lint_failed=$(( lint_failed+1 ))
else else
......
...@@ -72,12 +72,12 @@ function python_active() { ...@@ -72,12 +72,12 @@ function python_active() {
if [[ "$action" == 'test' || "$action" == 'coverage' ]] ; then if [[ "$action" == 'test' || "$action" == 'coverage' ]] ; then
files="$(config -e test_python_files '*_test.py')" files="$(config -e test_python_files '*_test.py')"
elif [[ "$action" == 'lint' ]] ; then elif [[ "$action" == 'lint' ]] ; then
files="$(config -e lint_python_files '*.py')" files="$(config -e lint_python_files '{python}')"
elif [[ "$action" == 'docs' ]] ; then elif [[ "$action" == 'docs' ]] ; then
files="$(config -e docs_python_files '*.py')" files="$(config -e docs_python_files '{python}')"
elif [[ "$action" == 'clean' ]] ; then elif [[ "$action" == 'clean' ]] ; then
files="$(config -e docs_python_files '*.py')" files="$(config -e docs_python_files '{python}')"
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')" files="$files $(config -e test_python_files '*_test.py')"
else else
# Unrecognised type # Unrecognised type
...@@ -215,7 +215,7 @@ function python_run_coverage() { ...@@ -215,7 +215,7 @@ function python_run_coverage() {
function python_run_lint() { function python_run_lint() {
if ! pylint --reports no \ if ! pylint --reports no \
--rcfile "${root}/pylintrc" \ --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 | output_filter "Linting Python files" ; then
lint_failed=$(( lint_failed+1 )) lint_failed=$(( lint_failed+1 ))
else else
...@@ -227,7 +227,7 @@ function python_run_lint() { ...@@ -227,7 +227,7 @@ function python_run_lint() {
function python_run_docs() { function python_run_docs() {
if ! "${scripts}/python-build-docs" --initial-tag "$(config version_git_tag none)" \ if ! "${scripts}/python-build-docs" --initial-tag "$(config version_git_tag none)" \
--major-version "$(config version 1.0)" \ --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-dir "${artifact_dir}/python-docs" \
| output_filter ; then | output_filter ; then
docs_failed=$(( docs_failed+1 )) docs_failed=$(( docs_failed+1 ))
...@@ -243,7 +243,7 @@ function python_run_clean() { ...@@ -243,7 +243,7 @@ function python_run_clean() {
local thisdir local thisdir
files="$(config -e docs_python_files '*.py')" 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')" files="$files $(config -e test_python_files '*_test.py')"
lastdir='' 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