Skip to content

Bump flake8-annotations from 2.5.0 to 2.6.0#69

Merged
HassanAbouelela merged 1 commit into
mainfrom
dependabot/pip/flake8-annotations-2.6.0
Mar 7, 2021
Merged

Bump flake8-annotations from 2.5.0 to 2.6.0#69
HassanAbouelela merged 1 commit into
mainfrom
dependabot/pip/flake8-annotations-2.6.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Mar 7, 2021

Bumps flake8-annotations from 2.5.0 to 2.6.0.

Release notes

Sourced from flake8-annotations's releases.

Release v2.6.0

Changelog

[v2.6.0]

Added

  • #98 Add --dispatch-decorators to support suppression of all errors from functions decorated by decorators such as functools.singledispatch and functools.singledispatchmethod.
  • #99 Add --overload-decorators to support generic aliasing of the typing.overload decorator.

Fixed

  • #106 Fix incorrect parsing of multiline docstrings with less than two lines of content, causing incorrect line numbers for yielded errors in Python versions prior to 3.8

Additional Details

Generic Functions

Per #98, the functools.singledispatch and functools.singledispatchmethod decorators transform a function into a single-dispatch generic function.

For example:

import functools
@​functools.singledispatch
def foo(a):
print(a)
@​foo.register
def _(a: list) -> None:
for idx, thing in enumerate(a):
print(idx, thing)

Is correctly annotated but would previously yield linting errors for foo. In the spirit of the purpose of these decorators, linting errors are now suppressed for functions decorated with these decorators. The --dispatch-decorators configuration option has been added, which specifies a comma-separated list of decorators to be considered as dispatch decorators.

Decorators are matched based on their attribute name. For example, "singledispatch" will match any of the following:

  • import functools; @functools.singledispatch
  • import functools as fnctls; @fnctls.singledispatch
  • from functools import singledispatch; @singledispatch

By default, linting errors are suppressed for functions decorated by singledispatch or singledispatchmethod.

typing.overload decorator aliasing

Per #99, handling of the typing.overload has been made generic, removing the caveat from the initial implementation. The --overload-decorators configuration option has been added, which specifies a comma-separated list of decorators to be considered as typing.overload decorators.

Decorators are now matched based on their attribute name. For example, "overload" will match any of the following:

  • import typing; @typing.overload
  • import typing as t; @t.overload
  • from typing import overload; @overload

By default, linting errors are suppressed for functions decorated by overload, which should be a transparent change from v2.4 (#97).

Changelog

Sourced from flake8-annotations's changelog.

[v2.6.0]

Added

  • #98 Add --dispatch-decorators to support suppression of all errors from functions decorated by decorators such as functools.singledispatch and functools.singledispatchmethod.
  • #99 Add --overload-decorators to support generic aliasing of the typing.overload decorator.

Fixed

  • #106 Fix incorrect parsing of multiline docstrings with less than two lines of content, causing incorrect line numbers for yielded errors in Python versions prior to 3.8
Commits
  • 9058f8f Release v2.6.0
  • 1b72427 Fix bug in colon seeker for multiline docstrings in Py < 3.8
  • 94d61fc Add tests for contentless multiline docstrings
  • bd024db Adjust classifier return type annotation
  • d94e4a9 README & Classifier tweaks
  • c2d54f5 Misc type annotations cleanup
  • 4c416ba Slot Argument and Function objects
  • 777932b Add support for callable dispatch & overload decorators
  • ce4bfc8 Bump ver
  • b5888a4 Add dispatch decorator tests
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot Bot added the dependencies Pull requests that update a dependency file label Mar 7, 2021
@dependabot dependabot Bot force-pushed the dependabot/pip/flake8-annotations-2.6.0 branch from 8c95a2b to e3995a4 Compare March 7, 2021 01:25
@HassanAbouelela HassanAbouelela merged commit 167b87f into main Mar 7, 2021
@HassanAbouelela HassanAbouelela deleted the dependabot/pip/flake8-annotations-2.6.0 branch March 7, 2021 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant