From 22d781df69cac931f3ea4fee869529ec7e21979f Mon Sep 17 00:00:00 2001 From: Simon Roberts Date: Tue, 14 Nov 2023 13:02:59 +1100 Subject: [PATCH] Fix more lint warnings (#310) * markdownlint fixes * Stats meta tags. djlint. * Rename element id to match linter * Make lint failures errors again * Stock htmlhint file from https://github.com/oxsecurity/megalinter/blob/main/TEMPLATES/.htmlhintrc with head-script-disabled disabled --- .htmlhintrc | 25 +++++++++++++++++++++++++ .mega-linter.yml | 4 ++-- extra/docker/README.md | 7 +++++-- site/stats.html | 11 +++++++---- tests/data/README.md | 5 +++-- 5 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 .htmlhintrc diff --git a/.htmlhintrc b/.htmlhintrc new file mode 100644 index 0000000000..63c76e3eb0 --- /dev/null +++ b/.htmlhintrc @@ -0,0 +1,25 @@ +{ + "tagname-lowercase": true, + "attr-lowercase": true, + "attr-value-double-quotes": true, + "attr-value-not-empty": false, + "attr-no-duplication": true, + "doctype-first": true, + "tag-pair": true, + "tag-self-close": false, + "spec-char-escape": true, + "id-unique": true, + "src-not-empty": true, + "title-require": true, + "alt-require": true, + "doctype-html5": true, + "id-class-value": "dash", + "style-disabled": false, + "inline-style-disabled": false, + "inline-script-disabled": false, + "space-tab-mixed-disabled": "space", + "id-class-ad-disabled": false, + "href-abs-or-rel": false, + "attr-unsafe-chars": true, + "head-script-disabled": false +} diff --git a/.mega-linter.yml b/.mega-linter.yml index 5277e76824..2a790fe148 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -16,5 +16,5 @@ PYTHON_BLACK_ARGUMENTS: "--line-length 120" PYTHON_FLAKE8_ARGUMENTS: "--max-line-length 120" MARKDOWN_MARKDOWNLINT_ARGUMENTS: "--disable MD013" HTML_DJLINT_ARGUMENTS: "--ignore=H021" -HTML_DJLINT_DISABLE_ERRORS: true -HTML_HTMLHINT_DISABLE_ERRORS: true +# HTML_DJLINT_DISABLE_ERRORS: true +# HTML_HTMLHINT_DISABLE_ERRORS: true diff --git a/extra/docker/README.md b/extra/docker/README.md index 39b52f5870..edd42f7063 100644 --- a/extra/docker/README.md +++ b/extra/docker/README.md @@ -1,4 +1,7 @@ +# nbn-upgrade-map Docker Image +This directory contains a Dockerfile that can be used to create a docker image which can run the suburb processing without installing +local dependencies. ## Build @@ -27,7 +30,7 @@ docker run -it -v ./results:/app/results --network test_network nbn-upgrade-map: You can also run everything using docker-compose. Execute from the top level directory of the project: -``` +```shell ❯ docker-compose -f extra/docker/docker-compose.yaml --profile test up [+] Running 2/2 ✔ Container docker-db-1 Created 0.0s @@ -56,4 +59,4 @@ docker-app-1 | 2023-09-15 05:28:08,075 INFO MainThread Location ID types: {'LOC docker-app-1 | 2023-09-15 05:28:08,077 INFO MainThread Writing results to results/VIC/southern-cross.geojson docker-app-1 | 2023-09-15 05:28:09,832 INFO MainThread Updating progress.json docker-app-1 exited with code 0 -``` \ No newline at end of file +``` diff --git a/site/stats.html b/site/stats.html index 38c774b40c..75bc2eb539 100644 --- a/site/stats.html +++ b/site/stats.html @@ -20,6 +20,9 @@ + + +
@@ -27,7 +30,7 @@

Line Chart by Technology

- +
@@ -35,7 +38,7 @@

Line Chart by Technology

Pie Chart by Technology

- +
@@ -126,7 +129,7 @@

Pie Chart by Technology

async function createLineChart() { const chartData = await prepareLineChartData(); - const ctx = document.getElementById('lineChart').getContext('2d'); + const ctx = document.getElementById('line-chart').getContext('2d'); const lineChart = new Chart(ctx, { type: 'line', data: { @@ -165,7 +168,7 @@

Pie Chart by Technology

async function createPieChart() { const pieData = await preparePieChartData(); - const ctx = document.getElementById('pieChart').getContext('2d'); + const ctx = document.getElementById('pie-chart').getContext('2d'); const pieChart = new Chart(ctx, { type: 'pie', data: { diff --git a/tests/data/README.md b/tests/data/README.md index 2da3d4264a..325f64d967 100644 --- a/tests/data/README.md +++ b/tests/data/README.md @@ -1,8 +1,10 @@ +# How to create Sample Data for testing + To create sample data in SQLite use the following process: - create empty DB per process described in DB: -``` +```text sqlite3 tests/data/sample-addresses.db -- create table and index per process described in DB @@ -23,4 +25,3 @@ CREATE INDEX address_name_state ON address_principals(locality_name, state); attach database './extra/db/address_principals.db' as full_db; INSERT INTO main.address_principals SELECT * FROM full_db.address_principals WHERE locality_name like '%SOMER%' ORDER BY RANDOM() LIMIT 100; ``` -