Skip to content

Commit

Permalink
Format '.pyi' type stub files.
Browse files Browse the repository at this point in the history
Closes #1151
  • Loading branch information
bwendling committed Nov 6, 2023
1 parent d004965 commit 486a5a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
### Changes
- Remove dependency on importlib-metadata
- Remove dependency on tomli when using >= py311
- Format '.pyi' type sub files.
### Fixed
- Fix SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED for one-item named argument lists
by taking precedence over SPLIT_BEFORE_NAMED_ASSIGNS.
Expand Down
2 changes: 1 addition & 1 deletion yapf/yapflib/file_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def IsIgnored(path, exclude):

def IsPythonFile(filename):
"""Return True if filename is a Python file."""
if os.path.splitext(filename)[1] == '.py':
if os.path.splitext(filename)[1] in frozenset({'.py', '.pyi'}):
return True

try:
Expand Down

0 comments on commit 486a5a2

Please sign in to comment.