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 <barrypollard@google.com>
1 parent 53c56e1 commit 7bfb08a

File tree

23 files changed

+63
-56
lines changed

23 files changed

+63
-56
lines changed

.github/linters/.stylelintrc.json

Lines changed: 0 additions & 9 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 4 deletions
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/slim@v4.10.1
31+
uses: super-linter/super-linter/slim@v7
3332
env:
3433
DEFAULT_BRANCH: main
3534
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/predeploy.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 6 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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';

0 commit comments

Comments
 (0)