-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvalidate-shebangs.ts
More file actions
38 lines (32 loc) · 1.12 KB
/
validate-shebangs.ts
File metadata and controls
38 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license.
/**
* Shebang checker — placeholder for future shebang/executable validation.
*
* The previous check flagged any non-.ts/.js file with a shebang, which
* produced false positives for shell scripts and other scripting languages.
* That check was removed. Cross-platform exec-bit checking is not currently
* implemented.
*
* @module
*/
import * as standards from "@eserstack/standards";
import { createFileTool, type FileTool } from "./file-tool.ts";
export const tool: FileTool = createFileTool({
name: "validate-shebangs",
description: "Validate shebang/executable consistency",
canFix: false,
stacks: [],
defaults: {},
checkFile(_file, _content) {
return [];
},
});
export const run: FileTool["run"] = tool.run;
export const validator: FileTool["validator"] = tool.validator;
export const main: FileTool["main"] = tool.main;
if (import.meta.main) {
const { runCliMain } = await import("./cli-support.ts");
runCliMain(
await main(standards.crossRuntime.runtime.process.args as string[]),
);
}