Skip to content

Commit

Permalink
Added support for 'wrong new line character'
Browse files Browse the repository at this point in the history
  • Loading branch information
tamere-allo-peter committed May 4, 2022
1 parent 8b332a9 commit fbbe089
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ yamlfixer currently (as of 0.6.4) can fix the following problems as reported by
- trailing spaces (trailing-spaces)
- truthy value should be one of [false, true] (truthy)
- wrong indentation: expected
- wrong new line character: expected \\n
- wrong new line character: expected \\r\\n
An always up-to-date list of fixers can be obtained with `yamlfixer --listfixers`.
Expand Down
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ release :
* missing document end "..."
* found forbidden document end "..."
* found forbidden document start "---"
* wrong new line character: expected \\r\\n
* wrong new line character: expected \\n
* forbidden implicit octal value "%s"
* forbidden explicit octal value "%s"
* string value is not quoted with %s quotes
Expand Down
7 changes: 5 additions & 2 deletions yamlfixer/problemfixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ def fix_missing_docstart(self, left, right): # pylint: disable=unused-argument
self.ffixer.loffset += 1

def fix_newlineateof(self, left, right): # pylint: disable=unused-argument,no-self-use
"""Fix:
r"""Fix:
- no new line character at the end of file
- wrong new line character: expected \r\n
- wrong new line character: expected \n
""" # noqa: D205, D208, D400
# We simply ignore it, because we always add \n when dumping.
# We simply ignore it, because we always add \n when dumping
# and rely on universal newlines to handle them correctly.

def fix_truthy(self, left, right):
"""Fix:
Expand Down

0 comments on commit fbbe089

Please sign in to comment.