Skip to content

Commit f389e5c

Browse files
authored
Integrate rome ci (#2)
* ran rome format --write * Add status badge
1 parent 663d2d1 commit f389e5c

File tree

8 files changed

+97
-67
lines changed

8 files changed

+97
-67
lines changed

.github/workflows/rome.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ci
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: opensuse/tumbleweed
10+
11+
steps:
12+
- uses: actions/[email protected]
13+
- name: Add devel repo
14+
run: |
15+
zypper ar https://download.opensuse.org/repositories/devel:/languages:/javascript/openSUSE_Tumbleweed/devel:languages:javascript.repo
16+
17+
- name: Update packages
18+
run: |
19+
zypper --non-interactive --gpg-auto-import-keys ref
20+
21+
22+
- name: Install dependencies
23+
run: zypper --non-interactive --gpg-auto-import-keys install rome
24+
25+
- name: Lint
26+
run: |
27+
rome check .
28+
29+
- name: Format
30+
run: |
31+
rome ci .

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
# useascript
1+
# useascript [![ci](https://github.com/avindra/useascript/actions/workflows/rome.yml/badge.svg)](https://github.com/avindra/useascript/actions/workflows/rome.yml)
22

3-
`useascript` is a repository of userscripts for a clearer Internet 🌃
43

4+
`useascript` is a repository of userscripts for a clearer Internet 🌃
55

66
Brought to you by [Avindra Goolcharan](https://dra.vin/).
77

88
## Usage
9-
10-
* [Install from GitHub](https://github.com/avindra/useascript/raw/main/hook.user.js) ([Source](./hook.user.js))
119

12-
Note that, as per the `@match` directive, it will run on <strong>all websites</strong>.
10+
- [Install from GitHub](https://github.com/avindra/useascript/raw/main/hook.user.js)
11+
([Source](./hook.user.js))
12+
13+
Note that, as per the `@match` directive, it will run on <strong>all
14+
websites</strong>.
1315

1416
```
1517
// @match *://*/*
1618
```
1719

1820
## License
1921

20-
The source code is fully licensed under `GPL-3.0-only`. See [COPYING](./COPYING) for more info.
22+
The source code is fully licensed under `GPL-3.0-only`. See [COPYING](./COPYING)
23+
for more info.

google.com/index.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { onBrowse } from "./../util.js";
22

33
/**
44
* Ensure that "q=" is the last parameter.
5-
*
5+
*
66
* Makes search more usable when
77
* using CTRL+L hotkey.
8-
*
8+
*
99
* Especially a problem with "Visually similar images" link
1010
*/
1111
onBrowse(() => {
@@ -28,17 +28,16 @@ onBrowse(() => {
2828
}
2929
});
3030

31-
3231
/**
3332
* Prevent google from mangling URLs
3433
*
3534
* @see https://gist.github.com/chris-kwl/6172eb00971ab81bf99a213682b42e21
3635
*/
3736
const disableOnmousedown = function (node) {
38-
const as = node.getElementsByTagName('a');
37+
const as = node.getElementsByTagName("a");
3938
for (let a = as[0], i = 1; a; i++) {
40-
a.removeAttribute('data-jsarwt');
41-
a = as[i];
39+
a.removeAttribute("data-jsarwt");
40+
a = as[i];
4241
}
4342
};
4443

@@ -49,5 +48,9 @@ const disableOnmousedownOfInsertedNode = function (evt) {
4948
disableOnmousedown(node);
5049
};
5150

52-
document.addEventListener('load', disableOnmousedown(document.body), false);
53-
document.body.addEventListener('AutoPagerize_DOMNodeInserted', disableOnmousedownOfInsertedNode, false);
51+
document.addEventListener("load", disableOnmousedown(document.body), false);
52+
document.body.addEventListener(
53+
"AutoPagerize_DOMNodeInserted",
54+
disableOnmousedownOfInsertedNode,
55+
false,
56+
);

guidestar.org/index.js

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
setTimeout(
2-
() => {
3-
let bar = document.getElementById("signUpModal");
1+
setTimeout(() => {
2+
let bar = document.getElementById("signUpModal");
43

5-
if (bar) {
6-
bar.remove();
7-
document.body.className = "";
8-
}
4+
if (bar) {
5+
bar.remove();
6+
document.body.className = "";
7+
}
98

10-
bar = document.querySelector(".modal-backdrop");
9+
bar = document.querySelector(".modal-backdrop");
1110

12-
if (bar) {
13-
bar.remove();
14-
}
11+
if (bar) {
12+
bar.remove();
13+
}
1514

16-
bar = document.getElementById("signUpFooter");
15+
bar = document.getElementById("signUpFooter");
1716

18-
if (bar) {
19-
bar.remove();
20-
}
21-
},
22-
500,
23-
);
17+
if (bar) {
18+
bar.remove();
19+
}
20+
}, 500);

holy-bhagavad-gita.org/index.js

+16-19
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ b.style.backgroundImage = "none";
1212
/**
1313
* remove promotional content for social media
1414
*/
15-
[".fbLikeBoxHolder", ".subscribe"].forEach(
16-
(css) => {
17-
const like = document.querySelector(css);
18-
if (like) {
19-
like.parentNode.remove();
20-
}
21-
},
22-
);
15+
[".fbLikeBoxHolder", ".subscribe"].forEach((css) => {
16+
const like = document.querySelector(css);
17+
if (like) {
18+
like.parentNode.remove();
19+
}
20+
});
2321

2422
/**
2523
* remove superflous footer text
@@ -35,17 +33,16 @@ if (copy) {
3533
*/
3634
const verse = document.querySelector("#verseAudio audio");
3735
if (verse) {
38-
verse.onended =
39-
() => {
40-
const A = document.querySelector(".verseNav .nextArrow a");
41-
// chapter end
42-
if (A.href === "javascript:;") {
43-
const B = document.querySelector(".chapterNav .nextArrow a");
44-
B.click();
45-
} else {
46-
A.click();
47-
}
48-
};
36+
verse.onended = () => {
37+
const A = document.querySelector(".verseNav .nextArrow a");
38+
// chapter end
39+
if (A.href === "javascript:;") {
40+
const B = document.querySelector(".chapterNav .nextArrow a");
41+
B.click();
42+
} else {
43+
A.click();
44+
}
45+
};
4946
try {
5047
verse.play();
5148
} catch (_) {}

rome.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"linter": {
3-
"enabled": true,
4-
"rules": {
5-
"recommended": true,
6-
"nursery": {
7-
"useConst": "error",
8-
"noAssignInExpressions": "off"
9-
}
10-
}
11-
}
12-
}
2+
"linter": {
3+
"enabled": true,
4+
"rules": {
5+
"recommended": true,
6+
"nursery": {
7+
"useConst": "error",
8+
"noAssignInExpressions": "off"
9+
}
10+
}
11+
}
12+
}

twitter.com/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { setup as setupS } from './sidebar.js';
2-
import { setup as setupT } from './trends.js';
1+
import { setup as setupS } from "./sidebar.js";
2+
import { setup as setupT } from "./trends.js";
33

44
setupT();
55
setupS(() => setupT());

youtube.com/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
* Show channel ID on pages that use "pretty" URLS
33
*/
44
if (
5-
/^\/(?:c|user)\//.test(location.pathname) || document.getElementById(
6-
"channel-header",
7-
)
5+
/^\/(?:c|user)\//.test(location.pathname) ||
6+
document.getElementById("channel-header")
87
) {
98
const chanId = document.createElement("a");
109
const meta = ytInitialData.metadata.channelMetadataRenderer;

0 commit comments

Comments
 (0)