Skip to content

Commit

Permalink
License check
Browse files Browse the repository at this point in the history
  • Loading branch information
j3lte committed Nov 22, 2023
1 parent c707abf commit 4ce8874
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: deno lint

- name: Check license
run: deno run check:license
run: deno task check:license

- name: Tests
run: deno task test
Expand Down
1 change: 0 additions & 1 deletion dev_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ export { emptyDir } from "https://deno.land/std@0.207.0/fs/mod.ts";
export { MockFetch } from "https://deno.land/x/deno_mock_fetch@1.0.1/mod.ts";
export { resolvesNext, stub } from "https://deno.land/std@0.207.0/testing/mock.ts";
export { walk } from "https://deno.land/std@0.207.0/fs/walk.ts";
export { globToRegExp } from "https://deno.land/std@0.207.0/path/glob.ts";
6 changes: 3 additions & 3 deletions scripts/check-license.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2023 J.W. Lagendijk. All rights reserved. MIT license.

import { globToRegExp, walk } from "../dev_deps.ts";
import { walk } from "../dev_deps.ts";

const EXTENSIONS = [".ts"];
const EXCLUDED_DIRS = ["cov"];

const ROOT = new URL("../", import.meta.url);
const CHECK = Deno.args.includes("--check");
Expand All @@ -19,14 +18,15 @@ for await (
const { path } of walk(ROOT, {
exts: EXTENSIONS,
skip: [
...EXCLUDED_DIRS.map((path) => globToRegExp(path)),
/\.coverage/,
/node_modules/,
/npm/,
/_local_testing\.ts/,
],
includeDirs: false,
})
) {
console.log("Checking " + path);
const content = await Deno.readTextFile(path);
const match = content.match(RX_COPYRIGHT);

Expand Down

0 comments on commit 4ce8874

Please sign in to comment.