Skip to content

Commit fca2266

Browse files
authored
Release v2.6.2
2 parents 8b28fe6 + 1a612d3 commit fca2266

File tree

6 files changed

+82
-78
lines changed

6 files changed

+82
-78
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<major>`.`<minor>`.`<patch>`)
33

4+
## [v2.6.2]
5+
### Fixed
6+
* #107, #108 Change incorrect column index yielded for return annotation errors.
7+
48
## [v2.6.1]
59
### Changed
610
* Remove the explicitly pinned minor version ceiling for flake8.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can verify it's being picked up by invoking the following in your shell:
2222

2323
```bash
2424
$ flake8 --version
25-
3.9.0 (flake8-annotations: 2.6.1, mccabe: 0.6.1, pycodestyle: 2.7.0, pyflakes: 2.3.0) CPython 3.9.1 on Darwin
25+
3.9.0 (flake8-annotations: 2.6.2, mccabe: 0.6.1, pycodestyle: 2.7.0, pyflakes: 2.3.0) CPython 3.9.1 on Darwin
2626
```
2727

2828
## Table of Warnings

flake8_annotations/__init__.py

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

1818
PY_GTE_38 = False
1919

20-
__version__ = "2.6.1"
20+
__version__ = "2.6.2"
2121

2222
# The order of AST_ARG_TYPES must match Python's grammar
2323
# See: https://docs.python.org/3/library/ast.html#abstract-grammar
@@ -350,7 +350,7 @@ def colon_seeker(node: AST_FUNCTION_TYPES, lines: List[str]) -> Tuple[int, int]:
350350

351351
# Use str.rfind() to account for annotations on the same line, definition closure should
352352
# be the last : on the line
353-
def_end_col_offset = lines[def_end_lineno - 1].rfind(":") + 1
353+
def_end_col_offset = lines[def_end_lineno - 1].rfind(":")
354354

355355
return def_end_lineno, def_end_col_offset
356356

@@ -359,7 +359,7 @@ def _single_line_colon_seeker(node: AST_FUNCTION_TYPES, line: str) -> Tuple[int,
359359
"""Locate the closing colon for a single-line function definition."""
360360
col_start = node.col_offset
361361
col_end = node.body[0].col_offset
362-
def_end_col_offset = line.rfind(":", col_start, col_end) + 1
362+
def_end_col_offset = line.rfind(":", col_start, col_end)
363363

364364
return node.lineno, def_end_col_offset
365365

poetry.lock

Lines changed: 60 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "flake8-annotations"
3-
version = "2.6.1"
3+
version = "2.6.2"
44
description = "Flake8 Type Annotation Checks"
55
license = "MIT"
66
readme = "README.md"

0 commit comments

Comments
 (0)