You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the check-pylint-import-errors hook throws deprecation error.
Details
The following error:
Check for pylint import errors............................................Failed
- hook id: check-pylint-import-errors
- exit code: 1
/Users/berto/PycharmProjects/autoredact/autoredact_develop/.venv/lib/python3.9/site-packages/hooks/check_pylint_import_errors.py:59: DeprecationWarning: 'epylint' will be removed in pylint 3.0, use https://github.com/emacsorphanage/pylint instead.
pylint_stdout, pylint_err = lint.py_run(pylint_opts, return_std=True)
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.9/3.9.13_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/python@3.9/3.9.13_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/berto/PycharmProjects/autoredact/autoredact_develop/.venv/lib/python3.9/site-packages/hooks/check_pylint_import_errors.py", line 95, in <module>
sys.exit(main())
File "/Users/berto/PycharmProjects/autoredact/autoredact_develop/.venv/lib/python3.9/site-packages/hooks/check_pylint_import_errors.py", line 91, in main
return CheckPylintImportErrors().run()
File "/Users/berto/PycharmProjects/autoredact/autoredact_develop/.venv/lib/python3.9/site-packages/hooks/check_pylint_import_errors.py", line 63, in run
raise Exception(pylint_err.getvalue())
Exception: <string>:1: DeprecationWarning: 'epylint' will be removed in pylint 3.0, use https://github.com/emacsorphanage/pylint instead.
from io import StringIO
from pylint.lint import Run
from pylint.reporters.text import TextReporter
pylint_output = StringIO() # Custom open stream
reporter = TextReporter(pylint_output)
Run(args=["autoredactdevelop", "--rcfile='pyproject.toml'", "--output-format=json"], reporter=reporter, exit=False)
print(pylint_output.getvalue()) # Retrieve and print the text report
Description
Running the
check-pylint-import-errors
hook throws deprecation error.Details
The following error:
Seems to be linked to v2.16 of
pylint
. https://pylint.pycqa.org/en/latest/whatsnew/2/2.16/index.html, withepylint
migrated to https://github.com/emacsorphanage/pylint.Why are we using the emacs version of pylint anyway?
ah ok, so it's because we can then capture the output:
https://pylint.pycqa.org/en/v2.13.9/user_guide/run.html#:~:text=To%20silently%20run%20Pylint%20on,C0114%27%2C%20return_std%3DTrue
The text was updated successfully, but these errors were encountered: