jellezijlstra / stubcheck Goto Github PK
View Code? Open in Web Editor NEWBasic correctness checks for typeshed stubs.
Basic correctness checks for typeshed stubs.
These:
+selectors: 'DevpollSelector' is in stub but is not defined at runtime
+selectors: 'EpollSelector' is in stub but is not defined at runtime
+selectors: 'PollSelector' is in stub but is not defined at runtime
happen because the selectors only exist on OSs with the underlying syscalls available.
stubcheck should either (1) implement a clever way to detect that these are OS-specific or (2) provide a way to whitelist specific names. The only way I can think of to do (1) is to do source code analysis on the module and find that DevpollSelector
is defined inside an if
block, but that seems hacky and won't work for C modules anyway, so I'll probably go with (2).
Proposed format: We add a file tests/stubcheck_blacklist.txt
to typeshed. Every line in this file is either a comment starting with #
, a blank line, or of the form selectors.DevpollSelector
. Such a line tells stubcheck to suppress all errors related to selectors.DevpollSelector
. To suppress all errors in the selectors module, we could accept a glob like selectors.*
. Alternatively, it could accept file names, so stdlib/3.4/selectors.pyi
will suppress all errors in that file. But that would block stubcheck from finding other errors: for example, if DevpollSelector does exist, it should still be able to check that its methods have the right signature.
Currently stubcheck reports
+xml: 'dom' is in __all__ but not in stub
+xml: 'etree' is in __all__ but not in stub
+xml: 'parsers' is in __all__ but not in stub
+xml: 'sax' is in __all__ but not in stub
At runtime, these are in __all__
but they're not directly imported in xml/__init__.py
, so the stub is correct. stubcheck needs to detect this situation. It also affects the email
package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.