Skip to content

Commit 7d9341c

Browse files
committed
ci(super-linter): switch to super-linter
1 parent 31da28e commit 7d9341c

File tree

5 files changed

+99
-34
lines changed

5 files changed

+99
-34
lines changed

.github/workflows/super-linter.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
#################################
3+
#################################
4+
## Super Linter GitHub Actions ##
5+
#################################
6+
#################################
7+
name: Lint Code Base
8+
9+
#
10+
# Documentation:
11+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
12+
#
13+
14+
#############################
15+
# Start the job on all push #
16+
#############################
17+
on:
18+
push:
19+
pull_request:
20+
schedule:
21+
- cron: "0 0 * * 0"
22+
workflow_dispatch:
23+
24+
permissions: {}
25+
26+
###############
27+
# Set the Job #
28+
###############
29+
jobs:
30+
lint:
31+
# Name the Job
32+
name: Lint Code Base
33+
# Set the agent to run on
34+
runs-on: ubuntu-latest
35+
36+
############################################
37+
# Grant status permission for MULTI_STATUS #
38+
############################################
39+
permissions:
40+
contents: read
41+
packages: read
42+
statuses: write
43+
44+
##################
45+
# Load all steps #
46+
##################
47+
steps:
48+
##########################
49+
# Checkout the code base #
50+
##########################
51+
- name: Checkout Code
52+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53+
with:
54+
# Full git history is needed to get a proper list of changed
55+
# files within `super-linter`
56+
fetch-depth: 0
57+
persist-credentials: false
58+
59+
################################
60+
# Run Linter against code base #
61+
################################
62+
- name: Lint Code Base
63+
uses: super-linter/super-linter@ffde3b2b33b745cb612d787f669ef9442b1339a6 # v8.1.0
64+
env:
65+
VALIDATE_ALL_CODEBASE: true
66+
LINTER_RULES_PATH: .
67+
DEFAULT_BRANCH: main
68+
FILTER_REGEX_EXCLUDE: "(_layouts/default\\.html)$"
69+
ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/yamllint.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Bookmarklets
2+
13
If you don't know what bookmarklets are, I recommend this [introduction](https://www.howtogeek.com/189358/beginner-geek-how-to-use-bookmarklets-on-any-device/).
24

35
If you are familiar with bookmarklets but you are not sure how to install one, you can find here [detailed instructions](https://mreidsma.github.io/bookmarklets/installing.html).

commitlint.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const Configuration = {
2+
/*
3+
* Inherit rules from conventional commits.
4+
*/
5+
extends: ["@commitlint/config-conventional"],
6+
7+
/*
8+
* Any rules defined here will override rules from parent.
9+
*/
10+
rules: {
11+
"body-leading-blank": [2, "always"], // warning -> error
12+
"body-max-line-length": [1, "always", 100], // error -> warning
13+
"footer-leading-blank": [2, "always"], // warning -> error
14+
"footer-max-length": [1, "always", 100], // error -> warning
15+
"header-max-length": [1, "always", 100], // error -> warning
16+
},
17+
};
18+
19+
export default Configuration;

javascripts/fill.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function minify(js) {
99
js
1010
.replace(/[\r\n\t]+/gm, " ")
1111
.replace(/\x20+/gm, " ")
12-
.trim()
12+
.trim(),
1313
) +
1414
"%7D)()"
1515
);
@@ -18,28 +18,29 @@ function minify(js) {
1818
function normalize(s) {
1919
return s
2020
.replaceAll(
21-
/[^a-zA-Z0-9\x21\$\x26\x27\(\)\*\+\x2c\x2d\.\/\x3a\x3b\x3d\?\x40_]/g,
22-
"-"
21+
/[^a-zA-Z0-9\x21$\x26\x27()*+\x2c\x2d./\x3a\x3b\x3d?\x40_]/g,
22+
"-",
2323
)
2424
.replaceAll(/\x2d+/g, "-");
2525
}
2626

27+
// eslint-disable-next-line no-unused-vars
2728
async function init(path) {
2829
document.getElementById("mininame").oninput = function () {
2930
document.getElementById("minified").textContent =
3031
document.getElementById("mininame").value;
3132
};
3233
document.getElementById("plaintext").oninput = function () {
3334
document.getElementById("minified").href = minify(
34-
document.getElementById("plaintext").value
35+
document.getElementById("plaintext").value,
3536
);
3637
};
3738
var content = [];
3839
console.debug("Fetching index");
3940
var index = await fetch(
4041
"https://raw.githubusercontent.com/" +
4142
path +
42-
"/main/javascripts/index.json"
43+
"/main/javascripts/index.json",
4344
)
4445
.then(function (response) {
4546
return response.json();
@@ -55,7 +56,7 @@ async function init(path) {
5556
ttoc.textContent = "Examples (" + index.length + ")";
5657
var ul = document.createElement("ul");
5758
toc.appendChild(ul);
58-
var i;
59+
var i;
5960
for (i = 0; i < index.length; i++) {
6061
var li = document.createElement("li");
6162
ul.appendChild(li);
@@ -94,7 +95,7 @@ async function init(path) {
9495
path +
9596
"/main/javascripts/" +
9697
encodeURIComponent(index[j].name) +
97-
".js"
98+
".js",
9899
)
99100
.then(function (response) {
100101
return response.text();

0 commit comments

Comments
 (0)