Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case of pylint returning empty output #4801

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

hithwen
Copy link
Contributor

@hithwen hithwen commented Oct 17, 2019

Handles the case in which pylint is returning no output in stdout:

 $ pylint -f json --py3k -d W1618 --persistent no --exit-zero /Users/julia.simon/src/integrations-core/apache/datadog_checks/apache
No config file found, using default configuration

$pylint --version
No config file found, using default configuration
pylint 1.9.4,
astroid 1.6.6
Python 2.7.16 (default, Mar  4 2019, 09:01:38)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]
>>> json.loads('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

New output

 $ ddev validate py3 apache
Validating python3 compatibility of apache...
	Running: pylint -f json --py3k -d W1618 --persistent no --exit-zero /Users/julia.simon/src/integrations-core/apache/datadog_checks/apache
No config file found, using default configuration
apache is compatible with python3

@hithwen hithwen requested a review from a team as a code owner October 17, 2019 09:16
@hithwen hithwen force-pushed the issue/julia/fix-py3-pylint branch from 67d5072 to 21f1863 Compare October 17, 2019 09:18
@hithwen hithwen force-pushed the issue/julia/fix-py3-pylint branch from 21f1863 to 24e1b6d Compare October 17, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants