Skip to content

Commit

Permalink
Merge 03c34da into ebfdea6
Browse files Browse the repository at this point in the history
  • Loading branch information
carsongee committed May 5, 2020
2 parents ebfdea6 + 03c34da commit af4d042
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[run]
source = .
parallel = True
omit =
.tox/*
setup.py
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ If you want to help development, there is
Releases
========

0.17.0
~~~~~~
- Added support for latest pylint API >=2.5.1


0.16.1
~~~~~~
- Corrected documentation and correctly pinned dependencies properly

0.16.0
~~~~~~
- Switched to new ``from_parent`` API and added development documentation `dineshtrivedi <https://github.com/dineshtrivedi>`_
Expand Down
7 changes: 7 additions & 0 deletions pytest_pylint/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,15 @@ def pytest_collection_finish(self, session):
print('Linting files')

# Run pylint over the collected files.

# Pylint has changed APIs, but we support both
# pylint: disable=unexpected-keyword-arg
try:
# pylint >= 2.5.1 API
result = lint.Run(args_list, reporter=reporter, exit=False)
except TypeError:
# pylint < 2.5.1 API
result = lint.Run(args_list, reporter=reporter, do_exit=False)
except RuntimeError:
return
messages = result.linter.reporter.data
Expand Down
16 changes: 15 additions & 1 deletion pytest_pylint/tests/test_pytest_pylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_pylintrc_file_toml(testdir):
"""Verify that pyproject.toml can be used as a pylint rc file."""
rcfile = testdir.makefile(
'.toml',
"""
pylint="""
[tool.pylint.FORMAT]
max-line-length = "3"
"""
Expand All @@ -90,6 +90,20 @@ def test_pylintrc_file_toml(testdir):
result = testdir.runpytest(
'--pylint', '--pylint-rcfile={0}'.format(rcfile.strpath)
)
# Parsing changed from integer to string in pylint >=2.5. Once
# support is dropped <2.5 this is removable
if 'should be of type int' in result.stdout.str():
rcfile = testdir.makefile(
'.toml',
pylint="""
[tool.pylint.FORMAT]
max-line-length = 3
"""
)
result = testdir.runpytest(
'--pylint', '--pylint-rcfile={0}'.format(rcfile.strpath)
)

assert 'Line too long (10/3)' in result.stdout.str()


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
description='pytest plugin to check source code with pylint',
long_description=open("README.rst").read(),
license='MIT',
version='0.16.0',
version='0.17.0',
author='Carson Gee',
author_email='x@carsongee.com',
url='https://github.com/carsongee/pytest-pylint',
packages=['pytest_pylint'],
entry_points={'pytest11': ['pylint = pytest_pylint.plugin']},
python_requires=">=3.5",
install_requires=['pytest>=5.4', 'pylint>=2.5.1', 'toml>=0.7.1'],
install_requires=['pytest>=5.4', 'pylint>=2.3.0', 'toml>=0.7.1'],
setup_requires=['pytest-runner'],
tests_require=['coverage', 'pytest-flake8'],
classifiers=[
Expand Down
23 changes: 17 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
[tox]
envlist = py35,py36,py37,py38
skip_missing_interpreters =
true
envlist = py3{5, 6, 7, 8}-pylint{23, 24, 25, latest, master}-pytest{54, latest, master}, coverage
skip_missing_interpreters = true

[testenv]
usedevelop = true
deps =
pylint
pytest
pylint23: pylint>=2.3,<2.4
pylint24: pylint>=2.4,<2.5
pylint25: pylint>=2.5,<2.6
pylintlatest: pylint
pylintmaster: git+https://github.com/PyCQA/pylint.git@master#egg=pylint
pylintmaster: git+https://github.com/PyCQA/astroid.git@master#egg=astroid
pytest54: pytest>=5.4,<5.5
pytestlatest: pytest
pytestmaster: git+https://github.com/pytest-dev/pytest.git@master#egg=pytest
pytest-flake8
coverage
commands =
coverage erase
coverage run -m py.test {posargs}

[testenv:coverage]
depends = py3{5, 6, 7, 8}-pylint{23, 24, 25, latest, master}-pytest{54, latest, master}
commands =
coverage combine
coverage report
coverage html -d htmlcov

Expand Down

0 comments on commit af4d042

Please sign in to comment.