JetBrains / teamcity-messages

Python Unit Test Reporting to TeamCity
https://pypi.python.org/pypi/teamcity-messages
Apache License 2.0
136 stars 81 forks source link

Make teamcity-message compatibility with pylint >=2.12 #259

Closed Tirzono closed 2 years ago

Tirzono commented 2 years ago

Currently it's not possible to update to pylint >=2.12 because teamcity-reporter fails with this version:

Traceback (most recent call last):
  File "/.venv/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
  File "/.venv/lib/python3.6/site-packages/pylint/__init__.py", line 24, in run_pylint
    PylintRun(sys.argv[1:])
  File "/.venv/lib/python3.6/site-packages/pylint/lint/run.py", line 399, in __init__
    score_value = linter.generate_reports()
  File "/.venv/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 1287, in generate_reports
    score_value = self._report_evaluation()
  File "/.venv/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 1329, in _report_evaluation
    self.reporter.display_reports(sect)
  File "/.venv/lib/python3.6/site-packages/teamcity/pylint_reporter.py", line 87, in display_reports
    score = self.linter.stats['global_note']
TypeError: 'LinterStats' object is not subscriptable

This change will fix that issue and makes it work for pylint >=2.12 while making sure it keeps working with older versions too.

Related to https://github.com/PyCQA/pylint/issues/5426

Tirzono commented 2 years ago

@mikekidya @throwable-one @madlexa would you be willing to have a look at this one? :)

mikekidya commented 2 years ago

Thanks @Tirzono for keeping an eye at pylint support!

As I remember, you have already signed CLA, let me know if not.

Tirzono commented 2 years ago

Hi @mikekidya,

You're correct, I did sign the CLA already during this PR:

https://github.com/JetBrains/teamcity-messages/pull/242

Thank you for merging the PR.

Would you mind doing a new release as well?

mikekidya commented 2 years ago

@Tirzono yes, just released 1.30 to PyPi, please let me know if anything is not working for you

Tirzono commented 2 years ago

All works fine, thank you very much.