chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -25,7 +25,9 @@ export async function modelsListCommand(
const authStore = ensureAuthProfileStore();
const providerFilter = (() => {
const raw = opts.provider?.trim();
if (!raw) return undefined;
if (!raw) {
return undefined;
}
const parsed = parseModelRef(`${raw}/_`, DEFAULT_PROVIDER);
return parsed?.provider ?? raw.toLowerCase();
})();
@@ -66,7 +68,9 @@ export async function modelsListCommand(
if (opts.all) {
const sorted = [...models].toSorted((a, b) => {
const p = a.provider.localeCompare(b.provider);
if (p !== 0) return p;
if (p !== 0) {
return p;
}
return a.id.localeCompare(b.id);
});
@@ -74,7 +78,9 @@ export async function modelsListCommand(
if (providerFilter && model.provider.toLowerCase() !== providerFilter) {
continue;
}
if (opts.local && !isLocalBaseUrl(model.baseUrl)) continue;
if (opts.local && !isLocalBaseUrl(model.baseUrl)) {
continue;
}
const key = modelKey(model.provider, model.id);
const configured = configuredByKey.get(key);
rows.push(
@@ -95,8 +101,12 @@ export async function modelsListCommand(
continue;
}
const model = modelByKey.get(entry.key);
if (opts.local && model && !isLocalBaseUrl(model.baseUrl)) continue;
if (opts.local && !model) continue;
if (opts.local && model && !isLocalBaseUrl(model.baseUrl)) {
continue;
}
if (opts.local && !model) {
continue;
}
rows.push(
toModelRow({
model,