mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 09:30:58 -07:00
Make merged settings non-nullable and fix all lints related to that. (#16647)
This commit is contained in:
@@ -127,7 +127,7 @@ describe('initializer', () => {
|
||||
});
|
||||
|
||||
it('should handle undefined auth type', async () => {
|
||||
mockSettings.merged.security!.auth!.selectedType = undefined;
|
||||
mockSettings.merged.security.auth.selectedType = undefined;
|
||||
const result = await initializeApp(
|
||||
mockConfig as unknown as Config,
|
||||
mockSettings,
|
||||
|
||||
@@ -39,13 +39,13 @@ export async function initializeApp(
|
||||
const authHandle = startupProfiler.start('authenticate');
|
||||
const authError = await performInitialAuth(
|
||||
config,
|
||||
settings.merged.security?.auth?.selectedType,
|
||||
settings.merged.security.auth.selectedType,
|
||||
);
|
||||
authHandle?.end();
|
||||
const themeError = validateTheme(settings);
|
||||
|
||||
const shouldOpenAuthDialog =
|
||||
settings.merged.security?.auth?.selectedType === undefined || !!authError;
|
||||
settings.merged.security.auth.selectedType === undefined || !!authError;
|
||||
|
||||
logCliConfiguration(
|
||||
config,
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('theme', () => {
|
||||
});
|
||||
|
||||
it('should return null if theme is undefined', () => {
|
||||
mockSettings.merged.ui!.theme = undefined;
|
||||
mockSettings.merged.ui.theme = undefined;
|
||||
const result = validateTheme(mockSettings);
|
||||
expect(result).toBeNull();
|
||||
expect(themeManager.findThemeByName).not.toHaveBeenCalled();
|
||||
|
||||
@@ -13,7 +13,7 @@ import { type LoadedSettings } from '../config/settings.js';
|
||||
* @returns An error message if the theme is not found, otherwise null.
|
||||
*/
|
||||
export function validateTheme(settings: LoadedSettings): string | null {
|
||||
const effectiveTheme = settings.merged.ui?.theme;
|
||||
const effectiveTheme = settings.merged.ui.theme;
|
||||
if (effectiveTheme && !themeManager.findThemeByName(effectiveTheme)) {
|
||||
return `Theme "${effectiveTheme}" not found.`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user