prospector 1.12.0__tar.gz → 1.12.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prospector-1.12.0 → prospector-1.12.1}/PKG-INFO +6 -8
- prospector-1.12.1/prospector/tools/pylint/linter.py +43 -0
- {prospector-1.12.0 → prospector-1.12.1}/pyproject.toml +6 -9
- {prospector-1.12.0 → prospector-1.12.1}/setup.py +6 -7
- prospector-1.12.0/prospector/tools/pylint/linter.py +0 -78
- {prospector-1.12.0 → prospector-1.12.1}/LICENSE +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/README.rst +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/__main__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/autodetect.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/blender.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/blender_combinations.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/compat.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/config/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/config/configuration.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/config/datatype.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/encoding.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/exceptions.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/finder.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/base.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/emacs.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/grouped.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/json.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/pylint.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/text.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/vscode.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/xunit.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/formatters/yaml.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/message.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/pathutils.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/postfilter.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/exceptions.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profile.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/default.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/doc_warnings.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/flake8.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/full_pep8.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/member_warnings.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/no_doc_warnings.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/no_member_warnings.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/no_pep8.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/no_test_warnings.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_high.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_low.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_medium.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_none.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_veryhigh.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_verylow.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/test_warnings.yaml +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/run.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/suppression.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/bandit/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/base.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/dodgy/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/exceptions.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/mccabe/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/mypy/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/profile_validator/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pycodestyle/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pydocstyle/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pyflakes/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pylint/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pylint/collector.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pyright/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/pyroma/__init__.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/utils.py +0 -0
- {prospector-1.12.0 → prospector-1.12.1}/prospector/tools/vulture/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: prospector
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.1
|
|
4
4
|
Summary: Prospector is a tool to analyse Python code by aggregating the result of other tools.
|
|
5
5
|
Home-page: http://prospector.readthedocs.io
|
|
6
6
|
License: GPLv2+
|
|
@@ -9,7 +9,7 @@ Author: Carl Crowder
|
|
|
9
9
|
Author-email: git@carlcrowder.com
|
|
10
10
|
Maintainer: Carl Crowder
|
|
11
11
|
Maintainer-email: git@carlcrowder.com
|
|
12
|
-
Requires-Python: >=3.
|
|
12
|
+
Requires-Python: >=3.9,<4.0
|
|
13
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
14
|
Classifier: Environment :: Console
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -23,7 +23,6 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.11
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.9
|
|
28
27
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
29
28
|
Provides-Extra: with_bandit
|
|
@@ -36,22 +35,21 @@ Requires-Dist: GitPython (>=3.1.27,<4.0.0)
|
|
|
36
35
|
Requires-Dist: PyYAML
|
|
37
36
|
Requires-Dist: bandit (>=1.5.1); extra == "with_bandit" or extra == "with_everything"
|
|
38
37
|
Requires-Dist: dodgy (>=0.2.1,<0.3.0)
|
|
39
|
-
Requires-Dist: flake8
|
|
38
|
+
Requires-Dist: flake8
|
|
40
39
|
Requires-Dist: mccabe (>=0.7.0,<0.8.0)
|
|
41
40
|
Requires-Dist: mypy (>=0.600); extra == "with_mypy" or extra == "with_everything"
|
|
42
41
|
Requires-Dist: packaging
|
|
43
42
|
Requires-Dist: pep8-naming (>=0.3.3,<=0.10.0)
|
|
44
43
|
Requires-Dist: pycodestyle (>=2.9.0)
|
|
45
44
|
Requires-Dist: pydocstyle (>=2.0.0)
|
|
46
|
-
Requires-Dist: pyflakes (>=2.2.0
|
|
45
|
+
Requires-Dist: pyflakes (>=2.2.0)
|
|
47
46
|
Requires-Dist: pylint (>=3.0)
|
|
48
47
|
Requires-Dist: pylint-celery (==0.3)
|
|
49
|
-
Requires-Dist: pylint-django (>=2.
|
|
48
|
+
Requires-Dist: pylint-django (>=2.6.1)
|
|
50
49
|
Requires-Dist: pylint-flask (==0.6)
|
|
51
|
-
Requires-Dist: pylint-plugin-utils (>=0.7,<0.8)
|
|
52
50
|
Requires-Dist: pyright (>=1.1.3); extra == "with_pyright" or extra == "with_everything"
|
|
53
51
|
Requires-Dist: pyroma (>=2.4); extra == "with_pyroma" or extra == "with_everything"
|
|
54
|
-
Requires-Dist: requirements-detector (>=1.
|
|
52
|
+
Requires-Dist: requirements-detector (>=1.3.1)
|
|
55
53
|
Requires-Dist: setoptconf-tmp (>=0.3.1,<0.4.0)
|
|
56
54
|
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
57
55
|
Requires-Dist: vulture (>=1.5); extra == "with_vulture" or extra == "with_everything"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from packaging import version as packaging_version
|
|
4
|
+
from pylint import version as pylint_version
|
|
5
|
+
from pylint.config.config_initialization import _config_initialization
|
|
6
|
+
from pylint.lint import PyLinter
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UnrecognizedOptions(Exception):
|
|
10
|
+
"""Raised when an unrecognized option is found in the Pylint configuration."""
|
|
11
|
+
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ProspectorLinter(PyLinter):
|
|
16
|
+
def __init__(self, found_files, *args, **kwargs):
|
|
17
|
+
self._files = found_files
|
|
18
|
+
# set up the standard PyLint linter
|
|
19
|
+
PyLinter.__init__(self, *args, **kwargs)
|
|
20
|
+
|
|
21
|
+
# Largely inspired by https://github.com/pylint-dev/pylint/blob/main/pylint/config/config_initialization.py#L26
|
|
22
|
+
def config_from_file(self, config_file=None):
|
|
23
|
+
"""Initialize the configuration from a file."""
|
|
24
|
+
_config_initialization(self, [], config_file=config_file)
|
|
25
|
+
return True
|
|
26
|
+
|
|
27
|
+
def _expand_files(self, modules):
|
|
28
|
+
expanded = super()._expand_files(modules)
|
|
29
|
+
filtered = {}
|
|
30
|
+
# PyLinter._expand_files returns dict since 2.15.7.
|
|
31
|
+
if packaging_version.parse(pylint_version) > packaging_version.parse("2.15.6"):
|
|
32
|
+
for module in expanded:
|
|
33
|
+
if not self._files.is_excluded(Path(module)):
|
|
34
|
+
filtered[module] = expanded[module]
|
|
35
|
+
return filtered
|
|
36
|
+
else:
|
|
37
|
+
for module in expanded:
|
|
38
|
+
# need to de-duplicate, as pylint also walks directories given to it, so it will find
|
|
39
|
+
# files that prospector has already provided and end up checking it more than once
|
|
40
|
+
if not self._files.is_excluded(Path(module["path"])):
|
|
41
|
+
# if the key exists, just overwrite it with the same value, so we don't need an extra if statement
|
|
42
|
+
filtered[module["path"]] = module
|
|
43
|
+
return filtered.values()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "prospector"
|
|
3
|
-
version = "1.12.
|
|
3
|
+
version = "1.12.1"
|
|
4
4
|
description = "Prospector is a tool to analyse Python code by aggregating the result of other tools."
|
|
5
5
|
authors = ["Carl Crowder <git@carlcrowder.com>"]
|
|
6
6
|
maintainers = ["Carl Crowder <git@carlcrowder.com>",
|
|
@@ -18,7 +18,6 @@ classifiers = [
|
|
|
18
18
|
"Intended Audience :: Developers",
|
|
19
19
|
"Operating System :: Unix",
|
|
20
20
|
"Topic :: Software Development :: Quality Assurance",
|
|
21
|
-
"Programming Language :: Python :: 3.8",
|
|
22
21
|
"Programming Language :: Python :: 3.9",
|
|
23
22
|
"Programming Language :: Python :: 3.10",
|
|
24
23
|
"Programming Language :: Python :: 3.11",
|
|
@@ -38,17 +37,16 @@ include = [
|
|
|
38
37
|
prospector = 'prospector.run:main'
|
|
39
38
|
|
|
40
39
|
[tool.poetry.dependencies]
|
|
41
|
-
python = ">=3.
|
|
40
|
+
python = ">=3.9,<4.0"
|
|
42
41
|
pylint = ">=3.0"
|
|
43
42
|
pylint-celery = "0.3"
|
|
44
|
-
pylint-django = "
|
|
45
|
-
pylint-plugin-utils = "~0.7"
|
|
43
|
+
pylint-django = ">=2.6.1"
|
|
46
44
|
pylint-flask = "0.6"
|
|
47
|
-
requirements-detector = ">=1.
|
|
45
|
+
requirements-detector = ">=1.3.1"
|
|
48
46
|
PyYAML = "*"
|
|
49
47
|
mccabe = "^0.7.0"
|
|
50
|
-
flake8 = "
|
|
51
|
-
pyflakes = ">=2.2.0
|
|
48
|
+
flake8 = "*"
|
|
49
|
+
pyflakes = ">=2.2.0"
|
|
52
50
|
pycodestyle = ">=2.9.0"
|
|
53
51
|
pep8-naming = ">=0.3.3,<=0.10.0"
|
|
54
52
|
pydocstyle = ">=2.0.0"
|
|
@@ -82,7 +80,6 @@ pre-commit = "^2.20.0"
|
|
|
82
80
|
tox = "^3.27.1"
|
|
83
81
|
twine = "^5.1.1"
|
|
84
82
|
types-PyYAML = "^6.0.4"
|
|
85
|
-
types-setuptools = "^57.4.9"
|
|
86
83
|
|
|
87
84
|
[build-system]
|
|
88
85
|
requires = ["poetry-core>=1.0.0"]
|
|
@@ -27,19 +27,18 @@ install_requires = \
|
|
|
27
27
|
['GitPython>=3.1.27,<4.0.0',
|
|
28
28
|
'PyYAML',
|
|
29
29
|
'dodgy>=0.2.1,<0.3.0',
|
|
30
|
-
'flake8
|
|
30
|
+
'flake8',
|
|
31
31
|
'mccabe>=0.7.0,<0.8.0',
|
|
32
32
|
'packaging',
|
|
33
33
|
'pep8-naming>=0.3.3,<=0.10.0',
|
|
34
34
|
'pycodestyle>=2.9.0',
|
|
35
35
|
'pydocstyle>=2.0.0',
|
|
36
|
-
'pyflakes>=2.2.0
|
|
36
|
+
'pyflakes>=2.2.0',
|
|
37
37
|
'pylint-celery==0.3',
|
|
38
|
-
'pylint-django>=2.
|
|
38
|
+
'pylint-django>=2.6.1',
|
|
39
39
|
'pylint-flask==0.6',
|
|
40
|
-
'pylint-plugin-utils>=0.7,<0.8',
|
|
41
40
|
'pylint>=3.0',
|
|
42
|
-
'requirements-detector>=1.
|
|
41
|
+
'requirements-detector>=1.3.1',
|
|
43
42
|
'setoptconf-tmp>=0.3.1,<0.4.0',
|
|
44
43
|
'toml>=0.10.2,<0.11.0']
|
|
45
44
|
|
|
@@ -60,7 +59,7 @@ entry_points = \
|
|
|
60
59
|
|
|
61
60
|
setup_kwargs = {
|
|
62
61
|
'name': 'prospector',
|
|
63
|
-
'version': '1.12.
|
|
62
|
+
'version': '1.12.1',
|
|
64
63
|
'description': 'Prospector is a tool to analyse Python code by aggregating the result of other tools.',
|
|
65
64
|
'long_description': 'prospector\n==========\n\n.. image:: https://img.shields.io/pypi/v/prospector.svg\n :target: https://pypi.python.org/pypi/prospector\n :alt: Latest Version of Prospector\n.. image:: https://github.com/PyCQA/prospector/actions/workflows/tests.yml/badge.svg\n :target: https://github.com/PyCQA/prospector/actions/workflows/tests.yml\n :alt: Build Status\n.. image:: https://img.shields.io/coveralls/PyCQA/prospector.svg?style=flat\n :target: https://coveralls.io/r/PyCQA/prospector\n :alt: Test Coverage\n.. image:: https://readthedocs.org/projects/prospector/badge/?version=latest\n :target: https://prospector.readthedocs.io/\n :alt: Documentation\n\n\nAbout\n-----\n\nProspector is a tool to analyse Python code and output information about\nerrors, potential problems, convention violations and complexity.\n\nIt brings together the functionality of other Python analysis tools such as\n`Pylint <https://docs.pylint.org/>`_,\n`pycodestyle <https://pycodestyle.pycqa.org/>`_,\nand `McCabe complexity <https://pypi.python.org/pypi/mccabe>`_.\nSee the `Supported Tools <https://prospector.readthedocs.io/en/latest/supported_tools.html>`_\ndocumentation section for a complete list.\n\nThe primary aim of Prospector is to be useful \'out of the box\'. A common complaint of other\nPython analysis tools is that it takes a long time to filter through which errors are relevant\nor interesting to your own coding style. Prospector provides some default profiles, which\nhopefully will provide a good starting point and will be useful straight away, and adapts\nthe output depending on the libraries your project uses.\n\nInstallation\n------------\n\nProspector can be installed from PyPI using ``pip`` by running the following command::\n\n pip install prospector\n\nOptional dependencies for Prospector, such as ``pyroma`` can also be installed by running::\n\n pip install prospector[with_pyroma]\n\nSome shells (such as ``Zsh``, the default shell of macOS Catalina) require brackets to be escaped::\n\n pip install prospector\\[with_pyroma\\]\n\nFor a list of all of the optional dependencies, see the optional extras section on the ReadTheDocs\npage on `Supported Tools Extras <https://prospector.readthedocs.io/en/latest/supported_tools.html#optional-extras>`_.\n\nFor local development, `poetry <https://python-poetry.org/>`_ is used. Check out the code, then run::\n\n poetry install\n\nAnd for extras::\n\n poetry install -E with_everything\n\nFor more detailed information on installing the tool, see the\n`installation section <https://prospector.readthedocs.io/en/latest/#installation>`_ of the tool\'s main page\non ReadTheDocs.\n\nDocumentation\n-------------\n\nFull `documentation is available at ReadTheDocs <https://prospector.readthedocs.io>`_.\n\nUsage\n-----\n\nSimply run prospector from the root of your project::\n\n prospector\n\nThis will output a list of messages pointing out potential problems or errors, for example::\n\n prospector.tools.base (prospector/tools/base.py):\n L5:0 ToolBase: pylint - R0922\n Abstract class is only referenced 1 times\n\nOptions\n```````\n\nRun ``prospector --help`` for a full list of options and their effects.\n\nOutput Format\n~~~~~~~~~~~~~\n\nThe default output format of ``prospector`` is designed to be human readable. For parsing\n(for example, for reporting), you can use the ``--output-format json`` flag to get JSON-formatted\noutput.\n\nProfiles\n~~~~~~~~\n\nProspector is configurable using "profiles". These are composable YAML files with directives to\ndisable or enable tools or messages. For more information, read\n`the documentation about profiles <https://prospector.readthedocs.io/en/latest/profiles.html>`_.\n\nIf your code uses frameworks and libraries\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nOften tools such as pylint find errors in code which is not an error, for example due to attributes of classes being\ncreated at run time by a library or framework used by your project.\nFor example, by default, pylint will generate an error for Django models when accessing ``objects``, as the\n``objects`` attribute is not part of the ``Model`` class definition.\n\nProspector mitigates this by providing an understanding of these frameworks to the underlying tools.\n\nProspector will try to intuit which libraries your project uses by\n`detecting dependencies <https://github.com/landscapeio/requirements-detector>`_ and automatically turning on\nsupport for the requisite libraries. You can see which adaptors were run in the metadata section of the report.\n\nIf Prospector does not correctly detect your project\'s dependencies, you can specify them manually from the commandline::\n\n prospector --uses django celery\n\nAdditionally, if Prospector is automatically detecting a library that you do not in fact use, you can turn\noff autodetection completely::\n\n prospector --no-autodetect\n\nNote that as far as possible, these adaptors have been written as plugins or augmentations for the underlying\ntools so that they can be used without requiring Prospector. For example, the Django support is available as a pylint plugin.\n\nStrictness\n~~~~~~~~~~\n\nProspector has a configurable \'strictness\' level which will determine how harshly it searches for errors::\n\n prospector --strictness high\n\nPossible values are ``verylow``, ``low``, ``medium``, ``high``, ``veryhigh``.\n\nProspector does not include documentation warnings by default, but you can turn\nthis on using the ``--doc-warnings`` flag.\n\npre-commit\n----------\n\nIf you\'d like Prospector to be run automatically when making changes to files in your Git\nrepository, you can install `pre-commit <https://pre-commit.com/>`_ and add the following\ntext to your repositories\' ``.pre-commit-config.yaml``::\n\n repos:\n - repo: https://github.com/PyCQA/prospector\n rev: 1.10.0 # The version of Prospector to use, if not \'master\' for latest\n hooks:\n - id: prospector\n\nThis only installs base prospector - if you also use optional tools, for example bandit and/or mypy, then you can add\nthem to the hook configuration like so::\n\n repos:\n - repo: https://github.com/PyCQA/prospector\n rev: 1.10.0\n hooks:\n - id: prospector\n additional_dependencies:\n - ".[with_mypy,with_bandit]"\n - args: [\n \'--with-tool=mypy\',\n \'--with-tool=bandit\',\n ]\n\nAdditional dependencies can be `individually configured <https://prospector.landscape.io/en/master/profiles.html#individual-configuration-options>`_ in your `prospector.yml` file ::\n\n # https://bandit.readthedocs.io/en/latest/config.html\n bandit:\n options:\n skips:\n - B201\n - B601\n - B610\n - B611\n - B703\n\n # https://mypy.readthedocs.io/en/stable/command_line.html\n mypy:\n options:\n ignore-missing-imports: true\n\nFor prospector options which affect display only - those which are not configurable using a profile - these can be\nadded as command line arguments to the hook. For example::\n\n repos:\n - repo: https://github.com/PyCQA/prospector\n rev: 1.10.0\n hooks:\n - id: prospector\n additional_dependencies:\n - ".[with_mypy,with_bandit]"\n args:\n - --with-tool=mypy\n - --with-tool=bandit\n - --summary-only\n - --zero-exit\n\n\n\nLicense\n-------\n\nProspector is available under the GPLv2 License.\n',
|
|
66
65
|
'author': 'Carl Crowder',
|
|
@@ -73,7 +72,7 @@ setup_kwargs = {
|
|
|
73
72
|
'install_requires': install_requires,
|
|
74
73
|
'extras_require': extras_require,
|
|
75
74
|
'entry_points': entry_points,
|
|
76
|
-
'python_requires': '>=3.
|
|
75
|
+
'python_requires': '>=3.9,<4.0',
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
|
|
3
|
-
from packaging import version as packaging_version
|
|
4
|
-
from pylint import version as pylint_version
|
|
5
|
-
from pylint.config.config_file_parser import _ConfigurationFileParser
|
|
6
|
-
from pylint.config.config_initialization import _order_all_first
|
|
7
|
-
from pylint.lint import PyLinter
|
|
8
|
-
from pylint.utils import _splitstrip, utils
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class ProspectorLinter(PyLinter):
|
|
12
|
-
def __init__(self, found_files, *args, **kwargs):
|
|
13
|
-
self._files = found_files
|
|
14
|
-
# set up the standard PyLint linter
|
|
15
|
-
PyLinter.__init__(self, *args, **kwargs)
|
|
16
|
-
|
|
17
|
-
# Largely inspired by https://github.com/pylint-dev/pylint/blob/main/pylint/config/config_initialization.py#L26
|
|
18
|
-
def config_from_file(self, config_file=None):
|
|
19
|
-
"""Will return `True` if plugins have been loaded. For pylint>=1.5. Else `False`."""
|
|
20
|
-
config_file_parser = _ConfigurationFileParser(False, self)
|
|
21
|
-
config_data, config_args = config_file_parser.parse_config_file(file_path=config_file)
|
|
22
|
-
if config_data.get("MASTER", {}).get("load-plugins"):
|
|
23
|
-
plugins = _splitstrip(config_data["MASTER"]["load-plugins"])
|
|
24
|
-
self.load_plugin_modules(plugins)
|
|
25
|
-
|
|
26
|
-
config_args = _order_all_first(config_args, joined=False)
|
|
27
|
-
|
|
28
|
-
if "init-hook" in config_data:
|
|
29
|
-
exec(utils._unquote(config_data["init-hook"])) # pylint: disable=exec-used
|
|
30
|
-
|
|
31
|
-
# Load plugins if specified in the config file
|
|
32
|
-
if "load-plugins" in config_data:
|
|
33
|
-
self.load_plugin_modules(utils._splitstrip(config_data["load-plugins"]))
|
|
34
|
-
|
|
35
|
-
self._parse_configuration_file(config_args)
|
|
36
|
-
|
|
37
|
-
# Set the current module to the command line
|
|
38
|
-
# to allow raising messages on it
|
|
39
|
-
self.set_current_module(config_file)
|
|
40
|
-
|
|
41
|
-
self._emit_stashed_messages()
|
|
42
|
-
|
|
43
|
-
# Set the current module to configuration as we don't know where
|
|
44
|
-
# the --load-plugins key is coming from
|
|
45
|
-
self.set_current_module("Command line or configuration file")
|
|
46
|
-
|
|
47
|
-
# We have loaded configuration from config file and command line. Now, we can
|
|
48
|
-
# load plugin specific configuration.
|
|
49
|
-
self.load_plugin_configuration()
|
|
50
|
-
|
|
51
|
-
# Now that plugins are loaded, get list of all fail_on messages, and
|
|
52
|
-
# enable them
|
|
53
|
-
self.enable_fail_on_messages()
|
|
54
|
-
|
|
55
|
-
self._parse_error_mode()
|
|
56
|
-
|
|
57
|
-
# Link the base Namespace object on the current directory
|
|
58
|
-
self._directory_namespaces[Path().resolve()] = (self.config, {})
|
|
59
|
-
|
|
60
|
-
return True
|
|
61
|
-
|
|
62
|
-
def _expand_files(self, modules):
|
|
63
|
-
expanded = super()._expand_files(modules)
|
|
64
|
-
filtered = {}
|
|
65
|
-
# PyLinter._expand_files returns dict since 2.15.7.
|
|
66
|
-
if packaging_version.parse(pylint_version) > packaging_version.parse("2.15.6"):
|
|
67
|
-
for module in expanded:
|
|
68
|
-
if not self._files.is_excluded(Path(module)):
|
|
69
|
-
filtered[module] = expanded[module]
|
|
70
|
-
return filtered
|
|
71
|
-
else:
|
|
72
|
-
for module in expanded:
|
|
73
|
-
# need to de-duplicate, as pylint also walks directories given to it, so it will find
|
|
74
|
-
# files that prospector has already provided and end up checking it more than once
|
|
75
|
-
if not self._files.is_excluded(Path(module["path"])):
|
|
76
|
-
# if the key exists, just overwrite it with the same value, so we don't need an extra if statement
|
|
77
|
-
filtered[module["path"]] = module
|
|
78
|
-
return filtered.values()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/no_member_warnings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_veryhigh.yaml
RENAMED
|
File without changes
|
{prospector-1.12.0 → prospector-1.12.1}/prospector/profiles/profiles/strictness_verylow.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|