From 83893e65d4576b988f100ae4090cc6db522cad95 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 11 Aug 2020 10:53:49 +0200 Subject: [PATCH] =?UTF-8?q?pa11y:=20possibilit=C3=A9=20d'activer/d=C3=A9sa?= =?UTF-8?q?ctiver=20les=20notices/warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/com/cadoles/pa11y/run-audit.sh | 13 +++++++++++-- vars/pa11y.groovy | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/com/cadoles/pa11y/run-audit.sh b/resources/com/cadoles/pa11y/run-audit.sh index 1318705..ea3f95c 100644 --- a/resources/com/cadoles/pa11y/run-audit.sh +++ b/resources/com/cadoles/pa11y/run-audit.sh @@ -10,10 +10,19 @@ cd reports export PUPPETEER_EXECUTABLE_PATH=$(which chromium-browser) export PA11Y_REPORTER="${PA11Y_REPORTER:-html}" +PA11Y_ARGS="" + +if [ "${PA11Y_INCLUDE_WARNINGS}" == 'true' ]; then + PA11Y_ARGS="${PA11Y_ARGS} --include-warnings" +fi + +if [ "${PA11Y_INCLUDE_NOTICES}" == 'true' ]; then + PA11Y_ARGS="${PA11Y_ARGS} --include-notices" +fi + pa11y \ --config ../patty.json \ - --include-warnings \ - --include-notices \ + ${PA11Y_ARGS} \ --reporter "${PA11Y_REPORTER}" \ --standard "${PA11Y_STANDARD}" \ "$PA11Y_URL" || exit 0 diff --git a/vars/pa11y.groovy b/vars/pa11y.groovy index 4f11466..2560561 100644 --- a/vars/pa11y.groovy +++ b/vars/pa11y.groovy @@ -3,6 +3,8 @@ def audit(String url, Map params = [:]) { def username = params.username ? params.username : ''; def password = params.password ? params.password : ''; def standard = params.standard ? params.standard : 'WCAG2AA'; + def includeWarnings = params.includeWarnings ? params.includeWarnings : false; + def includeNotices = params.includeNotices ? params.includeNotices : false; def pa11yImage = buildDockerImage() @@ -12,6 +14,8 @@ def audit(String url, Map params = [:]) { -e PA11Y_USERNAME='${username}' -e PA11Y_PASSWORD='${password}' -e PA11Y_STANDARD='${standard}' + -e PA11Y_INCLUDE_WARNINGS='${includeWarnings}' + -e PA11Y_INCLUDE_NOTICES='${includeNotices}' """ pa11yImage.inside(dockerArgs) {