Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Sep 27, 2023
1 parent 3ad80f4 commit 2cd5d1f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/common/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,23 @@ export function checkIfConfigurationChanged(e: ConfigurationChangeEvent, namespa
return changed.includes(true);
}

export function logDefaultFormatter():void {
export function logDefaultFormatter(): void {
getWorkspaceFolders().forEach((workspace) => {
let config = getConfiguration('editor', { uri: workspace.uri, languageId: 'python' });
if (!config){
if (!config) {
config = getConfiguration('editor', workspace.uri);
if (!config){
if (!config) {
traceInfo('Unable to get editor configuration');
}
}
const formatter = config.get<string>('defaultFormatter', '');
traceInfo(`Default formatter is set to ${formatter} for workspace ${workspace.uri.fsPath}`);
if (formatter !== EXTENSION_ID){
if (formatter !== EXTENSION_ID) {
traceWarn(`Black Formatter is NOT set as the default formatter for workspace ${workspace.uri.fsPath}`);
traceWarn('To set Black Formatter as the default formatter, add the following to your settings.json file:');
traceWarn(`\n"[python]": {\n "editor.defaultFormatter": "${EXTENSION_ID}",\n "editor.formatOnSave": true\n}`);
traceWarn(
`\n"[python]": {\n "editor.defaultFormatter": "${EXTENSION_ID}",\n "editor.formatOnSave": true\n}`,
);
}
});
}

0 comments on commit 2cd5d1f

Please sign in to comment.