myint / language-check

Python wrapper for LanguageTool grammar checker
https://pypi.python.org/pypi/language-check
GNU Lesser General Public License v3.0
327 stars 101 forks source link

Allow More Java versions #32

Closed nemani closed 6 years ago

nemani commented 7 years ago

Fixes a problem at coala org. Fixes parse_java_version to detect 9-ea version.

myint commented 7 years ago

It looks like this fails in one of the tests.

https://travis-ci.org/myint/language-check/jobs/190265455

Trying:
    parse_java_version('''
    openjdk version "1.8.0_60"
    OpenJDK Runtime Environment (build 1.8.0_60-b27)
    OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode))
    ''')
Expecting:
    (1, 8)
**********************************************************************
File "download_lt.py", line 45, in download_lt.parse_java_version
Failed example:
    parse_java_version('''
    openjdk version "1.8.0_60"
    OpenJDK Runtime Environment (build 1.8.0_60-b27)
    OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode))
    ''')
Exception raised:
    Traceback (most recent call last):
      File "/opt/python/pypy3-2.4.0/lib-python/3/doctest.py", line 1288, in __run
        compileflags, 1), test.globs)
      File "<doctest download_lt.parse_java_version[1]>", line 1, in <module>
        parse_java_version('''
      File "download_lt.py", line 56, in parse_java_version
        'Could not parse Java version from """{}""".'.format(version_text))
    SystemExit: Could not parse Java version from """
    openjdk version "1.8.0_60"
    OpenJDK Runtime Environment (build 1.8.0_60-b27)
    OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode))
    """.
nemani commented 7 years ago

Yeah, will update it soon.

jayvdb commented 7 years ago

Note this is to resolve https://github.com/myint/language-check/issues/31 . @nemaniarjun , ping...

schwittlick commented 7 years ago

@nemaniarjun @myint have you been looking into this?

yzgyyang commented 6 years ago

Ping :)

nemani commented 6 years ago

I dont have time to work on this issue right now, If I remember correctly, we just need to set a good regex that works for all versions.