-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
T: bugSomething isn't workingSomething isn't working
Description
Line ranges seem to format an entire file when the range goes to the end of the file
microsoft/vscode-black-formatter#472
- Take a file that is unformatted
- Set the line ranges to any portion as long as the last line is EOF
- The entire file is formatted
For example, take this code:
** Ensure empty last line **
abc = 'def'
ghi= 'jkl'
mno='pqr'
stu='vwx'And run it with these arguments:
black --line-ranges 4-5 file.pyThe resulting error is:
> cannot format file.py: INTERNAL ERROR: ...
Expected behavior
Only stu='vwx' being formatted, and not lines 1-3
Environment
- Black's version: 24.2.0
- OS and Python version: MacOS 14.3.1, Python 3.10.3
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
T: bugSomething isn't workingSomething isn't working