Skip to content

Commit ca2c608

Browse files
committed
ci(super-linter): switch to super-linter
1 parent 1cd0f83 commit ca2c608

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+483
-254
lines changed

.github/workflows/jslint.yml

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

.github/workflows/super-linter.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/yamllint.yml

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

.jscpd.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore": ["javascripts/**"]
3+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
To view each bookmarklet source code, you can browse the [javascripts](/javascripts) directory of the main branch.
77

8-
There is also a [user-friendly](https://thomasleplus.github.io/bookmarklets) version of this repo in the form of a GitHub Pages website. The source code of that is in the [gh-pages](../../tree/gh-pages) branch.
8+
There is also a [user-friendly](https://thomasleplus.github.io/bookmarklets) version of this repository in the form of a GitHub Pages site. The source code of that is in the [gh-pages](../../tree/gh-pages) branch.
99

1010
Feel free to open issues or pull requets for [bugs](../../issues/new?template=bookmarklet-bug-report.md) or [feature requests](../../issues/new?template=bookmarklet-feature-request.md).

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;
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
"use strict";
22
var selection;
33
if (window.getSelection) {
4-
selection = window.getSelection().toString();
4+
selection = window.getSelection().toString();
55
} else if (document.selection && document.selection.type !== "Control") {
6-
selection = document.selection.createRange().text;
6+
selection = document.selection.createRange().text;
77
}
88
if (selection === undefined || selection.length === 0) {
9-
window.alert('Select the desired text to search.');
9+
window.alert("Select the desired text to search.");
1010
} else {
11-
window.open('https://www.amazon.com/s?k=' + encodeURIComponent(selection.trim()), '_blank').focus();
11+
window
12+
.open(
13+
"https://www.amazon.com/s?k=" + encodeURIComponent(selection.trim()),
14+
"_blank",
15+
)
16+
.focus();
1217
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use strict";
2-
/*global URL, URLSearchParams */
32
var url = new URL(location.href);
43
var params = new URLSearchParams(url.search);
5-
if (!params.get('rh') && !params.get('i')) {
6-
window.alert('Please narrow down your search to a specific department for the sort to take effect.');
7-
} else if (params.get('s') !== 'review-count-rank') {
8-
params.set('s', 'review-count-rank');
9-
url.search = params.toString();
10-
location.href = url.toString();
4+
if (!params.get("rh") && !params.get("i")) {
5+
window.alert(
6+
"Please narrow down your search to a specific department for the sort to take effect.",
7+
);
8+
} else if (params.get("s") !== "review-count-rank") {
9+
params.set("s", "review-count-rank");
10+
url.search = params.toString();
11+
location.href = url.toString();
1112
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
"use strict";
2-
window.open('https://archive.today/submit/?url=' + encodeURIComponent(location.href), '_blank').focus();
2+
window
3+
.open(
4+
"https://archive.today/submit/?url=" + encodeURIComponent(location.href),
5+
"_blank",
6+
)
7+
.focus();
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
"use strict";
22
var selection;
33
if (window.getSelection) {
4-
selection = window.getSelection().toString();
4+
selection = window.getSelection().toString();
55
} else if (document.selection && document.selection.type !== "Control") {
6-
selection = document.selection.createRange().text;
6+
selection = document.selection.createRange().text;
77
}
88
if (selection === undefined || selection.length === 0) {
9-
window.alert('Select the desired text to search.');
9+
window.alert("Select the desired text to search.");
1010
} else {
11-
window.open('https://www.bing.com/search?q=' + encodeURIComponent(selection.trim()), '_blank').focus();
11+
window
12+
.open(
13+
"https://www.bing.com/search?q=" + encodeURIComponent(selection.trim()),
14+
"_blank",
15+
)
16+
.focus();
1217
}

0 commit comments

Comments
 (0)