feat(web-ext-lint): allow using project's web-ext package
Change-Id: I74889983796e96754e0c9347f5b94d6a7da02c76
diff --git a/playbooks/web-ext-lint/pre.yaml b/playbooks/web-ext-lint/pre.yaml
index ccd2fad..37d845b 100644
--- a/playbooks/web-ext-lint/pre.yaml
+++ b/playbooks/web-ext-lint/pre.yaml
@@ -1,4 +1,6 @@
-- name: Ensure web-ext is installed
- hosts: all
- roles:
- - ensure-web-ext
+- hosts: all
+ tasks:
+ - name: Ensure web-ext is installed
+ include_role:
+ name: ensure-web-ext
+ when: use_standalone_web_ext
diff --git a/roles/web-ext-lint/defaults/main.yaml b/roles/web-ext-lint/defaults/main.yaml
index 5dc93b5..aa6eda2 100644
--- a/roles/web-ext-lint/defaults/main.yaml
+++ b/roles/web-ext-lint/defaults/main.yaml
@@ -1,3 +1,5 @@
---
source_dir: src
+use_standalone_web_ext: true
+web_ext_command:
extra_lint_flags:
diff --git a/roles/web-ext-lint/tasks/main.yaml b/roles/web-ext-lint/tasks/main.yaml
index 57b5b12..0ce8fcb 100644
--- a/roles/web-ext-lint/tasks/main.yaml
+++ b/roles/web-ext-lint/tasks/main.yaml
@@ -3,7 +3,8 @@
cmd: |
set -o pipefail
set -e
- web-ext lint --no-input --boring \
+ {{ 'web-ext' if use_standalone_web_ext else web_ext_command }} \
+ lint --no-input --boring \
{{ '--source-dir=' + source_dir if source_dir else '' }} \
{{ extra_lint_flags }} | tee -a web-ext-lint.txt
chdir: "{{ zuul.project.src_dir }}"
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index e60881d..ffe92c8 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -3,6 +3,8 @@
pre-run: playbooks/web-ext-lint/pre.yaml
run: playbooks/web-ext-lint/run.yaml
post-run: playbooks/web-ext-lint/post.yaml
+ vars:
+ use_standalone_web_ext: true
description: |
Check a Web Extension project for basic lint problems.