google / pytype

A static type analyzer for Python code

Home Page:https://google.github.io/pytype

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: warn when pytype-single would have failed

gmacon opened this issue · comments

I'm using pytype on my codebase, which currently has 90 files checked by pytype. Right now, 37 of them, or 41%, are not being checked due to #1571, but I didn't know that because the main pytype entry point currently silences the failures by passing --nofail to pytype-single. I'm requesting that a warning be provided by default when a file is ignored like this.

$ pytype --conf pytype.toml 
Computing dependencies
Analyzing 90 sources with 0 local dependencies
ninja: Entering directory `.pytype'
(progress bar elided)
Leaving directory '.pytype'
Success: no errors found
$ grep -R -l 'Caught error in pytype' .pytype/pyi | wc -l
37
$ pytype --version
2024.01.05
$ python --version
Python 3.8.18

In case it makes a difference, my pytype.toml

[tool.pytype]
inputs = ["./src"]
jobs = "auto"
python_version = '3.8'
disable = []
exclude = [
   # a few miscellaneous files
]

# Always use function return type annotations. This flag is temporary and will
# be removed once this behavior is enabled by default.
always_use_return_annotations = true

# Use the enum overlay for more precise enum checking. This flag is temporary
# and will be removed once this behavior is enabled by default.
use_enum_overlay = true