Skip to content

Commit

Permalink
Merge branch 'main' into comment-in-long-arg-list
Browse files Browse the repository at this point in the history
  • Loading branch information
bwendling authored Nov 8, 2023
2 parents cc2b6a7 + 486a5a2 commit 435e198
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-docstring-first
Expand Down
15 changes: 7 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
# All notable changes to this project will be documented in this file.
# This project adheres to [Semantic Versioning](http://semver.org/).

## (0.40.3) UNRELEASED
### Changes
- Remove dependency on importlib-metadata
- Remove dependency on tomli when using >= py311
## (0.41.0) UNRELEASED
### Added

#### New `DISABLE_SPLIT_LIST_WITH_COMMENT` flag
- `DISABLE_SPLIT_LIST_WITH_COMMENT` is a new knob that changes the
- New `DISABLE_SPLIT_LIST_WITH_COMMENT` flag.
`DISABLE_SPLIT_LIST_WITH_COMMENT` is a new knob that changes the
behavior of splitting a list when a comment is present inside the list.

Before, we split a list containing a comment just like we split a list
Expand Down Expand Up @@ -70,7 +66,10 @@
Note the behavioral change above; if you set
`DISABLE_ENDING_COMMA_HEURISTIC=true` and want to keep the old behavior, you
now also need to set `DISABLE_SPLIT_LIST_WITH_COMMENT=true`.

### 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 435e198

Please sign in to comment.