Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 6a4fed9

Browse files
authored
Fix --source flag (#536)
* fix --source * update release_notes.rst
1 parent cf29c32 commit 6a4fed9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/release_notes.rst

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Release Notes
88
Current Development Version
99
---------------------------
1010

11+
Bug Fixes
12+
13+
* Split ``--source`` by lines instead of by characters (#536).
1114

1215
6.1.0 - May 17th, 2021
1316
---------------------------

src/pydocstyle/violations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def lines(self) -> str:
6363
if self.definition is None:
6464
return ''
6565
source = ''
66-
lines = self.definition.source
66+
lines = self.definition.source.splitlines(keepends=True)
6767
offset = self.definition.start # type: ignore
6868
lines_stripped = list(
6969
reversed(list(dropwhile(is_blank, reversed(lines))))

0 commit comments

Comments
 (0)