LibrePCB / librepcb-parts-generator

A collection of scripts to generate parts for the LibrePCB default library
MIT License
7 stars 14 forks source link

Add type checking #45

Closed rnestler closed 5 years ago

rnestler commented 5 years ago

Best would be to enable type checking for all files with --strict, but for now we'll need to skip some checks and some files.

rnestler commented 5 years ago

Running on all files yields the following errors:


test_common.py:1: error: No library stub file for module 'pytest'
generate_dfn.py:5: error: No library stub file for module 'numpy'
generate_dfn.py:5: note: (Stub files are from https://github.com/python/typeshed)
generate_dfn.py:269: error: Incompatible types in assignment (expression has type "str", variable has type "float")
generate_dfn.py:375: error: Need type annotation for 'generated_packages' (hint: "generated_packages: List[<type>] = ...")
generate_chip.py:413: error: List item 0 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 1 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 2 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 3 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 4 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 5 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 6 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 7 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 8 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 9 has incompatible type "Tuple[str, str, str]"; expected "str"
generate_chip.py:413: error: List item 10 has incompatible type "Tuple[str, str, str]"; expected "str"
test_generate_qfn.py:1: error: No library stub file for module 'pytest'
test_generate_connectors.py:1: error: No library stub file for module 'pytest'

I'm not sure how to handle those from pytestor numpy, but the others should probably be fixed. But I would postpone these for other pull requests.