ruff/crates
Micha Reiser f72ed255e5
chore: Use LF on all platforms (#3005)
I worked on #2993 and ran into issues that the formatter tests are failing on Windows because `writeln!` emits `\n` as line terminator on all platforms, but `git` on Windows converted the line endings in the snapshots to `\r\n`.

I then tried to replicate the issue on my Windows machine and was surprised that all linter snapshot tests are failing on my machine. I figured out after some time that it is due to my global git config keeping the input line endings rather than converting to `\r\n`. 

Luckily, I've been made aware of #2033 which introduced an "override" for the `assert_yaml_snapshot` macro that normalizes new lines, by splitting the formatted string using the platform-specific newline character. This is a clever approach and gives nice diffs for multiline fixes but makes assumptions about the setup contributors use and requires special care whenever we use line endings inside of tests. 

I recommend that we remove the special new line handling and use `.gitattributes` to enforce the use of `LF` on all platforms [guide](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). This gives us platform agnostic tests without having to worry about line endings in our tests or different git configurations.

## Note

It may be necessary for Windows contributors to run the following command to update the line endings of their files

```bash
git rm --cached -r .
git reset --hard
```
2023-02-20 20:13:37 +00:00
..
flake8_to_ruff Bump version to 0.0.249 (#3063) 2023-02-20 13:11:29 -05:00
ruff chore: Use LF on all platforms (#3005) 2023-02-20 20:13:37 +00:00
ruff_cli Bump version to 0.0.249 (#3063) 2023-02-20 13:11:29 -05:00
ruff_dev clean up to fix nightly clippy warnings and dedents (#3057) 2023-02-20 09:33:47 -05:00
ruff_formatter Increase expected size of FormatElement (#3049) 2023-02-20 12:47:35 -05:00
ruff_macros Add missing rust-version in crates (#3009) 2023-02-19 15:07:17 +00:00
ruff_python Relax constraints on pep8-naming module validation (#3043) 2023-02-19 17:34:23 -05:00
ruff_python_formatter clean up to fix nightly clippy warnings and dedents (#3057) 2023-02-20 09:33:47 -05:00
ruff_text_size Add missing rust-version in crates (#3009) 2023-02-19 15:07:17 +00:00