diff --git a/pydocstringformatter/formatting/formatter.py b/pydocstringformatter/formatting/formatter.py index b576dbb2..f9f0f0a5 100644 --- a/pydocstringformatter/formatting/formatter.py +++ b/pydocstringformatter/formatting/formatter.py @@ -65,7 +65,7 @@ class FinalPeriodFormatter(StringAndQuotesFormatter): """Add a period to the end of single line docstrings and summaries.""" name = "final-period" - END_OF_SENTENCE_PUNCTUATION = {".", "?", "!", "‽"} + END_OF_SENTENCE_PUNCTUATION = {".", "?", "!", "‽", ":", ";"} def _treat_string( self, diff --git a/tests/data/format/final_period/exotic_line_ending.py b/tests/data/format/final_period/exotic_line_ending.py new file mode 100644 index 00000000..ed87a587 --- /dev/null +++ b/tests/data/format/final_period/exotic_line_ending.py @@ -0,0 +1,11 @@ +def function(): + """Check the name of first argument, expect: + + *'self' for a regular method + *'cls' for a class method or a metaclass regular method""" + +def function(): + """This has peculiar line ending; + + but it should not matter. + """ diff --git a/tests/data/format/final_period/exotic_line_ending.py.out b/tests/data/format/final_period/exotic_line_ending.py.out new file mode 100644 index 00000000..302b9cd7 --- /dev/null +++ b/tests/data/format/final_period/exotic_line_ending.py.out @@ -0,0 +1,13 @@ +def function(): + """Check the name of first argument, expect: + + *'self' for a regular method + *'cls' for a class method or a metaclass regular method + """ + +def function(): + """This has peculiar line ending; + + but it should not matter. + + """