facebook / pyre-check

Performant type-checking for python.
https://pyre-check.org/
MIT License
6.81k stars 434 forks source link

How to bypass the 3th lib source code syntax error? #194

Open lovemyliwu opened 5 years ago

lovemyliwu commented 5 years ago

No watchman binary found. 
To enable pyre incremental, you can install watchman: https://facebook.github.io/watchman/docs/install.html
Defaulting to non-incremental check.
2019-08-02 17:36:18,762 DEBUG Reading configuration `.pyre_configuration`...
2019-08-02 17:36:18,763 DEBUG Found source_directories: `.`
2019-08-02 17:36:18,763 INFO No binary specified, looking for `pyre.bin` in PATH
2019-08-02 17:36:18,763 INFO Found: `/usr/local/bin/pyre.bin`
2019-08-02 17:36:18,763 INFO No typeshed specified, looking for it
2019-08-02 17:36:18,763 DEBUG Trying with: `/usr/local/lib/python3.6/dist-packages/pyre_check/pyre_check/typeshed/`
2019-08-02 17:36:18,763 DEBUG Trying with: `/usr/local/lib/python3.6/dist-packages/pyre_check/typeshed/`
2019-08-02 17:36:18,763 DEBUG Trying with: `/usr/local/lib/python3.6/pyre_check/typeshed/`
2019-08-02 17:36:18,764 DEBUG Trying with: `/usr/local/lib/pyre_check/typeshed/`
2019-08-02 17:36:18,764 INFO Found: `/usr/local/lib/pyre_check/typeshed/`
2019-08-02 17:36:18,764 DEBUG Running `/usr/local/bin/pyre.bin check -debug -logging-sections parser -project-root /home/smite/work/quantgroup_loan_v2 -filter-directories /home/smite/work/quantgroup_loan_v2 -workers 1 -search-path /usr/local/lib/python3.6/dist-packages,/usr/local/lib/pyre_check/typeshed/stdlib/3.7,/usr/local/lib/pyre_check/typeshed/stdlib/3.6,/usr/local/lib/pyre_check/typeshed/stdlib/3.5,/usr/local/lib/pyre_check/typeshed/stdlib/3,/usr/local/lib/pyre_check/typeshed/stdlib/2and3,/usr/local/lib/pyre_check/typeshed/third_party/3.5,/usr/local/lib/pyre_check/typeshed/third_party/3,/usr/local/lib/pyre_check/typeshed/third_party/2and3 -exclude /.+/mysql_dev/ -exclude /.+/splunk_dev/ -exclude /.+/tests/ -exclude /.+/scripts/ .`
2019-08-02 17:36:19,087 INFO Parsing 5452 stubs and sources...
2019-08-02 17:36:20,218 ERROR Could not parse file at pylint/test/functional/exec_used_py2.py:3:23-3:23
  exec 'a = __revision__' # [exec-used]
                        ^
2019-08-02 17:36:21,304 ERROR Could not parse file at pylint/test/functional/syntax_error_jython.py:3:0-3:0

  ^
2019-08-02 17:36:22,194 ERROR Could not parse file at pylint/test/regrtest_data/bad_package/__init__.py:2:23-2:23
  raise missing.Missing..
                        ^
2019-08-02 17:36:22,897 ERROR Could not parse file at kombu/transport/base.py:18:72-18:72
  RABBITMQ_QUEUE_ARGUMENTS = {  # type: Mapping[str, Tuple[str, Callable]]
                                                                         ^
2019-08-02 17:36:23,245 ERROR Could not parse file at pylint/test/functional/redefine_in_handler.py:19:32-19:32
      except KeyError, exceptions.RuntimeError: # [redefine-in-handler]
                                 ^
2019-08-02 17:36:23,379 ERROR Could not parse file at pylint/test/regrtest_data/syntax_error.py:1:15-1:15
  class A extends B {}
                ^
2019-08-02 17:36:24,586 ERROR Could not parse file at pylint/test/functional/unpacked_exceptions.py:7:21-7:21
      except IOError, (errno, message):  # [unpacking-in-except]
                      ^
2019-08-02 17:36:25,806 ERROR Could not parse file at celery/utils/saferepr.py:211:0-211:0
      # type: (deque, Set, int, int, Callable) -> Iterator[Any]
  ^
2019-08-02 17:36:26,397 ERROR Could not parse file at pylint/test/functional/syntax_error.py:3:0-3:0

  ^
2019-08-02 17:36:28,836 ERROR Could not parse file at pylint/test/input/func_w0122_py_30.py:5:23-5:23
  exec 'a = __revision__'
                        ^
2019-08-02 17:36:29,173 ERROR Could not parse file at pylint/test/input/func_w0332_py_30.py:4:17-4:17
  __revision__ = 1l
                  ^
2019-08-02 17:36:30,183 WARNING Could not parse 11 files due to syntax errors!
2019-08-02 17:36:30,283 PERFORMANCE Sources parsed: 11.197000s
2019-08-02 17:36:46,575 PERFORMANCE Registered ignores: 16.393000s
2019-08-02 17:36:46,576 INFO Adding environment information to shared memory...
2019-08-02 17:36:46,576 PERFORMANCE Added environment to shared memory: 0.001000s
2019-08-02 17:36:46,676 INFO Building type environment...
2019-08-02 17:36:57,993 ERROR Order is cyclic:
Trace: qtconsole.jupyter_widget.JupyterWidget -> qtconsole.jupyter_widget.IPythonWidget -> qtconsole.jupyter_widget.JupyterWidget
Uncaught exception:

  Analysis__ClassHierarchy.Cyclic

Raised at file "format.ml" (inlined), line 242, characters 35-52
Called from file "format.ml", line 469, characters 8-33
Called from file "format.ml", line 484, characters 6-24
2019-08-02 17:36:57,993 ERROR Client exited with error code 1```
grievejia commented 5 years ago

The parse errors can be suppressed with --hide-parse-errors. In your case, however, the parse errors are not what stopped pyre. See #119

lovemyliwu commented 5 years ago

@grievejia can we make a config file option to --hide-parse-errors?