Skip to content

Commit a2937d4

Browse files
authored
Avoid inline config warning when value is null (#705)
## Summary fixup from #702 ## Test Plan Verified that `null` (not setting `ruff.configuration`) doesn't give me the warning.
1 parent 7c6b464 commit a2937d4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/common/settings.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,9 @@ export function checkInlineConfigSupport(ruffVersion: VersionInfo, serverId: str
345345
}
346346

347347
getWorkspaceFolders().forEach((workspace) => {
348-
const config = getConfiguration(serverId, workspace.uri).get<string | object>("configuration");
349-
if (typeof config === "object") {
348+
const config =
349+
getConfiguration(serverId, workspace.uri).get<string | object>("configuration") ?? null;
350+
if (config !== null && typeof config === "object") {
350351
const message = `Inline configuration support was added in Ruff ${versionToString(
351352
INLINE_CONFIGURATION_VERSION,
352353
)} (current version is ${versionToString(

0 commit comments

Comments
 (0)