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

LF will be replaced by CRLF the next time Git touches it , ruff-format Failed forever. #102

Open
linpan opened this issue Oct 24, 2024 · 3 comments
Labels
question Further information is requested

Comments

@linpan
Copy link

linpan commented Oct 24, 2024

pycham on windows ,

`- repo: https://github.com/astral-sh/ruff-pre-commit

Ruff version.

rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format`

LF will be replaced by CRLF the next time Git touches it

@MichaReiser
Copy link
Member

Hi @linpan

I'm struggling reproducing the issue. Could you help me by sharing your ruff configuration and describing what steps you took and when git replaces LF with CRLF?

@remchuk
Copy link

remchuk commented Jan 21, 2025

it usually happens when working on both linux and windows, each of the kernels treat files differently.

@MichaReiser
Copy link
Member

Can you tell me more about your setup. Are you using Windows with WSL or how do you run ruff on windows vs linux? Do they share a common directory? Do you use any git newline normalization or do you rely on git's default (which uses \r\n on Windows and \n on linux).

You might want to give the line-ending setting a try and e.g. use lf if you want to use \n on all platforms

@MichaReiser MichaReiser added the question Further information is requested label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants