GitXplorerGitXplorer
J

stublint

public
10 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
245a44efd902c8dcb1c0f649a7e68a4f42c5d383

add to README

JJelleZijlstra committed 8 years ago
Unverified
55bb78b596963cb17407ff85f6e62bd92b6652c8

only complain about missing arguments if there are annotated arguments

JJelleZijlstra committed 8 years ago
Unverified
7bd0ffe392fbcfc46b059f70e4cd89195869f2e5

update docs

JJelleZijlstra committed 8 years ago
Unverified
9cee5ff30937b083d217dc405d58fdf7c6e2e135

drop default value check, doesn't seem worth it

JJelleZijlstra committed 8 years ago
Unverified
cf9baf22db103a37214144d895bf3718e43e51cd

in strict mode, require annotations for all args and return types

JJelleZijlstra committed 8 years ago
Unverified
59f9cac0951f431fbc3abf8803adeaac6e489aac

typevars should be private

JJelleZijlstra committed 8 years ago

README

The README file for this repository.

stublint

stublint is a linter for PEP 484 Python stub files. It is intended for use on typeshed.

stublint works only on Python 3.6.

Usage

(.venv3)$ git clone https://www.github.com/JelleZijlstra/stublint.git
(.venv3)$ cd stublint
(.venv3)$ pip install .
(.venv3)$ cd /path/to/typeshed
(.venv3)$ python3 -m stublint .

Functionality

stublint is only intended for logical problems and works at the AST level. typeshed uses flake8 for formatting.

stublint currently checks for the following:

  • Function bodies must be empty (allowed self assignments and raise for now).
  • Strict constraints on sys.version_info and sys.platform checks.
  • TypeVars defined in stub modules must be private to the module.
  • If any of a function arguments are annotated, then all arguments must be annotated.

In strict mode (using the --strict argument to stublint), the following are also enabled:

  • All arguments must have a type annotations.
  • All functions must have a return type annotation.

Much more can be added.