Closed ajisaka closed 4 months ago
What is happening?
On Linux, when bump-pydantic is run on source code with Windows-style newline code (CRLF), the newline code is rewritten to LF. Changing newlines is not the expected behavior of this tool.
The reproduction method is as follows
$ echo -n 'from pydantic import BaseModel\r\nclass User(BaseModel):\r\n name: Optional[str]\r\n' > test.py
$ file test.py
test.py: Python script, ASCII text executable, with CRLF line terminators
$ rye run --pyproject ~/repos/bump-pydantic/pyproject.toml bump-pydantic .
[22:16:37] Start bump-pydantic. main.py:67
Found 1 file to process. main.py:82
[22:16:38] Refactored 1 files. main.py:150
Run successfully! main.py:160
$ file test.py
test.py: Python script, ASCII text executable
The output result of the file command is different between the first and second times.
Thanks!
Ensure that bump-pydantic command does not change the newline code.