mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-22 00:24:37 +00:00
Remove calls to `os.linesep
` and add misc. typing
This commit is contained in:
parent
f2b0c48536
commit
1cf4f30d5b
|
@ -16,7 +16,6 @@
|
|||
A way to create simple reports using python objects, primarily designed to be
|
||||
formatted as text and html.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
from io import StringIO
|
||||
from typing import TYPE_CHECKING, Iterator, List, TextIO, Union
|
||||
|
@ -59,7 +58,7 @@ class BaseWriter:
|
|||
|
||||
def writeln(self, string: str = "") -> None:
|
||||
"""write a line in the output buffer"""
|
||||
self.write(string + os.linesep)
|
||||
self.write(string + "\n")
|
||||
|
||||
def write(self, string: str) -> None:
|
||||
"""write a string in the output buffer"""
|
||||
|
|
|
@ -302,10 +302,11 @@ def _check_csv(value):
|
|||
return _splitstrip(value)
|
||||
|
||||
|
||||
def _comment(string):
|
||||
def _comment(string: str) -> str:
|
||||
"""return string as a comment"""
|
||||
lines = [line.strip() for line in string.splitlines()]
|
||||
return "# " + f"{os.linesep}# ".join(lines)
|
||||
sep = "\n"
|
||||
return "# " + f"{sep}# ".join(lines)
|
||||
|
||||
|
||||
def _format_option_value(optdict, value):
|
||||
|
|
Loading…
Reference in New Issue
Block a user