Skip to content

Commit a9eb38e

Browse files
authored
Merge pull request matplotlib#70 from lgtm-migrator/codeql
Add CodeQL workflow for GitHub code scanning
2 parents 55c6d98 + 2bb67e1 commit a9eb38e

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

.github/workflows/codeql.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: "18 16 * * 5"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ javascript ]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
queries: +security-and-quality
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2
40+
with:
41+
category: "/language:${{ matrix.language }}"

docs/_static/script.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ function getRandomInt(max) {
55
return Math.floor(Math.random() * max);
66
}
77

8-
document.addEventListener("DOMContentLoaded", function(event) {
8+
document.addEventListener("DOMContentLoaded", function(event) {
99
const tabs = document.querySelectorAll('[role="tab"]');
1010
const tabList = document.querySelector('[role="tablist"]');
1111

1212
// set currently active tab to 0
13-
tabList.setAttribute("data-current-tab", 0)
13+
tabList.setAttribute("data-current-tab", 0);
1414

1515
// Add a click event handler to each tab
1616
tabs.forEach((tab, i) => {
1717
tab.addEventListener("click", changeTabs);
18-
tab.setAttribute("data-tab-count", i)
18+
tab.setAttribute("data-tab-count", i);
1919
});
2020

2121
// Enable arrow navigation between tabs in the tab list
@@ -47,7 +47,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
4747

4848
///////////////////////////////////////
4949
// rotate images in images-rotate directory:
50-
var ind = getRandomInt(images_rotate.length);
50+
var ind = getRandomInt(images_rotate.length);
5151
var info = images_rotate[ind];
5252
var img_src = "_static/images-rotate/" + info.image;
5353
var caption = info.caption;
@@ -66,7 +66,7 @@ function changeTabs(e) {
6666
const grandparent = parent.parentNode;
6767

6868
// set attribute for currently active tab for setting the location of the pointer triangle
69-
parent.setAttribute("data-current-tab", e.target.getAttribute("data-tab-count"))
69+
parent.setAttribute("data-current-tab", e.target.getAttribute("data-tab-count"));
7070

7171
// Remove all current selected tabs
7272
parent
@@ -86,4 +86,3 @@ function changeTabs(e) {
8686
.querySelector(`#${target.getAttribute("aria-controls")}`)
8787
.removeAttribute("hidden");
8888
}
89-

0 commit comments

Comments
 (0)