Skip to content

Commit 598b3b7

Browse files
authored
Merge pull request #55 from takker99/fix-ci
Run lint and format in CI
2 parents 7d917a0 + 5f2f87b commit 598b3b7

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ jobs:
88
- uses: actions/checkout@v2
99
- uses: denoland/setup-deno@v1
1010
with:
11-
deno-version: 1.15.3
12-
- run: deno test --allow-read --allow-write
11+
deno-version: 1.17.3
12+
- name: Check format
13+
run: deno fmt --check
14+
- name: Run lint
15+
run: deno lint
16+
- name: Run test
17+
run: deno test --allow-read --allow-write

.github/workflows/udd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: denoland/setup-deno@v1
1414
with:
15-
deno-version: 1.15.3
15+
deno-version: 1.17.3
1616
- name: Update dependencies
1717
run: |
1818
deno run -A https://deno.land/x/udd/main.ts deps.ts

main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ Optional arguments:
4848

4949
function version() {
5050
// FIXME this might be kinda a hacky way to do it...
51-
let u = new DenoLand(import.meta.url);
51+
const u = new DenoLand(import.meta.url);
5252
try {
5353
console.log(u.version());
54-
} catch (err) {
55-
console.log(undefined);
54+
} catch (e) {
55+
console.error(e);
5656
}
5757
}
5858

@@ -77,7 +77,7 @@ async function spawn(args: string[], cwd?: string): Promise<string> {
7777
}
7878

7979
async function upgrade() {
80-
let u = new DenoLand("https://deno.land/x/udd@0.x/main.ts");
80+
const u = new DenoLand("https://deno.land/x/udd@0.x/main.ts");
8181
const latestVersion = (await u.all())[0];
8282
const url = u.at(latestVersion).url;
8383
console.log(url);

mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class Udd {
9595

9696
try {
9797
new Semver(url.version());
98-
} catch (e) {
98+
} catch (_) {
9999
// The version string is a non-semver string like a branch name.
100100
await this.progress.log(`Skip updating: ${url.url}`);
101101
return { initUrl, initVersion };

progress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ export class Progress {
2323
}
2424

2525
export class SilentProgress extends Progress {
26-
async log(msg: string) {}
26+
async log(_: string) {}
2727
}

semver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function fragment(
115115
const s = new Semver(v || version);
116116
// we have to reverse this due to the way fragments work...
117117
return (other: Semver) => other._(t, s);
118-
} catch (e) {
118+
} catch (_) {
119119
throw new SyntaxError(`invalid semver version: ${v || version}`);
120120
}
121121
}

test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { udd, UddOptions, UddResult } from "./mod.ts";
22
import { RegistryCtor } from "./registry.ts";
3-
import {
4-
assert,
5-
assertEquals,
6-
assertThrowsAsync,
7-
FakeDenoLand,
8-
FakeRegistry,
9-
} from "./test_deps.ts";
3+
import { assertEquals, FakeDenoLand, FakeRegistry } from "./test_deps.ts";
104

115
async function testUdd(
126
before: string,

0 commit comments

Comments
 (0)