Skip to content

Commit

Permalink
Fix more lint warnings (#310)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lyricnz authored Nov 14, 2023
1 parent e7a054d commit 22d781d
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 10 deletions.
25 changes: 25 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions extra/docker/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
```
```
11 changes: 7 additions & 4 deletions site/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,25 @@

<!-- Include Chart.js library -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<meta name="description" content="Statistics about current technology type for NBN in Australia.">
<meta name="author" content="Luke Prior">
<meta name="keywords" content="nbn,map,australia,statistics,fttn,fttp,fttc,wireless">
</head>
<body>
<div style="width: 80%; margin: 0 auto;">
<!-- Heading for Line Chart -->
<h2>Line Chart by Technology</h2>
<!-- Create a taller canvas element to render the line chart -->
<div style="height: 500px;">
<canvas id="lineChart"></canvas>
<canvas id="line-chart"></canvas>
</div>
</div>
<div style="width: 80%; margin: 0 auto;">
<!-- Heading for Pie Chart -->
<h2>Pie Chart by Technology</h2>
<!-- Create a canvas element to render the pie chart -->
<div style="height: 300px;">
<canvas id="pieChart"></canvas>
<canvas id="pie-chart"></canvas>
</div>
</div>

Expand Down Expand Up @@ -126,7 +129,7 @@ <h2>Pie Chart by Technology</h2>
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: {
Expand Down Expand Up @@ -165,7 +168,7 @@ <h2>Pie Chart by Technology</h2>
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: {
Expand Down
5 changes: 3 additions & 2 deletions tests/data/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
```

0 comments on commit 22d781d

Please sign in to comment.