Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports are incorrectly sorted and/or formatted. #20029

Closed
lishawa opened this issue Oct 18, 2022 · 8 comments · Fixed by microsoft/vscode-isort#125
Closed

Imports are incorrectly sorted and/or formatted. #20029

lishawa opened this issue Oct 18, 2022 · 8 comments · Fixed by microsoft/vscode-isort#125
Assignees
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on verified Verification succeeded
Milestone

Comments

@lishawa
Copy link

lishawa commented Oct 18, 2022

Type: Bug

Type:bug
Imports are incorrectly sorted and/or formatted.
I haven't touch any code.

Extension version: 2022.17.12911022
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:15:18.074Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
Connection to 'ssh-remote+3070' could not be established
Remote OS version: Linux x64 5.4.0-124-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 x 1800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 7.82GB (3.29GB free)
Process Argv --crash-reporter-id f334462b-f620-4a3a-8093-1188cfae587f
Screen Reader no
VM 0%

Connection to 'ssh-remote+3070' could not be established

Item Value
Remote SSH: Titan
OS Linux x64 5.4.0-124-generic
CPUs Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz (24 x 4200)
Memory (System) 62.50GB (32.11GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
2144e591:30553903
pyindex848:30577860
nodejswelcome1:30587005
40g7c324:30573242

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 18, 2022
@karthiknadig karthiknadig self-assigned this Oct 18, 2022
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Oct 18, 2022
@karthiknadig
Copy link
Member

You can ignore that if you have not edited the file. But the check comes from isort which now ships with the extension.

@karthiknadig
Copy link
Member

@luabud @cwebster-99 I think we need a setting to turn of import checking. What do you think?

@karthiknadig karthiknadig added area-formatting needs PR Ready to be worked on and removed triage-needed Needs assignment to the proper sub-team labels Oct 19, 2022
@karthiknadig karthiknadig added this to the October 2022 milestone Oct 19, 2022
@ctwardy
Copy link

ctwardy commented Oct 19, 2022

This StackOverlow says it's throwing this warning when there is only one import. (Hence properly sorted.)

Also that QuickFix solves the issue temporarily, and without changing the file. Warning reappears on close/open.

I'm seeing it flag a comment on either the first line of the file or the first import, regardless what import I put first. It offers no QuickFix.

@karthiknadig
Copy link
Member

@ctwardy the warning is shown based on what is seen when you run isort --check on that file. I am adding a setting to disable warnings from isort --check the fix is in PR microsoft/vscode-isort#125

@karthiknadig
Copy link
Member

@ctwardy you should be able to see the output from isort in Output > isort panel.

@ctwardy
Copy link

ctwardy commented Oct 19, 2022

OK, thanks, I'll take a look.

@xbbkok
Copy link

xbbkok commented Nov 14, 2022

@ctwardy the warning is shown based on what is seen when you run isort --check on that file. I am adding a setting to disable warnings from isort --check the fix is in PR microsoft/vscode-isort#125

@karthiknadig Can you exactly show the steps to solove the problem! I can not understand,Thanks

@karthiknadig
Copy link
Member

In settings.json, there is a setting isort.check. It is false by default. You can set it to true, and it will show Hint if imports are not sorted.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants