diff --git a/.vscode/settings.json b/.vscode/settings.json index 0d15bd35..6ae8e86a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,8 +3,14 @@ "--config", "pyproject.toml" ], + "pylint.path": [ + ".venv/bin/python", + "-m", + "pylint" + ], "pylint.args": [ - "--rcfile=pyproject.toml" + "--rcfile=pyproject.toml", + "--load-plugins=pylint_django" ], "python.testing.pytestArgs": [ "-c=pyproject.toml", diff --git a/Pipfile b/Pipfile index 1dc1bb9c..b66a30bb 100644 --- a/Pipfile +++ b/Pipfile @@ -35,6 +35,7 @@ mypy = "==1.6.1" django-stubs = {version = "==4.2.6", extras = ["compatible-mypy"]} djangorestframework-stubs = {version = "==3.14.4", extras = ["compatible-mypy"]} pylint = "==3.0.2" +pylint-django = "==2.5.5" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index f65130c8..b9e388b9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "91d36932f1c6234125145eb8988090ed3937764015ca0b393dff4641188307ed" + "sha256": "b31238bbff04bf67a1f6e56c714ba00fc017cd6a0a4ab38a62f2bdb258f9667f" }, "pipfile-spec": 6, "requires": { @@ -1428,6 +1428,22 @@ "index": "pypi", "version": "==3.0.2" }, + "pylint-django": { + "hashes": [ + "sha256:2f339e4bf55776958283395c5139c37700c91bd5ef1d8251ef6ac88b5abbba9b", + "sha256:5abd5c2228e0e5e2a4cb6d0b4fc1d1cef1e773d0be911412f4dd4fc1a1a440b7" + ], + "index": "pypi", + "version": "==2.5.5" + }, + "pylint-plugin-utils": { + "hashes": [ + "sha256:ae11664737aa2effbf26f973a9e0b6779ab7106ec0adc5fe104b0907ca04e507", + "sha256:d3cebf68a38ba3fba23a873809155562571386d4c1b03e5b4c4cc26c3eee93e4" + ], + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==0.8.2" + }, "pyparsing": { "hashes": [ "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", diff --git a/pyproject.toml b/pyproject.toml index f1244c34..d70efe72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,5 +18,8 @@ plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"] [tool.django-stubs] django_settings_module = "manage" +[tool.pylint.main] +init-hook = "import os; os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'manage')" + [tool.pylint.format] max-line-length = 80