It would be useful to tell codespell to ignore blocks of code.
A feature ignore-multiline-regex exists, which can be used to implement this:
...
$ codespell --ignore-multiline-regex \
'codespell:ignore-begin.*codespell:ignore-end'
...
Unfortunately there's a bug in codespell where using -w in
combination with --ignore-multiline-regex drops all newlines in the updated
file.
In absence of a fix, commit this solution disabled, to locally document the
current state of this feature.
# Ignore all URLs.
uri-ignore-words-list = *
+
+# This codespell issue (
+# https://github.com/codespell-project/codespell/issues/3381 ) reports the
+# need to have support for ignoring blocks of code.
+# A suggestion there is to use ignore-multiline-regex, which does work, but
+# has a bug: using -w drops all newlines in the updated files (
+# https://github.com/codespell-project/codespell/issues/3642 ).
+# Consequently, disabled. To be enabled when the bug is fixed.
+#ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end