Skip to content

Commit 7bfb08a

Browse files
Super linter update (#1019)
* super linter v7 * setup-python latest * lint * lint * lint * lint * lint * Lint --------- Co-authored-by: Barry Pollard <[email protected]>
1 parent 53c56e1 commit 7bfb08a

23 files changed

+63
-56
lines changed

.github/linters/.stylelintrc.json

-9
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,21 @@
1010
],
1111
"color-function-notation": null,
1212
"comment-empty-line-before": null,
13-
"declaration-colon-newline-after": null,
1413
"font-family-no-duplicate-names": [
1514
true,
1615
{
1716
"ignoreFontFamilyNames": ["monospace"]
1817
}
1918
],
2019
"length-zero-no-unit": null,
21-
"max-line-length": null,
2220
"media-feature-range-notation": "prefix",
2321
"no-descending-specificity": null,
24-
"no-eol-whitespace": [
25-
true,
26-
{
27-
"ignore": ["empty-lines"]
28-
}
29-
],
3022
"property-no-unknown": [
3123
true,
3224
{
3325
"ignoreProperties": ["prince-pdf-display-doc-title","prince-pdf-tag-type"]
3426
}
3527
],
36-
"selector-list-comma-newline-after": "always",
3728
"selector-pseudo-element-no-unknown": [
3829
true,
3930
{

.github/workflows/code-static-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/checkout@v4
3636
- name: Set up Python 3.12
3737
if: ${{ matrix.language == 'python' }}
38-
uses: actions/setup-python@v5
38+
uses: actions/setup-python
3939
with:
4040
python-version: '3.12'
4141
- name: Install dependencies

.github/workflows/linter.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Linter GitHub Actions ##
33
###########################
44
#
5-
# Documentation: https://github.com/github/super-linter/
5+
# Documentation: https://github.com/super-linter/super-linter/
66
#
77
# Exception config files are in the .github/linters directory
88
#
@@ -24,12 +24,11 @@ jobs:
2424
# Only run the full workflow for manual runs or if upgrading the super linter
2525
if: |
2626
github.event_name != 'workflow_dispatch' &&
27-
startsWith(github.event.pull_request.title,'Bump github/super-linter') != true
27+
startsWith(github.event.pull_request.title,'Bump super-linter/super-linter') != true
2828
run: |
2929
echo "VALIDATE_ALL_CODEBASE=false" >> $GITHUB_ENV
3030
- name: Lint Code Base
31-
#uses: docker://github/super-linter:v3.15.3
32-
uses: github/super-linter/[email protected]
31+
uses: super-linter/super-linter/slim@v7
3332
env:
3433
DEFAULT_BRANCH: main
3534
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/predeploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
node-version: '20'
2828
- name: Set up Python 3.12
29-
uses: actions/setup-python@v5
29+
uses: actions/setup-python
3030
with:
3131
python-version: '3.12'
3232
- name: Run the website

.github/workflows/test-website.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
node-version: '20'
2727
- name: Set up Python 3.12
28-
uses: actions/setup-python@v5
28+
uses: actions/setup-python
2929
with:
3030
python-version: '3.12'
3131
- name: Run the website
@@ -35,7 +35,7 @@ jobs:
3535
- name: Use more complete checks for generated HTML linting
3636
run: cp -f .github/linters/.htmlhintrc_morechecks .github/linters/.htmlhintrc
3737
- name: Lint Generated HTML
38-
uses: github/super-linter/slim@v4.10.1
38+
uses: super-linter/super-linter/slim@v7
3939
env:
4040
DEFAULT_BRANCH: main
4141
FILTER_REGEX_INCLUDE: static/html/.*

config/reports.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@
12031203
},
12041204
"progressive-web-apps": {
12051205
"name": "Progressive Web Apps",
1206-
"summary": "This report examines the state of [Progressive Web Apps (PWAs)](https://developers.google.com/web/progressive-web-apps/). PWAs are a new class of web applications, enabled by the [Service Worker APIs](https://developer.mozilla.org/en/docs/Web/API/Service_Worker_API). Service workers allow apps to support network-independent loading, to receive push notifications as well as to synchronize data in the background, and — together with [Web App Manifests](https://developer.mozilla.org/en-US/docs/Web/Manifest) — allow users to install PWAs.",
1206+
"summary": "This report examines the state of [Progressive Web Apps (PWAs)](https://developers.google.com/web/progressive-web-apps/). PWAs are a new class of web applications, enabled by the [Service Worker APIs](https://developer.mozilla.org/en/docs/Web/API/Service_Worker_API). Service workers allow apps to support network-independent loading, to receive push notifications as well as to synchronize data in the background, andtogether with [Web App Manifests](https://developer.mozilla.org/en-US/docs/Web/Manifest)allow users to install PWAs.",
12071207
"image": "/static/img/reports/progressive-web-apps-report.png",
12081208
"metrics": [
12091209
"pwaScores",

src/js/components/filters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class Filters {
182182
updateCategory(event) {
183183
// Get the techs associated with the selected category
184184
const selectedCategory = this.categories.find(category => category.category === event.target.value);
185-
let selectedTechs = selectedCategory?.technologies || [];
185+
let selectedTechs = selectedCategory?.technologies || [];
186186
if(event.target.value === 'ALL') {
187187
selectedTechs = this.technologies.map(technology => technology.technology);
188188
}

src/js/histogram.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global Highcharts */
2+
13
import { Colors } from './colors';
24
import debounce from './debounce';
35
import { Metric } from './metric';
@@ -38,13 +40,13 @@ function drawClientSummary(data, options, client) {
3840
}
3941

4042
function getSummary(data, options) {
41-
const summary = getPrimaryMetric(data, options);
43+
const summary = getPrimaryMetric(data);
4244
const metric = new Metric(options, summary);
4345

4446
return metric.toString();
4547
}
4648

47-
function getPrimaryMetric(data, options) {
49+
function getPrimaryMetric(data) {
4850
data = data.filter(o => +o.cdf > 0.5);
4951
if (!data.length) {
5052
return '?';
@@ -110,12 +112,13 @@ class Bin {
110112
format(property) {
111113
switch(property) {
112114
case 'pdf':
113-
case 'cdf':
115+
case 'cdf': {
114116
let value = (Math.floor(this[property] * 10000) / 100).toFixed(2);
115117
if (value < 10) {
116118
value = '0' + value;
117119
}
118120
return value + '%';
121+
}
119122
case 'volume':
120123
return this[property].toLocaleString();
121124
default:
@@ -265,8 +268,8 @@ function drawHistogram(data, containerId, options) {
265268
const chart = document.getElementById(`${options.metric}-chart`);
266269
callOnceWhenVisible(chart, () => {
267270
drawChart(series, containerId, options);
268-
});
269-
};
271+
})
272+
}
270273

271274
function drawChart(series, containerId, options) {
272275
const chart = Highcharts.chart(containerId, {
@@ -326,7 +329,7 @@ function drawChart(series, containerId, options) {
326329
borderColor: 'rgba(247,247,247,0.85)',
327330
formatter: function() {
328331
const metric = new Metric(options, Math.round(this.points[0].x * 100) / 100);
329-
const tooltips = this.points.filter(p => !p.series.name.includes('CDF')).map((point, points) => {
332+
const tooltips = this.points.filter(p => !p.series.name.includes('CDF')).map((point) => {
330333
const cdf = this.points.find(p => p.series.name == `${point.series.name} CDF`);
331334
return `<td>
332335
<p style="text-transform: uppercase; font-size: 10px;">

src/js/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function renderBlogPosts() {
1515
}
1616

1717
const blog = new BlogRenderer();
18-
blog.renderPosts(blog_posts, template).then(_ => blog_section.classList.remove('hidden'));
18+
blog.renderPosts(blog_posts, template).then(() => blog_section.classList.remove('hidden'));
1919
}
2020

2121
function getDiscussTopics() {
@@ -27,12 +27,12 @@ function getDiscussTopics() {
2727
const topics = r.topic_list.topics.slice(0, 2);
2828
topics.forEach(topic => latestTopicIds.add(topic.id));
2929
drawTopics(topics, r.users);
30-
}).then(_ => {
30+
}).then(() => {
3131
return fetch(`${Discussion.ORIGIN}/top.json`);
3232
}).then(r => r.json()).then(r => {
3333
const topics = r.topic_list.topics.filter(topic => !latestTopicIds.has(topic.id)).slice(0, 3);
3434
drawTopics(topics, r.users);
35-
}).then(_ => discuss_section.classList.remove('hidden'));
35+
}).then(() => discuss_section.classList.remove('hidden'));
3636
}
3737

3838
function drawTopics(topics, rUsers) {

src/js/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const hamburger = document.querySelector('.hamburger');
44

55
if (mobileNav) {
66
if (hamburger) {
7-
hamburger.addEventListener('click', (e) => {
7+
hamburger.addEventListener('click', () => {
88
const expanded = hamburger.getAttribute('aria-expanded');
99
mobileNav.classList.toggle('active');
1010
hamburger.ariaExpanded = expanded === 'true' ? 'false' : 'true';

src/js/report.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global charts */
2+
13
import { Colors } from './colors';
24
import { Metric } from './metric';
35
import { prettyDate, drawMetricSummary } from './utils';
@@ -32,21 +34,21 @@ class Report {
3234
}
3335

3436
bindChangeListener(id) {
35-
document.getElementById(id).addEventListener('change', e => {
37+
document.getElementById(id).addEventListener('change', (e) => {
3638
this[id] = e.target.value
3739
this.updatePermalink();
3840
});
3941
}
4042

4143
bindUpdateListener() {
42-
document.getElementById('update').addEventListener('click', _ => {
44+
document.getElementById('update').addEventListener('click', () => {
4345
// TODO: Consider using history.replaceState on field changes instead.
4446
location.href = this.permalink.value;
4547
});
4648
}
4749

4850
bindTableVisibilityToggle() {
49-
document.body.addEventListener('click', e => {
51+
document.body.addEventListener('click', (e) => {
5052
if (!e.target.classList.contains('show-hide')) {
5153
return;
5254
}
@@ -83,7 +85,7 @@ class Report {
8385
}
8486

8587
bindPermalinkClick() {
86-
this.permalink.addEventListener('click', _ => {
88+
this.permalink.addEventListener('click', () => {
8789
this.permalink.select();
8890
});
8991
}
@@ -180,7 +182,7 @@ class Report {
180182
const gridExpanderSelector = '.grid-expansion, .metric-header a';
181183
Array.from(document.querySelectorAll(gridExpanderSelector)).forEach(btn => {
182184
const metricId = btn.dataset.metric;
183-
btn.addEventListener('click', e => {
185+
btn.addEventListener('click', () => {
184186
this.toggleMetricExpansion(metricId);
185187
});
186188
});
@@ -208,7 +210,7 @@ class Report {
208210

209211
getWPT(wptId) {
210212
const wpt = new WPT(wptId);
211-
wpt.fetchResults().then(results => {
213+
wpt.fetchResults().then(() => {
212214
const metrics = wpt.getMetrics(this.report);
213215
Object.entries(metrics).forEach(([metric, value]) => {
214216
const options = this.report.metrics.find(m => m.id === metric);

src/js/send-web-vitals.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global gtag, webVitals */
2+
13
function sendWebVitals() {
24

35
function getLoafAttribution(attribution) {
@@ -80,7 +82,7 @@ function sendWebVitals() {
8082
debug_target: attribution.loadState || '(not set)',
8183
};
8284
break;
83-
case 'INP':
85+
case 'INP': {
8486
const loafAttribution = getLoafAttribution(attribution);
8587
overrides = {
8688
debug_event: attribution.interactionType,
@@ -93,6 +95,7 @@ function sendWebVitals() {
9395
...loafAttribution
9496
};
9597
break;
98+
}
9699
case 'LCP':
97100
overrides = {
98101
debug_url: attribution.url,

src/js/techreport/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global Section */
2+
13
import Filters from '../components/filters';
24
import { Constants } from './utils/constants';
35
const { DrilldownHeader } = require("../components/drilldownHeader");
@@ -87,11 +89,12 @@ class TechReport {
8789
this.getAllMetricData();
8890
break;
8991

90-
case 'category':
91-
const category = this.filters.category || 'CMS';
92+
case 'category': {
93+
const category = this.filters.category || 'CMS';
9294
this.initializeReport();
9395
this.getCategoryData(category);
9496
break;
97+
}
9598
}
9699
}
97100

src/js/techreport/section.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global Timeseries */
2+
13
import SummaryCard from "./summaryCards";
24
import TableLinked from "./tableLinked";
35

src/js/techreport/table.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function sortTableBy(dataset, key) {
7575
}
7676

7777
function getColumnCell(columnConfig, data, date) {
78-
const { config, column, client, app, subcategory, metric, endpoint } = columnConfig;
78+
const { column, client, app, subcategory, endpoint } = columnConfig;
7979

8080
const _data = data[app]?.find(entry => entry.date === date);
8181
const endpointData = _data?.[endpoint];
@@ -96,7 +96,7 @@ function getColumnCell(columnConfig, data, date) {
9696
function getSubcategory(config) {
9797
const urlParams = new URLSearchParams(window.location.search);
9898
const urlSubcategory = urlParams.get(config.param);
99-
const subcategory = urlSubcategory || config.default || '';
99+
const subcategory = urlSubcategory || config.default || '';
100100

101101
return subcategory;
102102
}

src/js/techreport/tableLinked.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class TableLinked {
115115
checkbox.setAttribute('data-name', `table-${this.id}`);
116116
checkbox.setAttribute('id', `${app}-table-${this.id}`);
117117
checkbox.setAttribute('name', `${app}-table-${this.id}`);
118-
checkbox.addEventListener('change', (e) => {
118+
checkbox.addEventListener('change', () => {
119119
const appLinks = document.querySelectorAll('[data-name="selected-apps"]');
120120
const selectedApps = document.querySelectorAll(`[data-name="table-${this.id}"]:checked`);
121121

src/js/techreport/timeseries.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global Highcharts */
2+
13
import { Table } from "./table";
24
import { DataUtils } from "./utils/data";
35
import { UIUtils } from "./utils/ui";
@@ -120,7 +122,7 @@ class Timeseries {
120122
/* Get the currently selected subcategory based on the URL */
121123
const urlParams = new URLSearchParams(window.location.search);
122124
const urlSubcategory = urlParams.get(config.param);
123-
const subcategory = urlSubcategory || config.default;
125+
const subcategory = urlSubcategory || config.default;
124126

125127
/* Remove the previous content */
126128
container.innerHTML = '';
@@ -182,7 +184,7 @@ class Timeseries {
182184
/* Get the currently selected subcategory based on the URL */
183185
const urlParams = new URLSearchParams(window.location.search);
184186
const urlSubcategory = urlParams.get(config.param);
185-
const subcategory = urlSubcategory || config.default;
187+
const subcategory = urlSubcategory || config.default;
186188

187189
/* Get settings */
188190
const metric = component.dataset.metric;
@@ -398,7 +400,7 @@ class Timeseries {
398400
const config = this.pageConfig[this.id]?.viz;
399401
const urlParams = new URLSearchParams(window.location.search);
400402
const urlSubcategory = urlParams.get(config.param);
401-
const subcategory = urlSubcategory || config.default;
403+
const subcategory = urlSubcategory || config.default;
402404

403405
// Get default colors
404406
const colors = this.defaults(config)?.chart?.colors;
@@ -412,7 +414,7 @@ class Timeseries {
412414
const value = row?.[endpoint]?.find(row => row.name === subcategory)?.[client]?.[metric];
413415
return {
414416
x: new Date(row.date).getTime(),
415-
y: value || 0,
417+
y: value || 0,
416418
};
417419
});
418420

0 commit comments

Comments
 (0)