Comments (11)
I believe you're looking for --print-only
?
from reorder-python-imports.
My bad. Does this support reading STDIN as well (AFK, so I can't check right now)?
from reorder-python-imports.
reorder-python-imports /dev/stdin --print-only
should work:
$ echo -e 'import os\nimport pre_commit\nimport sys' | reorder-python-imports /dev/stdin --print-only
==> /dev/stdin <==
import os
import sys
import pre_commit
from reorder-python-imports.
(note that the ==> /dev/stdin <==
output goes to stderr)
from reorder-python-imports.
closing: if --print-only
doesn't satisfy your usecase please provide additional context and I'll reopen :)
from reorder-python-imports.
Sorry, forgot about this. It needs to output specifically to STDOUT rather than STDERR since most editor formatter plugins only read STDOUT. Plus, it's not really an error as such, so it shouldn't be redirected there.
from reorder-python-imports.
it does, you haven't tried it have you :P
from reorder-python-imports.
You're right, I didn't. I misread the sentence "(note that the ==> /dev/stdin <==
output goes to stderr)". I thought you meant all of it was redirected to STDERR rather than just that literal line. My bad.
from reorder-python-imports.
On the other hand, I don't think Windows supports /dev/stdin
. I don't use Windows, but I'd expect other people do.
from reorder-python-imports.
If someone on windows wants the feature then we'll talk -- as it is it hasn't been an ask so far and if I'm not going to use it and you're not going to use it there's no point in complicating this tool
from reorder-python-imports.
I'm trying to implement emacs support for this fine tool. This would be a little easier if --print-only
always printed the result, whether there was a reordering or not. Is that possible?
from reorder-python-imports.
Related Issues (20)
- Not numerically sorting HOT 2
- Sylink dirs treated as 3rd party modules HOT 6
- Option to disable import replacement HOT 1
- triple-quoted docstring with trailing backslash silently prevents reordering HOT 2
- Performance impact in having a single import per line HOT 3
- disable remove duplicates in argument HOT 1
- Support for ignoring certain files HOT 1
- Removes blank lines between comments HOT 2
- Relative import ordering HOT 10
- add-import with module without imports HOT 1
- Adding prober ignore files HOT 1
- can you please add the lxml library. HOT 9
- Support pyproject.toml
- winreg missing from six._moved_attributes on non-Windows platforms
- Better support for `_typeshed` imports HOT 2
- Allow grouping of from imports HOT 1
- Clash with black formatter (new line after module docstring) HOT 3
- Black `24.1.1` Conflict HOT 1
- Reorder python imports conflict with Black
- Contradict with black HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reorder-python-imports.