ruff/scripts
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
..
benchmarks refactor: Introduce crates folder (#2088) 2023-02-05 16:47:48 -05:00
_utils.py Update .pre-commit-config.yml (#2139) 2023-01-24 19:45:34 -05:00
add_plugin.py chore: Use LF on all platforms (#3005) 2023-02-20 20:13:37 +00:00
add_rule.py many-to-one 6/9: Implement ruff_macros::map_codes 2023-02-14 16:16:12 -05:00
generate_known_standard_library.py Move python into its own ruff_python crate (#2593) 2023-02-05 17:53:58 -05:00
generate_mkdocs.py Fix documentation-link detection in generate_mkdocs.py (#3030) 2023-02-19 12:20:44 +00:00
pyproject.toml Remove autogenerated docs/rules/*.md files 2023-02-13 19:34:06 -05:00
transform_readme.py Fix hardcoded url in transform_readme.py (#2487) 2023-02-02 13:59:22 -05:00