Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ applied directly, but should instead be manually inspected. E.g.:

clas->class, clash, disabled because of name clash in c++

4. Comments and blanks

Lines starting with "#" and blank lines are ignored. This is intended for
custom dictionaries (specified with the ``-D`` flag), and is not used by the
dictionaries distributed with codespell itself.

Development Setup
-----------------

Expand Down
2 changes: 2 additions & 0 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ def build_dict(
) -> None:
with open(filename, encoding="utf-8") as f:
for line in f:
if re.search(r"^\s*#|^\s*$", line):
continue
[key, data] = line.split("->")
# TODO for now, convert both to lower. Someday we can maybe add
# support for fixing caps.
Expand Down
3 changes: 3 additions & 0 deletions example/dict.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# this is a commented out line, and should be ignored
# the next line is blank, and should also be ignored:

tis->this
opem->open
buring->burying, burning, burin, during,
Expand Down