ultimate-pi 0.19.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/harness-decisions/SKILL.md +68 -2
- package/.agents/skills/harness-git-commit/SKILL.md +72 -0
- package/.agents/skills/harness-governor/SKILL.md +2 -2
- package/.agents/skills/harness-ls-lint-setup/SKILL.md +59 -0
- package/.agents/skills/harness-plan/SKILL.md +13 -11
- package/.agents/skills/harness-review/SKILL.md +1 -1
- package/.agents/skills/harness-sentrux-repair/SKILL.md +48 -0
- package/.agents/skills/sentrux/SKILL.md +4 -2
- package/.agents/skills/wiki-save/SKILL.md +1 -1
- package/.pi/PACKAGING.md +6 -0
- package/.pi/SYSTEM.md +21 -3
- package/.pi/agents/harness/ls-lint-steward.md +49 -0
- package/.pi/agents/harness/planning/decompose.md +4 -4
- package/.pi/agents/harness/reviewing/evaluator.md +1 -1
- package/.pi/agents/harness/running/executor.md +43 -2
- package/.pi/agents/harness/sentrux-repair-advisor.md +50 -0
- package/.pi/agents/pi-pi/prompt-expert.md +17 -2
- package/.pi/auto-commit.json +9 -2
- package/.pi/extensions/debate-orchestrator.ts +3 -0
- package/.pi/extensions/harness-anchored-edit.ts +139 -0
- package/.pi/extensions/harness-ask-user.ts +13 -34
- package/.pi/extensions/harness-debate-tools.ts +43 -4
- package/.pi/extensions/harness-live-widget.ts +28 -19
- package/.pi/extensions/harness-run-context.ts +278 -115
- package/.pi/extensions/harness-web-tools.ts +598 -471
- package/.pi/extensions/ls-lint-rules-sync.ts +103 -0
- package/.pi/extensions/observation-bus.ts +4 -0
- package/.pi/extensions/policy-gate.ts +270 -229
- package/.pi/extensions/sentrux-rules-sync.ts +2 -0
- package/.pi/extensions/soundboard.ts +48 -48
- package/.pi/harness/README.md +4 -0
- package/.pi/harness/agents.manifest.json +15 -7
- package/.pi/harness/agents.policy.yaml +47 -81
- package/.pi/harness/docs/adrs/0051-hash-anchored-executor-edits.md +41 -0
- package/.pi/harness/docs/adrs/0052-ls-lint-naming-lifecycle.md +45 -0
- package/.pi/harness/docs/adrs/0052-sentrux-structured-repair.md +38 -0
- package/.pi/harness/docs/adrs/0053-plan-task-clarification-gate.md +39 -0
- package/.pi/harness/docs/adrs/0054-harness-native-ask-user.md +40 -0
- package/.pi/harness/docs/adrs/0055-auto-commit-coauthor-lifecycle.md +40 -0
- package/.pi/harness/docs/adrs/README.md +7 -0
- package/.pi/harness/docs/practice-map.md +21 -5
- package/.pi/harness/evals/smoke/ls-lint-stub.json +10 -0
- package/.pi/harness/evolution/self-healing-rules.json +16 -0
- package/.pi/harness/ls-lint/naming.manifest.json +128 -0
- package/.pi/harness/sentrux/architecture.manifest.json +1 -1
- package/.pi/harness/specs/auto-commit.schema.json +63 -0
- package/.pi/harness/specs/ls-lint-manifest-proposal.schema.json +80 -0
- package/.pi/harness/specs/ls-lint-signal.schema.json +47 -0
- package/.pi/harness/specs/naming-manifest.schema.json +54 -0
- package/.pi/harness/specs/plan-task-clarification.schema.json +88 -0
- package/.pi/harness/specs/sentrux-diagnostics.schema.json +173 -0
- package/.pi/harness/specs/sentrux-repair-plan.schema.json +133 -0
- package/.pi/harness/specs/sentrux-report.schema.json +119 -0
- package/.pi/harness/specs/sentrux-signal.schema.json +34 -1
- package/.pi/lib/agents-policy.d.mts +26 -47
- package/.pi/lib/agents-policy.mjs +84 -29
- package/.pi/lib/agents-policy.ts +1 -0
- package/.pi/lib/agt/build-evaluation-context.ts +136 -64
- package/.pi/lib/ask-user/constants.mjs +3 -0
- package/.pi/lib/ask-user/constants.ts +4 -0
- package/.pi/lib/ask-user/contracts/glimpse-parse.ts +56 -0
- package/.pi/lib/ask-user/contracts/glimpse-payload-build.ts +58 -0
- package/.pi/lib/ask-user/contracts/glimpse-payload.ts +38 -0
- package/.pi/lib/ask-user/core/questionnaire.ts +74 -0
- package/.pi/lib/ask-user/dialog.ts +2 -314
- package/.pi/lib/ask-user/fallback.ts +2 -78
- package/.pi/lib/ask-user/format.ts +85 -0
- package/.pi/lib/ask-user/glimpseui.d.ts +10 -0
- package/.pi/lib/ask-user/index.ts +114 -0
- package/.pi/lib/ask-user/merge-task-clarification.ts +98 -0
- package/.pi/lib/ask-user/policy.mjs +43 -0
- package/.pi/lib/ask-user/policy.ts +104 -0
- package/.pi/lib/ask-user/presenters/glimpse.ts +130 -0
- package/.pi/lib/ask-user/presenters/headless.ts +131 -0
- package/.pi/lib/ask-user/presenters/select.ts +60 -0
- package/.pi/lib/ask-user/presenters/tui.ts +373 -0
- package/.pi/lib/ask-user/presenters/types.ts +13 -0
- package/.pi/lib/ask-user/render.ts +40 -9
- package/.pi/lib/ask-user/schema.ts +66 -13
- package/.pi/lib/ask-user/types.ts +60 -3
- package/.pi/lib/ask-user/validate-core.mjs +193 -7
- package/.pi/lib/ask-user/validate.ts +53 -34
- package/.pi/lib/harness-anchored-edit/.hash_anchors +1721 -0
- package/.pi/lib/harness-anchored-edit/anchor-state.ts +320 -0
- package/.pi/lib/harness-anchored-edit/apply-anchored-edits.ts +161 -0
- package/.pi/lib/harness-anchored-edit/edit-executor.ts +146 -0
- package/.pi/lib/harness-anchored-edit/index.ts +9 -0
- package/.pi/lib/harness-anchored-edit/line-protocol.ts +38 -0
- package/.pi/lib/harness-anchored-edit/package.json +3 -0
- package/.pi/lib/harness-anchored-edit/settings.ts +1 -0
- package/.pi/lib/harness-anchored-edit/task-id.ts +8 -0
- package/.pi/lib/harness-anchored-edit/types.ts +19 -0
- package/.pi/lib/harness-artifact-gate.ts +75 -21
- package/.pi/lib/harness-auto-commit-config.mjs +321 -0
- package/.pi/lib/harness-lens/clients/anchored-edit-autopatch.ts +158 -0
- package/.pi/lib/harness-lens/clients/lsp/client.ts +62 -39
- package/.pi/lib/harness-lens/clients/tool-policy.ts +73 -181
- package/.pi/lib/harness-lens/index.ts +246 -96
- package/.pi/lib/harness-lens/tools/lsp-navigation.ts +10 -8
- package/.pi/lib/harness-repair-brief.ts +84 -25
- package/.pi/lib/harness-run-context.ts +42 -52
- package/.pi/lib/harness-sentrux-parse.mjs +272 -0
- package/.pi/lib/harness-sentrux-root.mjs +78 -0
- package/.pi/lib/harness-slash-completions.ts +116 -0
- package/.pi/lib/harness-spawn-topology.ts +121 -87
- package/.pi/lib/harness-subagent-submit-registry.ts +10 -0
- package/.pi/lib/harness-subagents-bridge.ts +11 -6
- package/.pi/lib/harness-ui-state.ts +95 -48
- package/.pi/lib/plan-approval/dialog.ts +5 -0
- package/.pi/lib/plan-approval/validate.ts +1 -1
- package/.pi/lib/plan-approval-readiness.ts +32 -0
- package/.pi/lib/plan-debate-gate.ts +154 -114
- package/.pi/lib/plan-task-clarification.ts +158 -0
- package/.pi/prompts/harness-auto.md +2 -2
- package/.pi/prompts/harness-ls-lint-steward.md +43 -0
- package/.pi/prompts/harness-plan.md +58 -8
- package/.pi/prompts/harness-review.md +40 -6
- package/.pi/prompts/harness-run.md +33 -11
- package/.pi/prompts/harness-setup.md +72 -3
- package/.pi/prompts/harness-steer.md +3 -2
- package/.pi/prompts/wiki-save.md +5 -4
- package/.pi/scripts/README.md +8 -0
- package/.pi/scripts/generate-agents-policy-yaml.mjs +14 -2
- package/.pi/scripts/harness-anchored-edit-smoke.mjs +45 -0
- package/.pi/scripts/harness-auto-commit-bootstrap.mjs +96 -0
- package/.pi/scripts/harness-cli-verify.sh +47 -0
- package/.pi/scripts/harness-git-churn.mjs +77 -0
- package/.pi/scripts/harness-git-commit.mjs +173 -0
- package/.pi/scripts/harness-ls-lint-bootstrap.mjs +142 -0
- package/.pi/scripts/harness-ls-lint-cli.mjs +184 -0
- package/.pi/scripts/harness-seed-project-contracts.mjs +47 -0
- package/.pi/scripts/harness-sentrux-diagnostics.mjs +230 -0
- package/.pi/scripts/harness-sentrux-report.mjs +256 -0
- package/.pi/scripts/harness-verify.mjs +347 -117
- package/.pi/scripts/ls-lint-rules-sync.mjs +265 -0
- package/.pi/scripts/run-tests.mjs +65 -0
- package/.pi/settings.example.json +1 -0
- package/.sentrux/rules.toml +1 -1
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +31 -0
- package/README.md +13 -4
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/package.json +8 -3
- package/vendor/pi-subagents/src/agents.ts +5 -0
- package/vendor/pi-subagents/src/subagents.ts +22 -3
- package/vendor/pi-vcc/src/hooks/before-compact.ts +86 -60
- package/.pi/scripts/release.sh +0 -338
|
@@ -833,6 +833,60 @@ async function navRequest<T>(
|
|
|
833
833
|
}) as Promise<T | undefined>;
|
|
834
834
|
}
|
|
835
835
|
|
|
836
|
+
async function initializeLspOrThrow(input: {
|
|
837
|
+
connection: ReturnType<typeof createMessageConnection>;
|
|
838
|
+
root: string;
|
|
839
|
+
initialization?: Record<string, unknown>;
|
|
840
|
+
initializeTimeoutMs: number;
|
|
841
|
+
lspProcess: LSPProcess;
|
|
842
|
+
onStderr: (chunk: Buffer | string) => void;
|
|
843
|
+
}): Promise<Awaited<ReturnType<typeof safeSendRequest>>> {
|
|
844
|
+
const {
|
|
845
|
+
connection,
|
|
846
|
+
root,
|
|
847
|
+
initialization,
|
|
848
|
+
initializeTimeoutMs,
|
|
849
|
+
lspProcess,
|
|
850
|
+
onStderr,
|
|
851
|
+
} = input;
|
|
852
|
+
try {
|
|
853
|
+
return await withTimeout(
|
|
854
|
+
safeSendRequest(connection, "initialize", {
|
|
855
|
+
processId: process.pid,
|
|
856
|
+
rootUri: pathToFileURL(root).href,
|
|
857
|
+
workspaceFolders: [
|
|
858
|
+
{ name: "workspace", uri: pathToFileURL(root).href },
|
|
859
|
+
],
|
|
860
|
+
capabilities: {
|
|
861
|
+
window: { workDoneProgress: true },
|
|
862
|
+
workspace: {
|
|
863
|
+
workspaceFolders: true,
|
|
864
|
+
configuration: true,
|
|
865
|
+
didChangeWatchedFiles: { dynamicRegistration: true },
|
|
866
|
+
},
|
|
867
|
+
textDocument: {
|
|
868
|
+
synchronization: { didOpen: true, didChange: true },
|
|
869
|
+
publishDiagnostics: { versionSupport: true },
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
initializationOptions: initialization,
|
|
873
|
+
}),
|
|
874
|
+
initializeTimeoutMs,
|
|
875
|
+
);
|
|
876
|
+
} catch (err) {
|
|
877
|
+
const pid = lspProcess.pid;
|
|
878
|
+
void killProcessTree(lspProcess.process, pid);
|
|
879
|
+
setTimeout(() => {
|
|
880
|
+
if (!lspProcess.process.killed && process.platform !== "win32") {
|
|
881
|
+
lspProcess.process.kill("SIGKILL");
|
|
882
|
+
}
|
|
883
|
+
}, 2000);
|
|
884
|
+
throw err;
|
|
885
|
+
} finally {
|
|
886
|
+
(lspProcess.stderr as NodeJS.ReadableStream).off("data", onStderr);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
836
890
|
// --- Client Factory ---
|
|
837
891
|
|
|
838
892
|
export async function createLSPClient(options: {
|
|
@@ -987,45 +1041,14 @@ export async function createLSPClient(options: {
|
|
|
987
1041
|
connection.listen();
|
|
988
1042
|
setupConnectionLifecycle(state);
|
|
989
1043
|
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
],
|
|
999
|
-
capabilities: {
|
|
1000
|
-
window: { workDoneProgress: true },
|
|
1001
|
-
workspace: {
|
|
1002
|
-
workspaceFolders: true,
|
|
1003
|
-
configuration: true,
|
|
1004
|
-
didChangeWatchedFiles: { dynamicRegistration: true },
|
|
1005
|
-
},
|
|
1006
|
-
textDocument: {
|
|
1007
|
-
synchronization: { didOpen: true, didChange: true },
|
|
1008
|
-
publishDiagnostics: { versionSupport: true },
|
|
1009
|
-
},
|
|
1010
|
-
},
|
|
1011
|
-
initializationOptions: initialization,
|
|
1012
|
-
}),
|
|
1013
|
-
initializeTimeoutMs,
|
|
1014
|
-
);
|
|
1015
|
-
} catch (err) {
|
|
1016
|
-
// Hard-kill the hung process so it doesn't become a zombie.
|
|
1017
|
-
// SIGTERM alone is unreliable on Windows for cmd.exe/PowerShell trees.
|
|
1018
|
-
const pid = lspProcess.pid;
|
|
1019
|
-
void killProcessTree(lspProcess.process, pid);
|
|
1020
|
-
setTimeout(() => {
|
|
1021
|
-
if (!lspProcess.process.killed && process.platform !== "win32") {
|
|
1022
|
-
lspProcess.process.kill("SIGKILL");
|
|
1023
|
-
}
|
|
1024
|
-
}, 2000);
|
|
1025
|
-
throw err;
|
|
1026
|
-
} finally {
|
|
1027
|
-
(lspProcess.stderr as NodeJS.ReadableStream).off("data", onStderr);
|
|
1028
|
-
}
|
|
1044
|
+
const initResult = await initializeLspOrThrow({
|
|
1045
|
+
connection,
|
|
1046
|
+
root,
|
|
1047
|
+
initialization,
|
|
1048
|
+
initializeTimeoutMs,
|
|
1049
|
+
lspProcess,
|
|
1050
|
+
onStderr,
|
|
1051
|
+
});
|
|
1029
1052
|
|
|
1030
1053
|
if (initResult === undefined) {
|
|
1031
1054
|
const compactStderr = startupState.stderr
|
|
@@ -1132,13 +1132,81 @@ export interface AutofixPolicyContext {
|
|
|
1132
1132
|
hasBiomeConfig?: boolean;
|
|
1133
1133
|
}
|
|
1134
1134
|
|
|
1135
|
+
const JS_TS_EXTENSIONS = new Set([
|
|
1136
|
+
".js",
|
|
1137
|
+
".jsx",
|
|
1138
|
+
".ts",
|
|
1139
|
+
".tsx",
|
|
1140
|
+
".mjs",
|
|
1141
|
+
".cjs",
|
|
1142
|
+
]);
|
|
1143
|
+
const PY_EXTENSIONS = new Set([".py", ".pyi"]);
|
|
1144
|
+
const KOTLIN_EXTENSIONS = new Set([".kt", ".kts"]);
|
|
1145
|
+
|
|
1146
|
+
function staticLinterPolicy(
|
|
1147
|
+
runner: LintRunnerName,
|
|
1148
|
+
gate: ToolGate = "smart-default",
|
|
1149
|
+
defaultWhenUnconfigured = true,
|
|
1150
|
+
): LinterPolicy {
|
|
1151
|
+
return {
|
|
1152
|
+
runnerNames: [runner],
|
|
1153
|
+
preferredRunners: [runner],
|
|
1154
|
+
defaultRunner: runner,
|
|
1155
|
+
defaultWhenUnconfigured,
|
|
1156
|
+
gate,
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
const STATIC_LINTER_POLICY_BY_EXTENSION = new Map<string, LinterPolicy>([
|
|
1161
|
+
[".css", staticLinterPolicy("stylelint")],
|
|
1162
|
+
[".scss", staticLinterPolicy("stylelint")],
|
|
1163
|
+
[".sass", staticLinterPolicy("stylelint")],
|
|
1164
|
+
[".less", staticLinterPolicy("stylelint")],
|
|
1165
|
+
[".sql", staticLinterPolicy("sqlfluff")],
|
|
1166
|
+
[".rb", staticLinterPolicy("rubocop")],
|
|
1167
|
+
[".rake", staticLinterPolicy("rubocop")],
|
|
1168
|
+
[".gemspec", staticLinterPolicy("rubocop")],
|
|
1169
|
+
[".ru", staticLinterPolicy("rubocop")],
|
|
1170
|
+
[".yaml", staticLinterPolicy("yamllint")],
|
|
1171
|
+
[".yml", staticLinterPolicy("yamllint")],
|
|
1172
|
+
[".md", staticLinterPolicy("markdownlint")],
|
|
1173
|
+
[".mdx", staticLinterPolicy("markdownlint")],
|
|
1174
|
+
[".html", staticLinterPolicy("htmlhint")],
|
|
1175
|
+
[".htm", staticLinterPolicy("htmlhint")],
|
|
1176
|
+
[".toml", staticLinterPolicy("taplo")],
|
|
1177
|
+
[".rs", staticLinterPolicy("rust-clippy")],
|
|
1178
|
+
[".sh", staticLinterPolicy("shellcheck")],
|
|
1179
|
+
[".bash", staticLinterPolicy("shellcheck")],
|
|
1180
|
+
[".fish", staticLinterPolicy("fish-indent")],
|
|
1181
|
+
[".tf", staticLinterPolicy("tflint")],
|
|
1182
|
+
[".tfvars", staticLinterPolicy("tflint")],
|
|
1183
|
+
[".ex", staticLinterPolicy("credo")],
|
|
1184
|
+
[".exs", staticLinterPolicy("credo")],
|
|
1185
|
+
[".eex", staticLinterPolicy("credo")],
|
|
1186
|
+
[".heex", staticLinterPolicy("credo")],
|
|
1187
|
+
[".leex", staticLinterPolicy("credo")],
|
|
1188
|
+
[".c", staticLinterPolicy("cpp-check")],
|
|
1189
|
+
[".cc", staticLinterPolicy("cpp-check")],
|
|
1190
|
+
[".cpp", staticLinterPolicy("cpp-check")],
|
|
1191
|
+
[".cxx", staticLinterPolicy("cpp-check")],
|
|
1192
|
+
[".h", staticLinterPolicy("cpp-check")],
|
|
1193
|
+
[".hpp", staticLinterPolicy("cpp-check")],
|
|
1194
|
+
[".ino", staticLinterPolicy("cpp-check")],
|
|
1195
|
+
[".dart", staticLinterPolicy("dart-analyze")],
|
|
1196
|
+
[".gleam", staticLinterPolicy("gleam-check")],
|
|
1197
|
+
[".ps1", staticLinterPolicy("psscriptanalyzer")],
|
|
1198
|
+
[".psm1", staticLinterPolicy("psscriptanalyzer")],
|
|
1199
|
+
[".psd1", staticLinterPolicy("psscriptanalyzer")],
|
|
1200
|
+
[".prisma", staticLinterPolicy("prisma-validate")],
|
|
1201
|
+
]);
|
|
1202
|
+
|
|
1135
1203
|
export function getLinterPolicyForFile(
|
|
1136
1204
|
filePath: string,
|
|
1137
1205
|
context: LinterPolicyContext = {},
|
|
1138
1206
|
): LinterPolicy | undefined {
|
|
1139
1207
|
const ext = path.extname(filePath).toLowerCase();
|
|
1140
1208
|
|
|
1141
|
-
if (
|
|
1209
|
+
if (JS_TS_EXTENSIONS.has(ext)) {
|
|
1142
1210
|
const policy = getJstsLintPolicy({
|
|
1143
1211
|
hasEslintConfig: context.hasEslintConfig,
|
|
1144
1212
|
hasOxlintConfig: context.hasOxlintConfig,
|
|
@@ -1154,7 +1222,7 @@ export function getLinterPolicyForFile(
|
|
|
1154
1222
|
};
|
|
1155
1223
|
}
|
|
1156
1224
|
|
|
1157
|
-
if (
|
|
1225
|
+
if (PY_EXTENSIONS.has(ext)) {
|
|
1158
1226
|
const preferredRunners: LintRunnerName[] = ["ruff-lint"];
|
|
1159
1227
|
if (context.hasMypyConfig) preferredRunners.push("mypy");
|
|
1160
1228
|
return {
|
|
@@ -1166,77 +1234,11 @@ export function getLinterPolicyForFile(
|
|
|
1166
1234
|
};
|
|
1167
1235
|
}
|
|
1168
1236
|
|
|
1169
|
-
if ([".css", ".scss", ".sass", ".less"].includes(ext)) {
|
|
1170
|
-
return {
|
|
1171
|
-
runnerNames: ["stylelint"],
|
|
1172
|
-
preferredRunners: ["stylelint"],
|
|
1173
|
-
defaultRunner: "stylelint",
|
|
1174
|
-
defaultWhenUnconfigured: true,
|
|
1175
|
-
gate: "smart-default",
|
|
1176
|
-
};
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
if (ext === ".sql") {
|
|
1180
|
-
return {
|
|
1181
|
-
runnerNames: ["sqlfluff"],
|
|
1182
|
-
preferredRunners: ["sqlfluff"],
|
|
1183
|
-
defaultRunner: "sqlfluff",
|
|
1184
|
-
defaultWhenUnconfigured: true,
|
|
1185
|
-
gate: "smart-default",
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
if ([".rb", ".rake", ".gemspec", ".ru"].includes(ext)) {
|
|
1190
|
-
return {
|
|
1191
|
-
runnerNames: ["rubocop"],
|
|
1192
|
-
preferredRunners: ["rubocop"],
|
|
1193
|
-
defaultRunner: "rubocop",
|
|
1194
|
-
defaultWhenUnconfigured: true,
|
|
1195
|
-
gate: "smart-default",
|
|
1196
|
-
};
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
if ([".yaml", ".yml"].includes(ext)) {
|
|
1200
|
-
return {
|
|
1201
|
-
runnerNames: ["yamllint"],
|
|
1202
|
-
preferredRunners: ["yamllint"],
|
|
1203
|
-
defaultRunner: "yamllint",
|
|
1204
|
-
defaultWhenUnconfigured: true,
|
|
1205
|
-
gate: "smart-default",
|
|
1206
|
-
};
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
if ([".md", ".mdx"].includes(ext)) {
|
|
1210
|
-
return {
|
|
1211
|
-
runnerNames: ["markdownlint"],
|
|
1212
|
-
preferredRunners: ["markdownlint"],
|
|
1213
|
-
defaultRunner: "markdownlint",
|
|
1214
|
-
defaultWhenUnconfigured: true,
|
|
1215
|
-
gate: "smart-default",
|
|
1216
|
-
};
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
if ([".html", ".htm"].includes(ext)) {
|
|
1220
|
-
return {
|
|
1221
|
-
runnerNames: ["htmlhint"],
|
|
1222
|
-
preferredRunners: ["htmlhint"],
|
|
1223
|
-
defaultRunner: "htmlhint",
|
|
1224
|
-
defaultWhenUnconfigured: true,
|
|
1225
|
-
gate: "smart-default",
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
1237
|
if (path.basename(filePath).toLowerCase() === "dockerfile") {
|
|
1230
|
-
return
|
|
1231
|
-
runnerNames: ["hadolint"],
|
|
1232
|
-
preferredRunners: ["hadolint"],
|
|
1233
|
-
defaultRunner: "hadolint",
|
|
1234
|
-
defaultWhenUnconfigured: true,
|
|
1235
|
-
gate: "smart-default",
|
|
1236
|
-
};
|
|
1238
|
+
return staticLinterPolicy("hadolint");
|
|
1237
1239
|
}
|
|
1238
1240
|
|
|
1239
|
-
if (
|
|
1241
|
+
if (KOTLIN_EXTENSIONS.has(ext)) {
|
|
1240
1242
|
const preferredRunners: LintRunnerName[] = ["ktlint"];
|
|
1241
1243
|
if (context.hasDetektConfig) preferredRunners.push("detekt");
|
|
1242
1244
|
return {
|
|
@@ -1248,16 +1250,6 @@ export function getLinterPolicyForFile(
|
|
|
1248
1250
|
};
|
|
1249
1251
|
}
|
|
1250
1252
|
|
|
1251
|
-
if (ext === ".toml") {
|
|
1252
|
-
return {
|
|
1253
|
-
runnerNames: ["taplo"],
|
|
1254
|
-
preferredRunners: ["taplo"],
|
|
1255
|
-
defaultRunner: "taplo",
|
|
1256
|
-
defaultWhenUnconfigured: true,
|
|
1257
|
-
gate: "smart-default",
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
1253
|
if (ext === ".go") {
|
|
1262
1254
|
return {
|
|
1263
1255
|
runnerNames: ["golangci-lint"],
|
|
@@ -1278,107 +1270,7 @@ export function getLinterPolicyForFile(
|
|
|
1278
1270
|
};
|
|
1279
1271
|
}
|
|
1280
1272
|
|
|
1281
|
-
|
|
1282
|
-
return {
|
|
1283
|
-
runnerNames: ["rust-clippy"],
|
|
1284
|
-
preferredRunners: ["rust-clippy"],
|
|
1285
|
-
defaultRunner: "rust-clippy",
|
|
1286
|
-
defaultWhenUnconfigured: true,
|
|
1287
|
-
gate: "smart-default",
|
|
1288
|
-
};
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
if ([".sh", ".bash"].includes(ext)) {
|
|
1292
|
-
return {
|
|
1293
|
-
runnerNames: ["shellcheck"],
|
|
1294
|
-
preferredRunners: ["shellcheck"],
|
|
1295
|
-
defaultRunner: "shellcheck",
|
|
1296
|
-
defaultWhenUnconfigured: true,
|
|
1297
|
-
gate: "smart-default",
|
|
1298
|
-
};
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
if (ext === ".fish") {
|
|
1302
|
-
return {
|
|
1303
|
-
runnerNames: ["fish-indent"],
|
|
1304
|
-
preferredRunners: ["fish-indent"],
|
|
1305
|
-
defaultRunner: "fish-indent",
|
|
1306
|
-
defaultWhenUnconfigured: true,
|
|
1307
|
-
gate: "smart-default",
|
|
1308
|
-
};
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
if ([".tf", ".tfvars"].includes(ext)) {
|
|
1312
|
-
return {
|
|
1313
|
-
runnerNames: ["tflint"],
|
|
1314
|
-
preferredRunners: ["tflint"],
|
|
1315
|
-
defaultRunner: "tflint",
|
|
1316
|
-
defaultWhenUnconfigured: true,
|
|
1317
|
-
gate: "smart-default",
|
|
1318
|
-
};
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
if ([".ex", ".exs", ".eex", ".heex", ".leex"].includes(ext)) {
|
|
1322
|
-
return {
|
|
1323
|
-
runnerNames: ["credo"],
|
|
1324
|
-
preferredRunners: ["credo"],
|
|
1325
|
-
defaultRunner: "credo",
|
|
1326
|
-
defaultWhenUnconfigured: true,
|
|
1327
|
-
gate: "smart-default",
|
|
1328
|
-
};
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
if ([".c", ".cc", ".cpp", ".cxx", ".h", ".hpp", ".ino"].includes(ext)) {
|
|
1332
|
-
return {
|
|
1333
|
-
runnerNames: ["cpp-check"],
|
|
1334
|
-
preferredRunners: ["cpp-check"],
|
|
1335
|
-
defaultRunner: "cpp-check",
|
|
1336
|
-
defaultWhenUnconfigured: true,
|
|
1337
|
-
gate: "smart-default",
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
if (ext === ".dart") {
|
|
1342
|
-
return {
|
|
1343
|
-
runnerNames: ["dart-analyze"],
|
|
1344
|
-
preferredRunners: ["dart-analyze"],
|
|
1345
|
-
defaultRunner: "dart-analyze",
|
|
1346
|
-
defaultWhenUnconfigured: true,
|
|
1347
|
-
gate: "smart-default",
|
|
1348
|
-
};
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
if (ext === ".gleam") {
|
|
1352
|
-
return {
|
|
1353
|
-
runnerNames: ["gleam-check"],
|
|
1354
|
-
preferredRunners: ["gleam-check"],
|
|
1355
|
-
defaultRunner: "gleam-check",
|
|
1356
|
-
defaultWhenUnconfigured: true,
|
|
1357
|
-
gate: "smart-default",
|
|
1358
|
-
};
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
if ([".ps1", ".psm1", ".psd1"].includes(ext)) {
|
|
1362
|
-
return {
|
|
1363
|
-
runnerNames: ["psscriptanalyzer"],
|
|
1364
|
-
preferredRunners: ["psscriptanalyzer"],
|
|
1365
|
-
defaultRunner: "psscriptanalyzer",
|
|
1366
|
-
defaultWhenUnconfigured: true,
|
|
1367
|
-
gate: "smart-default",
|
|
1368
|
-
};
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
if (ext === ".prisma") {
|
|
1372
|
-
return {
|
|
1373
|
-
runnerNames: ["prisma-validate"],
|
|
1374
|
-
preferredRunners: ["prisma-validate"],
|
|
1375
|
-
defaultRunner: "prisma-validate",
|
|
1376
|
-
defaultWhenUnconfigured: true,
|
|
1377
|
-
gate: "smart-default",
|
|
1378
|
-
};
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
return undefined;
|
|
1273
|
+
return STATIC_LINTER_POLICY_BY_EXTENSION.get(ext);
|
|
1382
1274
|
}
|
|
1383
1275
|
|
|
1384
1276
|
export function getLinterPolicyForCwd(
|