Skip to content

Add isort CodeAction (sort imports on save) #1926

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

Merged
merged 4 commits into from
Jun 11, 2018

Conversation

n6g7
Copy link

@n6g7 n6g7 commented Jun 9, 2018

Fixes #156

This pull request:

  • Has a title summarizes what is changing
  • Includes a news entry file (remember to thank yourself!)
  • Has unit tests & code coverage is not adversely affected (within reason)
  • Works on all actively maintained versions of Python (e.g. Python 2.7 & the latest Python 3 release)
  • Works on Windows 10, macOS, and Linux (e.g. considered file system case-sensitivity)

This implements #156 (run isort on save) using Code actions.

I'll add a news entry and make sure to check the remaining checkboxes above asap, in the meantime any feedback is welcome. :)

@msftclas
Copy link

msftclas commented Jun 9, 2018

CLA assistant check
All CLA requirements met.

@codecov
Copy link

codecov bot commented Jun 9, 2018

Codecov Report

Merging #1926 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1926      +/-   ##
==========================================
+ Coverage   74.36%   74.38%   +0.02%     
==========================================
  Files         282      283       +1     
  Lines       13279    13287       +8     
  Branches     2387     2387              
==========================================
+ Hits         9875     9884       +9     
- Misses       3270     3272       +2     
+ Partials      134      131       -3
Impacted Files Coverage Δ
src/client/providers/codeActionsProvider.ts 100% <100%> (ø)
src/client/extension.ts 95.23% <100%> (+0.06%) ⬆️
src/client/debugger/mainV2.ts 77.91% <0%> (-2.01%) ⬇️
...rc/client/debugger/PythonProcessCallbackHandler.ts 54.27% <0%> (+0.65%) ⬆️
src/client/debugger/PythonProcess.ts 51.25% <0%> (+1.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e73764...de10073. Read the comment docs.

@n6g7
Copy link
Author

n6g7 commented Jun 10, 2018

I can't access the VSTS build output, so no idea why it breaks. Can someone clue me in?

@brettcannon brettcannon requested a review from DonJayamanne June 11, 2018 18:50
@brettcannon
Copy link
Member

@n6g7 it isn't you, so don't worry about it 😄 (we are planning to flip the "public" switch some time today actually.)

@danielcompton
Copy link

For others reading this, to turn it on you need to add this to your settings.json (workspace or global).

{
  "editor.codeActionsOnSave": {
    "source.organizeImports": true
  }
}

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run Isort when formatOnSave is on
5 participants