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

bug: With ignore-multiline-regex set, --write doesn't work properly #3642

Open
spetrosi opened this issue Feb 12, 2025 · 0 comments
Open

bug: With ignore-multiline-regex set, --write doesn't work properly #3642

spetrosi opened this issue Feb 12, 2025 · 0 comments

Comments

@spetrosi
Copy link

When ignore-multiline-regex is set in config, and I run codespell -w, it removes newlines in edited files, which results in files being reformatted to a single line.

$ echo -e "Thsi line contains a typo\nWhile this line is correct" > test.txt
$ cat test.txt 
Thsi line contains a typo
While this line is correct
$ codespell test.txt 
> Thsi line contains a typo
test.txt:1: Thsi ==> This
$ codespell test.txt -w --ignore-multiline-regex="codespell:ignore-begin.*codespell:ignore-end"
FIXED: test.txt
$ cat test.txt 
$ cat test.txt 
This line contains a typoWhile this line is correct
@spetrosi spetrosi changed the title With ignore-multiline-regex set, --write doesn't work properly bug: With ignore-multiline-regex set, --write doesn't work properly Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant