Skip to content

Commit

Permalink
fix(sortImports): run ruff check
Browse files Browse the repository at this point in the history
Closes #1095
  • Loading branch information
fannheyward committed Jul 8, 2024
1 parent 1a7ebf0 commit 65e18b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/sortImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ function getSortProviderInfo(provider: SortProvider): ExecutionInfo {
const pythonSettings = PythonSettings.getInstance();
const modulePath = provider === 'isort' ? pythonSettings.sortImports.path : pythonSettings.linting.ruffPath;
const execPath = which.sync(workspace.expand(modulePath), { nothrow: true }) || '';
let args = ['--diff'];
let args: string[] = [];
if (provider === 'isort') {
args = ['--diff'];
for (const item of pythonSettings.sortImports.args) {
args.push(workspace.expand(item));
}
} else if (provider === 'ruff') {
args = args.concat(['--quiet', '--select', 'I001']);
args = ['check', '--diff'].concat(['--quiet', '--select', 'I001']);
}

return { execPath, args };
Expand Down

0 comments on commit 65e18b9

Please sign in to comment.