alan-turing-institute / CleverCSV

CleverCSV is a Python package for handling messy CSV files. It provides a drop-in replacement for the builtin CSV module with improved dialect detection, and comes with a handy command line application for working with CSV files.
https://clevercsv.readthedocs.io
MIT License
1.24k stars 70 forks source link

Add pre-commit lint for invalid escape sequences and fix remaining error #93

Closed JakobGM closed 1 year ago

JakobGM commented 1 year ago

Hello again! 👋

Thanks for merging my previous PR, #90. I was still missing an invalid escape sequence in clevercsv.normal_form, so I fixed that and added a pre-commit hook to detect invalid escape sequences in the future. Sorry for the noise. I used ruff to add the lint to your pre-commit configuration, but only enabled the rule for detecting invalid escape sequences as I didn't want to force you to adhere to the entirety of ruffs ruleset. That would make this PR pretty noisy as well.

If you would like to only fix the invalid escape sequences, and not use ruff for detecting future ones, let me know and I will remove the ruff configuration from this PR.

Commits

GjjvdBurg commented 1 year ago

Thanks for this @JakobGM! I didn't know about ruff before, but it looks good. I'll enable the other rules soon as well.

JakobGM commented 1 year ago

Thanks for this @JakobGM! I didn't know about ruff before, but it looks good. I'll enable the other rules soon as well.

It is a relatively new linter, but it is gaining a lot of traction, mainly because of its speed. It is fast enough to run "on-write" directly in your IDE of choice. Glad to hear that you like it well:relaxed:

Thanks for merging the PR :bow: