From 514db57c0c8ff51293eea639751feab7e9e11d02 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 08:31:47 +1000 Subject: [PATCH 1/7] Run HTML linting as .github actino --- .github/workflows/html.yaml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/html.yaml diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml new file mode 100644 index 0000000000..7f71930ba6 --- /dev/null +++ b/.github/workflows/html.yaml @@ -0,0 +1,46 @@ +# Check javascript template files + +name: HTML Templates + +on: + push: + branches: + - master + + pull_request: + branches-ignore: + - l10* + +jobs: + + javascript: + runs-on: ubuntu-latest + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INVENTREE_DB_ENGINE: sqlite3 + INVENTREE_DB_NAME: inventree + INVENTREE_MEDIA_ROOT: ./media + INVENTREE_STATIC_ROOT: ./static + steps: + - name: Install node.js + uses: actions/setup-node@v2 + - run: npm install + - name: Checkout Code + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install gettext + pip3 install invoke + invoke install + invoke static + - name: Check HTML Files + # TODO: Run these checks on *ALL* templated HTML files + run: | + npm install markuplint + npx markuplint InvenTree/templates/*.html From 0a8365e3bca02ca32e85ae2c49d95140905d26b6 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 08:45:06 +1000 Subject: [PATCH 2/7] Fix for clip.html --- .github/workflows/html.yaml | 2 +- InvenTree/templates/clip.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml index 7f71930ba6..908f81b21c 100644 --- a/.github/workflows/html.yaml +++ b/.github/workflows/html.yaml @@ -13,7 +13,7 @@ on: jobs: - javascript: + html: runs-on: ubuntu-latest env: diff --git a/InvenTree/templates/clip.html b/InvenTree/templates/clip.html index d4232b02b4..b0edff2fb3 100644 --- a/InvenTree/templates/clip.html +++ b/InvenTree/templates/clip.html @@ -1,5 +1,5 @@ {% load i18n %} - + \ No newline at end of file From f0e5d1984c5b5fb3cfbc99df03b9fad3c38cc402 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 08:46:30 +1000 Subject: [PATCH 3/7] Fix for about.html --- InvenTree/templates/about.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/templates/about.html b/InvenTree/templates/about.html index 5b589bf47c..0750b9711a 100644 --- a/InvenTree/templates/about.html +++ b/InvenTree/templates/about.html @@ -87,7 +87,7 @@ - + From 9b001cd298d04a7e99724d3c24390bc6f046bece Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 08:48:34 +1000 Subject: [PATCH 4/7] Another fix --- InvenTree/part/templates/part/prices.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/part/templates/part/prices.html b/InvenTree/part/templates/part/prices.html index 69412ab2bb..9b829c179b 100644 --- a/InvenTree/part/templates/part/prices.html +++ b/InvenTree/part/templates/part/prices.html @@ -179,7 +179,7 @@

{% trans 'Stock Pricing' %} - +

{% if price_history|length > 0 %}
From 42637ddefa22fd07d720de4bc8311cb0e3a393d1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 08:59:02 +1000 Subject: [PATCH 5/7] more linting --- .github/workflows/html.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml index 908f81b21c..2e499e0692 100644 --- a/.github/workflows/html.yaml +++ b/.github/workflows/html.yaml @@ -44,3 +44,7 @@ jobs: run: | npm install markuplint npx markuplint InvenTree/templates/*.html + npx markuplint InvenTree/templates/InvenTree/*.html + npx markuplint InvenTree/templates/InvenTree/settings/*.html + npm markuplint InvenTree/part/templates/part/*.html + From c7d6b985bd447ac45a0fd5f613c1e7bce6457c0f Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 09:08:46 +1000 Subject: [PATCH 6/7] LINT ALL THE THINGS --- .github/workflows/html.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml index 2e499e0692..e7714cd99d 100644 --- a/.github/workflows/html.yaml +++ b/.github/workflows/html.yaml @@ -40,11 +40,15 @@ jobs: invoke install invoke static - name: Check HTML Files - # TODO: Run these checks on *ALL* templated HTML files run: | npm install markuplint + npm markuplint InvenTree/build/templates/build/*.html + npm markuplint InvenTree/common/templates/common/*.html + npm markuplint InvenTree/company/templates/company/*.html + npm markuplint InvenTree/order/templates/order/*.html + npm markuplint InvenTree/part/templates/part/*.html + npm markuplint InvenTree/stock/templates/stock/*.html npx markuplint InvenTree/templates/*.html npx markuplint InvenTree/templates/InvenTree/*.html npx markuplint InvenTree/templates/InvenTree/settings/*.html - npm markuplint InvenTree/part/templates/part/*.html From f363c0f08414faf4d008ccdcd77aa424b57737e8 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 4 Sep 2021 09:22:52 +1000 Subject: [PATCH 7/7] Fix workflow file --- .github/workflows/html.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml index e7714cd99d..069da7cbb4 100644 --- a/.github/workflows/html.yaml +++ b/.github/workflows/html.yaml @@ -42,12 +42,12 @@ jobs: - name: Check HTML Files run: | npm install markuplint - npm markuplint InvenTree/build/templates/build/*.html - npm markuplint InvenTree/common/templates/common/*.html - npm markuplint InvenTree/company/templates/company/*.html - npm markuplint InvenTree/order/templates/order/*.html - npm markuplint InvenTree/part/templates/part/*.html - npm markuplint InvenTree/stock/templates/stock/*.html + npx markuplint InvenTree/build/templates/build/*.html + npx markuplint InvenTree/common/templates/common/*.html + npx markuplint InvenTree/company/templates/company/*.html + npx markuplint InvenTree/order/templates/order/*.html + npx markuplint InvenTree/part/templates/part/*.html + npx markuplint InvenTree/stock/templates/stock/*.html npx markuplint InvenTree/templates/*.html npx markuplint InvenTree/templates/InvenTree/*.html npx markuplint InvenTree/templates/InvenTree/settings/*.html