Skip to content

Releases: sco1/flake8-annotations

Release v1.2.0

10 Feb 22:56
a1d6c8f
Compare
Choose a tag to compare

[v1.2.0]

Added

  • Add test case for checking whether flake8 invokes our plugin
  • #41 Add --suppress-none-returning configuration option to suppress TYP200 level errors for functions that either lack a return statement or only explicitly return None.
  • Add black as an explicit developer requirement (codebase already adheres to black formatting)

Changed

  • #61 Migrate from Pipenv to Poetry for developer environment setup

Additional Details:

This release adds the --suppress-none-returning configuration option, as requested by #41. If this flag is set, TYP200-level errors are suppressed for functions that meet one of the following criteria:

  • Contain no return statement, or
  • Explicit return statement(s) all return None (explicitly or implicitly).

For example:

def foo():
    """This is a test function."""
    a = 2 + 2
    if a == 4:
        return None
    else:
        return

Will not yield a TYP201 error, with the flag set:

$ flake8 test.py
test.py:1:11: TYP201 Missing return type annotation for public function
$ flake8 test.py --suppress-none-returning
<No output>

And:

def foo():
    """This is a test function."""
    a = 2 + 2
    if a == 4:
        return True
    else:
        return

Will still yield a TYP201 error, with the flag set:

$ flake8 test.py
test.py:1:11: TYP201 Missing return type annotation for public function
$ flake8 test.py --suppress-none-returning
test.py:1:11: TYP201 Missing return type annotation for public function

The default value of this configuration option is False, so this addition should be transparent to existing users.

Release v1.1.3

20 Dec 13:55
704fab2
Compare
Choose a tag to compare

[v1.1.3]

Fixed

  • Add missing classifier test cases for POSONLYARGS
  • Re-add the tree argument to the checker so flake8 identifies the plugin as needing to run

Release v1.1.2

17 Dec 23:37
b3cdb41
Compare
Choose a tag to compare

[v1.1.2]

Changed

  • Request source from flake8 as lines of code rather than parsing it from the requested filename ourselves, allowing for proper parsing of stdin inputs
  • Remove flake8-string-format from dev dependencies, as str.format() isn't used anywhere

Fixed

  • #52 Fix error when invoking with stdin source code instead of a filename

Release v1.1.1

08 Dec 19:03
961819a
Compare
Choose a tag to compare

[v1.1.1]

Added

  • Add pipenv-setup as a dev dependency & CI check to ensure synchronization between Pipfile and setup.py
  • Add tox configuration for local testing across Python versions
  • Add test for checking a single yield of TYP301 per function
  • Add coverage reporting to test suite
  • Add testing for positional only arguments

Changed

  • typed_ast is now required only for Python versions < 3.8
  • Update flake8 minimum version to 3.7.9 for Python 3.8 compatibility
  • #50 Completely refactor test suite for maintainability

Fixed

  • Fix mixed type hint tests not being run due to misnamed test class
  • Fix TYP301 classification issue where error is not yielded if the first argument is type annotated and the remaining arguments have type comments

Release v1.1.0

25 Sep 16:14
2698f92
Compare
Choose a tag to compare

[v1.1.0]

Added

  • #35: Issue templates
  • #36: Support for PEP 484-style type comments
  • #36: Add TYP301 for presence of type comment & type annotation for same entity
  • #36: Add error_code.from_function class method to generate argument for an entire function
  • #38: Improve setup.py metadata

Fixed

  • #32: Incorrect line number for return values in the presence of multiline docstrings
  • #33: Improper handling of nested functions in class methods
  • setup.py dev dependencies out of sync with Pipfile
  • Incorrect order of arguments in Argument and Function __repr__ methods