GitXplorerGitXplorer
s

flake8-typing-as-t

public
3 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
a47e7352289324d465e613f2876447fbe2630e8b

Remove readme badges

ssirosen committed 2 months ago
Unverified
1e61fe906fe21b1e630aec8ed012e6ce2fea027c

Bump version in package to 1.0

ssirosen committed 2 months ago
Unverified
173a188e023e72a08f8e90a14ff449ff03ea73d9

Switch to flit for packaging

ssirosen committed 2 months ago
Unverified
e1b6e574c339c8f4368b2dfe7e252936604b7544

Update email address in metadata

ssirosen committed 2 months ago
Unverified
ea9de5911973c478829a14e22e3a351c46bebc83

Update metadata for 1.0.0

ssirosen committed 2 months ago
Unverified
ad4efde9667f0a609e3f834a88496c18b1b2ad89

Add pre-commit config

ssirosen committed 2 months ago

README

The README file for this repository.

flake8-typing-as-t

Table of Contents

Overview

This is a flake8 plugin which ensures that imports from the typing library must be written using import typing as t.

Installation

pip install flake8-typing-as-t

Checks

  • TYT01: Bare import typing usage
  • TYT02: import typing as X where X is not literal t
  • TYT03: from typing import X usage

Handling typing-extensions

A common pattern for compatibility is to do a sys.version_info-guarded dispatch over typing_extensions. e.g.

if sys.version_info < (3, 8):
    from typing_extensions import Literal
else:
    from typing import Literal

flake8-typing-as-t allows for this usage by checking if the import is inside of a test on sys.version_info against a tuple.

License

flake8-typing-as-t is distributed under the terms of the MIT license.

Changelog

1.0.0

  • Initial production release

0.0.3

  • Internal refactoring for improved performance

0.0.2

  • Add support for sys.version_info dispatch

0.0.1

  • Initial release