Skip to content

Commit 5788314

Browse files
committed
Format codebase with FinalPeriodFormatter
1 parent c3d7578 commit 5788314

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

pydocstringformatter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def run_docstring_formatter(argv: Union[List[str], None] = None) -> None:
15-
"""Run the formatter"""
15+
"""Run the formatter."""
1616
from pydocstringformatter.run import _Run
1717

1818
_Run(argv or sys.argv[1:])

pydocstringformatter/formatting/formatter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class BeginningQuotesFormatter(StringFormatter):
8-
"""Fix the position of the opening quotes"""
8+
"""Fix the position of the opening quotes."""
99

1010
name = "beginning-quotes"
1111

@@ -17,12 +17,12 @@ def _treat_string(self, tokeninfo: tokenize.TokenInfo) -> str:
1717

1818

1919
class ClosingQuotesFormatter(StringFormatter):
20-
"""Fix the position of the closing quotes"""
20+
"""Fix the position of the closing quotes."""
2121

2222
name = "closing-quotes"
2323

2424
def _treat_string(self, tokeninfo: tokenize.TokenInfo) -> str:
25-
"""Fix the position of end quotes for multi-line docstrings"""
25+
"""Fix the position of end quotes for multi-line docstrings."""
2626
new_string = tokeninfo.string
2727
if "\n" not in new_string:
2828
# Not a multiline docstring, nothing to do

pydocstringformatter/run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pylint: disable=too-few-public-methods, protected-access
2-
"""Run class"""
2+
"""Run class."""
33

44
import argparse
55
import os
@@ -12,7 +12,7 @@
1212

1313

1414
class _Run:
15-
"""Main class that represent a run of the program"""
15+
"""Main class that represent a run of the program."""
1616

1717
def __init__(self, argv: Union[List[str], None]) -> None:
1818
self.arg_parser = utils._register_arguments(__version__)
@@ -27,12 +27,12 @@ def __init__(self, argv: Union[List[str], None]) -> None:
2727
self.arg_parser.print_help()
2828

2929
def _check_files(self, arguments: List[str]) -> None:
30-
"""Find all files and perform the formatting"""
30+
"""Find all files and perform the formatting."""
3131
filepaths = utils._find_python_files(arguments)
3232
self._format_files(filepaths)
3333

3434
def _format_file(self, filename: Path) -> bool:
35-
"""Format a file"""
35+
"""Format a file."""
3636
changed_tokens: List[tokenize.TokenInfo] = []
3737
is_changed = False
3838

@@ -78,7 +78,7 @@ def _format_file(self, filename: Path) -> bool:
7878
return is_changed
7979

8080
def _format_files(self, filepaths: List[Path]) -> None:
81-
"""Format a list of files"""
81+
"""Format a list of files."""
8282
is_changed = False
8383

8484
for file in filepaths:

pydocstringformatter/utils/argument_parsing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
def _parse_command_line_arguments(
1313
parser: argparse.ArgumentParser, args: List[str], namespace: argparse.Namespace
1414
) -> None:
15-
"""Parse all arguments on the provided argument parser"""
15+
"""Parse all arguments on the provided argument parser."""
1616
parser.parse_known_args(args, namespace)
1717

1818

1919
def _register_arguments(version: str) -> argparse.ArgumentParser:
20-
"""Create an argument parser and add all supported arguments"""
20+
"""Create an argument parser and add all supported arguments."""
2121
parser = argparse.ArgumentParser(prog="pydocstringformatter")
2222

2323
parser.add_argument("files", nargs="*", type=str)
@@ -41,7 +41,7 @@ def _register_arguments(version: str) -> argparse.ArgumentParser:
4141

4242

4343
def _get_toml_file() -> Optional[Dict[str, Any]]:
44-
"""See if there is a pyproject.toml and extract the correct section if it exists"""
44+
"""See if there is a pyproject.toml and extract the correct section if it exists."""
4545
if os.path.isfile("pyproject.toml"):
4646
with open("pyproject.toml", "rb") as file:
4747
try:
@@ -56,7 +56,7 @@ def _get_toml_file() -> Optional[Dict[str, Any]]:
5656

5757

5858
def _parse_toml_option(opt: str, value: Any) -> List[str]:
59-
"""Parse an options value in the correct argument type for argparse"""
59+
"""Parse an options value in the correct argument type for argparse."""
6060
try:
6161
action = OPTIONS_TYPES[opt]
6262
except KeyError as exc:
@@ -72,7 +72,7 @@ def _parse_toml_option(opt: str, value: Any) -> List[str]:
7272
def _parse_toml_file(
7373
parser: argparse.ArgumentParser, namespace: argparse.Namespace
7474
) -> None:
75-
"""Get and parse the relevant section form a pyproject.toml file"""
75+
"""Get and parse the relevant section form a pyproject.toml file."""
7676
if toml_sect := _get_toml_file():
7777
arguments: List[str] = []
7878

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
class PydocstringFormatterError(Exception):
2-
"""Base class to inherit all exceptions from"""
2+
"""Base class to inherit all exceptions from."""
33

44

55
class ParsingError(PydocstringFormatterError):
6-
"""Raised when we the parsing of a file failed"""
6+
"""Raised when we the parsing of a file failed."""
77

88

99
class UnrecognizedOption(PydocstringFormatterError):
10-
"""Raised when an option is encountered that is not recognized"""
10+
"""Raised when an option is encountered that is not recognized."""
1111

1212

1313
class TomlParsingError(PydocstringFormatterError):
14-
"""Raised when there are errors with the parsing of the toml file"""
14+
"""Raised when there are errors with the parsing of the toml file."""

pydocstringformatter/utils/find_docstrings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def _is_docstring(
88
tokeninfo: tokenize.TokenInfo, previous_token: tokenize.TokenInfo
99
) -> bool:
10-
"""Check if a token represents a docstring"""
10+
"""Check if a token represents a docstring."""
1111
if (
1212
tokeninfo.type == token.STRING
1313
and (

pydocstringformatter/utils/find_python_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55

66
def _is_python_file(filename: str) -> bool:
7-
"""Check if file is a Python file"""
7+
"""Check if file is a Python file."""
88
return filename.endswith(".py")
99

1010

1111
def _find_python_files(filenames: List[str], recursive: bool = True) -> List[Path]:
12-
"""Find all python files for a list of potential file and directory names"""
12+
"""Find all python files for a list of potential file and directory names."""
1313
pathnames: List[Path] = []
1414

1515
for name in filenames:

0 commit comments

Comments
 (0)