prospector 1.10.3__tar.gz → 1.12.0__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.10.3 → prospector-1.12.0}/PKG-INFO +7 -7
- {prospector-1.10.3 → prospector-1.12.0}/prospector/blender.py +2 -2
- {prospector-1.10.3 → prospector-1.12.0}/prospector/config/configuration.py +3 -2
- {prospector-1.10.3 → prospector-1.12.0}/prospector/exceptions.py +0 -1
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/pylint.py +0 -1
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/vscode.py +0 -1
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/xunit.py +0 -1
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profile.py +1 -1
- {prospector-1.10.3 → prospector-1.12.0}/prospector/suppression.py +1 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/mypy/__init__.py +5 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pylint/__init__.py +11 -4
- prospector-1.12.0/prospector/tools/pylint/linter.py +78 -0
- {prospector-1.10.3 → prospector-1.12.0}/pyproject.toml +10 -8
- {prospector-1.10.3 → prospector-1.12.0}/setup.py +5 -5
- prospector-1.10.3/prospector/tools/pylint/linter.py +0 -40
- {prospector-1.10.3 → prospector-1.12.0}/LICENSE +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/README.rst +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/__main__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/autodetect.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/blender_combinations.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/compat.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/config/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/config/datatype.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/encoding.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/finder.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/base.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/emacs.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/grouped.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/json.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/text.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/formatters/yaml.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/message.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/pathutils.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/postfilter.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/exceptions.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/default.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/doc_warnings.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/flake8.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/full_pep8.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/member_warnings.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/no_doc_warnings.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/no_member_warnings.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/no_pep8.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/no_test_warnings.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_high.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_low.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_medium.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_none.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_veryhigh.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_verylow.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/profiles/profiles/test_warnings.yaml +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/run.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/bandit/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/base.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/dodgy/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/exceptions.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/mccabe/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/profile_validator/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pycodestyle/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pydocstyle/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pyflakes/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pylint/collector.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pyright/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/pyroma/__init__.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/utils.py +0 -0
- {prospector-1.10.3 → prospector-1.12.0}/prospector/tools/vulture/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: prospector
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.12.0
|
|
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.8.1,<4.0
|
|
13
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
14
|
Classifier: Environment :: Console
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -17,12 +17,12 @@ Classifier: License :: OSI Approved :: GNU General Public License v2 or later (G
|
|
|
17
17
|
Classifier: License :: Other/Proprietary License
|
|
18
18
|
Classifier: Operating System :: Unix
|
|
19
19
|
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.9
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.10
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.8
|
|
27
27
|
Classifier: Programming Language :: Python :: 3.9
|
|
28
28
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
@@ -36,15 +36,15 @@ Requires-Dist: GitPython (>=3.1.27,<4.0.0)
|
|
|
36
36
|
Requires-Dist: PyYAML
|
|
37
37
|
Requires-Dist: bandit (>=1.5.1); extra == "with_bandit" or extra == "with_everything"
|
|
38
38
|
Requires-Dist: dodgy (>=0.2.1,<0.3.0)
|
|
39
|
-
Requires-Dist: flake8 (<
|
|
39
|
+
Requires-Dist: flake8 (<7.0.0)
|
|
40
40
|
Requires-Dist: mccabe (>=0.7.0,<0.8.0)
|
|
41
41
|
Requires-Dist: mypy (>=0.600); extra == "with_mypy" or extra == "with_everything"
|
|
42
42
|
Requires-Dist: packaging
|
|
43
43
|
Requires-Dist: pep8-naming (>=0.3.3,<=0.10.0)
|
|
44
44
|
Requires-Dist: pycodestyle (>=2.9.0)
|
|
45
45
|
Requires-Dist: pydocstyle (>=2.0.0)
|
|
46
|
-
Requires-Dist: pyflakes (>=2.2.0,<
|
|
47
|
-
Requires-Dist: pylint (>=
|
|
46
|
+
Requires-Dist: pyflakes (>=2.2.0,<4)
|
|
47
|
+
Requires-Dist: pylint (>=3.0)
|
|
48
48
|
Requires-Dist: pylint-celery (==0.3)
|
|
49
49
|
Requires-Dist: pylint-django (>=2.5,<2.6)
|
|
50
50
|
Requires-Dist: pylint-flask (==0.6)
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
# the same line. For example, both pyflakes and pylint will generate an
|
|
5
5
|
# "Unused Import" warning on the same line. This is obviously redundant, so we
|
|
6
6
|
# remove duplicates.
|
|
7
|
+
import pkgutil
|
|
7
8
|
from collections import defaultdict
|
|
8
9
|
|
|
9
|
-
import pkg_resources
|
|
10
10
|
import yaml
|
|
11
11
|
|
|
12
12
|
__all__ = (
|
|
@@ -98,7 +98,7 @@ def blend(messages, blend_combos=None):
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
def get_default_blend_combinations():
|
|
101
|
-
combos = yaml.safe_load(
|
|
101
|
+
combos = yaml.safe_load(pkgutil.get_data(__name__, "blender_combinations.yaml"))
|
|
102
102
|
combos = combos.get("combinations", [])
|
|
103
103
|
|
|
104
104
|
defaults = []
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# flake8: noqa
|
|
2
|
-
import
|
|
2
|
+
import importlib.metadata
|
|
3
|
+
|
|
3
4
|
import setoptconf as soc
|
|
4
5
|
|
|
5
6
|
from prospector.config.datatype import OutputChoice
|
|
@@ -8,7 +9,7 @@ from prospector.tools import DEFAULT_TOOLS, TOOLS
|
|
|
8
9
|
|
|
9
10
|
__all__ = ("build_manager",)
|
|
10
11
|
|
|
11
|
-
_VERSION =
|
|
12
|
+
_VERSION = importlib.metadata.version("prospector")
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
def build_manager():
|
|
@@ -5,7 +5,6 @@ from prospector.formatters.base import Formatter
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class PylintFormatter(Formatter):
|
|
8
|
-
|
|
9
8
|
"""
|
|
10
9
|
This formatter outputs messages in the same way as pylint -f parseable , which is used by several
|
|
11
10
|
tools to parse pylint output. This formatter is therefore a compatibility shim between tools built
|
|
@@ -4,7 +4,6 @@ from prospector.formatters.base import Formatter
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class XunitFormatter(Formatter):
|
|
7
|
-
|
|
8
7
|
"""
|
|
9
8
|
This formatter outputs messages in the Xunit xml format, which is used by several
|
|
10
9
|
CI tools to parse output. This formatter is therefore a compatibility shim between tools built
|
|
@@ -121,7 +121,7 @@ def _load_content_package(name):
|
|
|
121
121
|
file_names = (
|
|
122
122
|
["prospector.yaml", "prospector.yml"]
|
|
123
123
|
if len(name_split) == 1
|
|
124
|
-
else [f"{name_split[1]}.yaml", f"{name_split[1]}.
|
|
124
|
+
else [f"{name_split[1]}.yaml", f"{name_split[1]}.yml"]
|
|
125
125
|
)
|
|
126
126
|
|
|
127
127
|
data = None
|
|
@@ -21,6 +21,7 @@ VALID_OPTIONS = LIST_OPTIONS + [
|
|
|
21
21
|
"python-2-mode",
|
|
22
22
|
"python-version",
|
|
23
23
|
"namespace-packages",
|
|
24
|
+
"check-untyped-defs",
|
|
24
25
|
]
|
|
25
26
|
|
|
26
27
|
|
|
@@ -90,6 +91,7 @@ class MypyTool(ToolBase):
|
|
|
90
91
|
python_version = options.get("python-version", None)
|
|
91
92
|
strict_optional = options.get("strict-optional", False)
|
|
92
93
|
namespace_packages = options.get("namespace-packages", False)
|
|
94
|
+
check_untyped_defs = options.get("check-untyped-defs", False)
|
|
93
95
|
|
|
94
96
|
self.options.append(f"--follow-imports={follow_imports}")
|
|
95
97
|
|
|
@@ -117,6 +119,9 @@ class MypyTool(ToolBase):
|
|
|
117
119
|
if namespace_packages:
|
|
118
120
|
self.options.append("--namespace-packages")
|
|
119
121
|
|
|
122
|
+
if check_untyped_defs:
|
|
123
|
+
self.options.append("--check-untyped-defs")
|
|
124
|
+
|
|
120
125
|
for list_option in LIST_OPTIONS:
|
|
121
126
|
for entry in options.get(list_option, []):
|
|
122
127
|
self.options.append(f"--{list_option}-{entry}")
|
|
@@ -5,7 +5,7 @@ from collections import defaultdict
|
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from typing import List
|
|
7
7
|
|
|
8
|
-
from pylint.config import
|
|
8
|
+
from pylint.config import find_default_config_files
|
|
9
9
|
from pylint.exceptions import UnknownMessageError
|
|
10
10
|
from pylint.lint.run import _cpu_count
|
|
11
11
|
|
|
@@ -64,7 +64,7 @@ class PylintTool(ToolBase):
|
|
|
64
64
|
continue
|
|
65
65
|
for option in checker.options:
|
|
66
66
|
if option[0] in options:
|
|
67
|
-
checker.set_option(option[0], options[option[0]])
|
|
67
|
+
checker._arguments_manager.set_option(option[0], options[option[0]])
|
|
68
68
|
|
|
69
69
|
# The warnings about disabling warnings are useful for figuring out
|
|
70
70
|
# with other tools to suppress messages from. For example, an unused
|
|
@@ -167,7 +167,7 @@ class PylintTool(ToolBase):
|
|
|
167
167
|
def _get_pylint_configuration(
|
|
168
168
|
self, check_paths: List[Path], linter: ProspectorLinter, prospector_config, pylint_options
|
|
169
169
|
):
|
|
170
|
-
self._args =
|
|
170
|
+
self._args = check_paths
|
|
171
171
|
linter.load_default_plugins()
|
|
172
172
|
|
|
173
173
|
config_messages = self._prospector_configure(prospector_config, linter)
|
|
@@ -177,7 +177,14 @@ class PylintTool(ToolBase):
|
|
|
177
177
|
# try to find a .pylintrc
|
|
178
178
|
pylintrc = pylint_options.get("config_file")
|
|
179
179
|
external_config = prospector_config.external_config_location("pylint")
|
|
180
|
-
|
|
180
|
+
|
|
181
|
+
pylintrc = pylintrc or external_config
|
|
182
|
+
|
|
183
|
+
if pylintrc is None:
|
|
184
|
+
for p in find_default_config_files():
|
|
185
|
+
pylintrc = str(p)
|
|
186
|
+
break
|
|
187
|
+
|
|
181
188
|
if pylintrc is None: # nothing explicitly configured
|
|
182
189
|
for possible in (".pylintrc", "pylintrc", "pyproject.toml", "setup.cfg"):
|
|
183
190
|
pylintrc_path = os.path.join(prospector_config.workdir, possible)
|
|
@@ -0,0 +1,78 @@
|
|
|
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()
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "prospector"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.12.0"
|
|
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>",
|
|
7
7
|
"Carlos Coelho <carlospecter@gmail.com>",
|
|
8
|
-
"Pierre Sassoulas <pierre.sassoulas@gmail.com>"
|
|
8
|
+
"Pierre Sassoulas <pierre.sassoulas@gmail.com>",
|
|
9
|
+
"Stéphane Brunner <stephane.brunner@gmail.com>"]
|
|
9
10
|
readme = "README.rst"
|
|
10
11
|
homepage = "http://prospector.readthedocs.io"
|
|
11
12
|
repository = "https://github.com/PyCQA/prospector"
|
|
@@ -17,11 +18,12 @@ classifiers = [
|
|
|
17
18
|
"Intended Audience :: Developers",
|
|
18
19
|
"Operating System :: Unix",
|
|
19
20
|
"Topic :: Software Development :: Quality Assurance",
|
|
20
|
-
"Programming Language :: Python :: 3.7",
|
|
21
21
|
"Programming Language :: Python :: 3.8",
|
|
22
22
|
"Programming Language :: Python :: 3.9",
|
|
23
23
|
"Programming Language :: Python :: 3.10",
|
|
24
24
|
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
25
27
|
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
|
|
26
28
|
]
|
|
27
29
|
packages = [
|
|
@@ -36,8 +38,8 @@ include = [
|
|
|
36
38
|
prospector = 'prospector.run:main'
|
|
37
39
|
|
|
38
40
|
[tool.poetry.dependencies]
|
|
39
|
-
python = ">=3.
|
|
40
|
-
pylint = ">=
|
|
41
|
+
python = ">=3.8.1,<4.0"
|
|
42
|
+
pylint = ">=3.0"
|
|
41
43
|
pylint-celery = "0.3"
|
|
42
44
|
pylint-django = "~2.5"
|
|
43
45
|
pylint-plugin-utils = "~0.7"
|
|
@@ -45,8 +47,8 @@ pylint-flask = "0.6"
|
|
|
45
47
|
requirements-detector = ">=1.2.0"
|
|
46
48
|
PyYAML = "*"
|
|
47
49
|
mccabe = "^0.7.0"
|
|
48
|
-
flake8 = "<
|
|
49
|
-
pyflakes = ">=2.2.0,<
|
|
50
|
+
flake8 = "<7.0.0"
|
|
51
|
+
pyflakes = ">=2.2.0,<4.*"
|
|
50
52
|
pycodestyle = ">=2.9.0"
|
|
51
53
|
pep8-naming = ">=0.3.3,<=0.10.0"
|
|
52
54
|
pydocstyle = ">=2.0.0"
|
|
@@ -78,7 +80,7 @@ tzlocal = "^4.2"
|
|
|
78
80
|
coverage = "^6.5"
|
|
79
81
|
pre-commit = "^2.20.0"
|
|
80
82
|
tox = "^3.27.1"
|
|
81
|
-
twine = "^
|
|
83
|
+
twine = "^5.1.1"
|
|
82
84
|
types-PyYAML = "^6.0.4"
|
|
83
85
|
types-setuptools = "^57.4.9"
|
|
84
86
|
|
|
@@ -27,18 +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<7.0.0',
|
|
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,<4',
|
|
37
37
|
'pylint-celery==0.3',
|
|
38
38
|
'pylint-django>=2.5,<2.6',
|
|
39
39
|
'pylint-flask==0.6',
|
|
40
40
|
'pylint-plugin-utils>=0.7,<0.8',
|
|
41
|
-
'pylint>=
|
|
41
|
+
'pylint>=3.0',
|
|
42
42
|
'requirements-detector>=1.2.0',
|
|
43
43
|
'setoptconf-tmp>=0.3.1,<0.4.0',
|
|
44
44
|
'toml>=0.10.2,<0.11.0']
|
|
@@ -60,7 +60,7 @@ entry_points = \
|
|
|
60
60
|
|
|
61
61
|
setup_kwargs = {
|
|
62
62
|
'name': 'prospector',
|
|
63
|
-
'version': '1.
|
|
63
|
+
'version': '1.12.0',
|
|
64
64
|
'description': 'Prospector is a tool to analyse Python code by aggregating the result of other tools.',
|
|
65
65
|
'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
66
|
'author': 'Carl Crowder',
|
|
@@ -73,7 +73,7 @@ setup_kwargs = {
|
|
|
73
73
|
'install_requires': install_requires,
|
|
74
74
|
'extras_require': extras_require,
|
|
75
75
|
'entry_points': entry_points,
|
|
76
|
-
'python_requires': '>=3.
|
|
76
|
+
'python_requires': '>=3.8.1,<4.0',
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
|
|
@@ -1,40 +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.lint import PyLinter
|
|
6
|
-
from pylint.utils import _splitstrip
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ProspectorLinter(PyLinter):
|
|
10
|
-
def __init__(self, found_files, *args, **kwargs):
|
|
11
|
-
self._files = found_files
|
|
12
|
-
# set up the standard PyLint linter
|
|
13
|
-
PyLinter.__init__(self, *args, **kwargs)
|
|
14
|
-
|
|
15
|
-
def config_from_file(self, config_file=None):
|
|
16
|
-
"""Will return `True` if plugins have been loaded. For pylint>=1.5. Else `False`."""
|
|
17
|
-
self.read_config_file(config_file)
|
|
18
|
-
if self.cfgfile_parser.has_option("MASTER", "load-plugins"):
|
|
19
|
-
plugins = _splitstrip(self.cfgfile_parser.get("MASTER", "load-plugins"))
|
|
20
|
-
self.load_plugin_modules(plugins)
|
|
21
|
-
self.load_config_file()
|
|
22
|
-
return True
|
|
23
|
-
|
|
24
|
-
def _expand_files(self, modules):
|
|
25
|
-
expanded = super()._expand_files(modules)
|
|
26
|
-
filtered = {}
|
|
27
|
-
# PyLinter._expand_files returns dict since 2.15.7.
|
|
28
|
-
if packaging_version.parse(pylint_version) > packaging_version.parse("2.15.6"):
|
|
29
|
-
for module in expanded:
|
|
30
|
-
if not self._files.is_excluded(Path(module)):
|
|
31
|
-
filtered[module] = expanded[module]
|
|
32
|
-
return filtered
|
|
33
|
-
else:
|
|
34
|
-
for module in expanded:
|
|
35
|
-
# need to de-duplicate, as pylint also walks directories given to it, so it will find
|
|
36
|
-
# files that prospector has already provided and end up checking it more than once
|
|
37
|
-
if not self._files.is_excluded(Path(module["path"])):
|
|
38
|
-
# if the key exists, just overwrite it with the same value, so we don't need an extra if statement
|
|
39
|
-
filtered[module["path"]] = module
|
|
40
|
-
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
|
{prospector-1.10.3 → prospector-1.12.0}/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.10.3 → prospector-1.12.0}/prospector/profiles/profiles/strictness_veryhigh.yaml
RENAMED
|
File without changes
|
{prospector-1.10.3 → prospector-1.12.0}/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
|