prospector 1.13.1__tar.gz → 1.13.3__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.
Files changed (71) hide show
  1. {prospector-1.13.1 → prospector-1.13.3}/PKG-INFO +1 -1
  2. {prospector-1.13.1 → prospector-1.13.3}/prospector/blender.py +1 -2
  3. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/base.py +2 -1
  4. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/grouped.py +2 -2
  5. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/pylint.py +13 -3
  6. {prospector-1.13.1 → prospector-1.13.3}/prospector/message.py +17 -4
  7. {prospector-1.13.1 → prospector-1.13.3}/prospector/postfilter.py +2 -3
  8. {prospector-1.13.1 → prospector-1.13.3}/prospector/suppression.py +12 -9
  9. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pylint/collector.py +1 -2
  10. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/ruff/__init__.py +10 -0
  11. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/utils.py +9 -3
  12. {prospector-1.13.1 → prospector-1.13.3}/pyproject.toml +2 -1
  13. {prospector-1.13.1 → prospector-1.13.3}/setup.py +1 -1
  14. {prospector-1.13.1 → prospector-1.13.3}/LICENSE +0 -0
  15. {prospector-1.13.1 → prospector-1.13.3}/README.rst +0 -0
  16. {prospector-1.13.1 → prospector-1.13.3}/prospector/__init__.py +0 -0
  17. {prospector-1.13.1 → prospector-1.13.3}/prospector/__main__.py +0 -0
  18. {prospector-1.13.1 → prospector-1.13.3}/prospector/autodetect.py +0 -0
  19. {prospector-1.13.1 → prospector-1.13.3}/prospector/blender_combinations.yaml +0 -0
  20. {prospector-1.13.1 → prospector-1.13.3}/prospector/compat.py +0 -0
  21. {prospector-1.13.1 → prospector-1.13.3}/prospector/config/__init__.py +0 -0
  22. {prospector-1.13.1 → prospector-1.13.3}/prospector/config/configuration.py +0 -0
  23. {prospector-1.13.1 → prospector-1.13.3}/prospector/config/datatype.py +0 -0
  24. {prospector-1.13.1 → prospector-1.13.3}/prospector/encoding.py +0 -0
  25. {prospector-1.13.1 → prospector-1.13.3}/prospector/exceptions.py +0 -0
  26. {prospector-1.13.1 → prospector-1.13.3}/prospector/finder.py +0 -0
  27. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/__init__.py +0 -0
  28. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/base_summary.py +0 -0
  29. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/emacs.py +0 -0
  30. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/json.py +0 -0
  31. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/text.py +0 -0
  32. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/vscode.py +0 -0
  33. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/xunit.py +0 -0
  34. {prospector-1.13.1 → prospector-1.13.3}/prospector/formatters/yaml.py +0 -0
  35. {prospector-1.13.1 → prospector-1.13.3}/prospector/pathutils.py +0 -0
  36. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/__init__.py +0 -0
  37. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/exceptions.py +0 -0
  38. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profile.py +0 -0
  39. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/default.yaml +0 -0
  40. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/doc_warnings.yaml +0 -0
  41. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/flake8.yaml +0 -0
  42. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/full_pep8.yaml +0 -0
  43. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/member_warnings.yaml +0 -0
  44. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/no_doc_warnings.yaml +0 -0
  45. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/no_member_warnings.yaml +0 -0
  46. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/no_pep8.yaml +0 -0
  47. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/no_test_warnings.yaml +0 -0
  48. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/strictness_high.yaml +0 -0
  49. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/strictness_low.yaml +0 -0
  50. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/strictness_medium.yaml +0 -0
  51. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/strictness_none.yaml +0 -0
  52. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/strictness_veryhigh.yaml +0 -0
  53. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/strictness_verylow.yaml +0 -0
  54. {prospector-1.13.1 → prospector-1.13.3}/prospector/profiles/profiles/test_warnings.yaml +0 -0
  55. {prospector-1.13.1 → prospector-1.13.3}/prospector/run.py +0 -0
  56. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/__init__.py +0 -0
  57. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/bandit/__init__.py +0 -0
  58. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/base.py +0 -0
  59. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/dodgy/__init__.py +0 -0
  60. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/exceptions.py +0 -0
  61. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/mccabe/__init__.py +0 -0
  62. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/mypy/__init__.py +0 -0
  63. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/profile_validator/__init__.py +0 -0
  64. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pycodestyle/__init__.py +0 -0
  65. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pydocstyle/__init__.py +0 -0
  66. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pyflakes/__init__.py +0 -0
  67. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pylint/__init__.py +0 -0
  68. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pylint/linter.py +0 -0
  69. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pyright/__init__.py +0 -0
  70. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/pyroma/__init__.py +0 -0
  71. {prospector-1.13.1 → prospector-1.13.3}/prospector/tools/vulture/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prospector
3
- Version: 1.13.1
3
+ Version: 1.13.3
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+
@@ -85,10 +85,9 @@ def blend(messages: list[Message], blend_combos: Optional[list[list[tuple[str, s
85
85
  blend_combos = blend_combos or BLEND_COMBOS
86
86
 
87
87
  # group messages by file and then line number
88
- msgs_grouped: dict[Path, dict[int, list[Message]]] = defaultdict(lambda: defaultdict(list))
88
+ msgs_grouped: dict[Optional[Path], dict[Optional[int], list[Message]]] = defaultdict(lambda: defaultdict(list))
89
89
 
90
90
  for message in messages:
91
- assert message.location.line is not None
92
91
  msgs_grouped[message.location.path][message.location.line].append(
93
92
  message,
94
93
  )
@@ -28,7 +28,8 @@ class Formatter(ABC):
28
28
  raise NotImplementedError
29
29
 
30
30
  def _make_path(self, location: Location) -> Path:
31
- return location.relative_path(self.paths_relative_to)
31
+ path_ = location.relative_path(self.paths_relative_to)
32
+ return Path() if path_ is None else path_
32
33
 
33
34
  def _message_to_dict(self, message: Message) -> dict[str, Any]:
34
35
  loc = {
@@ -1,5 +1,6 @@
1
1
  from collections import defaultdict
2
2
  from pathlib import Path
3
+ from typing import Optional
3
4
 
4
5
  from prospector.formatters.text import TextFormatter
5
6
  from prospector.message import Message
@@ -15,10 +16,9 @@ class GroupedFormatter(TextFormatter):
15
16
  "",
16
17
  ]
17
18
 
18
- groups: dict[Path, dict[int, list[Message]]] = defaultdict(lambda: defaultdict(list))
19
+ groups: dict[Path, dict[Optional[int], list[Message]]] = defaultdict(lambda: defaultdict(list))
19
20
 
20
21
  for message in self.messages:
21
- assert message.location.line is not None
22
22
  groups[self._make_path(message.location)][message.location.line].append(message)
23
23
 
24
24
  for filename in sorted(groups.keys()):
@@ -28,16 +28,26 @@ class PylintFormatter(SummaryFormatter):
28
28
  # Missing function docstring
29
29
 
30
30
  template_location = (
31
- "%(path)s"
31
+ ""
32
+ if message.location.path is None
33
+ else "%(path)s"
32
34
  if message.location.line is None
33
35
  else "%(path)s:%(line)s"
34
36
  if message.location.character is None
35
37
  else "%(path)s:%(line)s:%(character)s"
36
38
  )
37
39
  template_code = (
38
- "%(code)s(%(source)s)" if message.location.function is None else "[%(code)s(%(source)s), %(function)s]"
40
+ "(%(source)s)"
41
+ if message.code is None
42
+ else "%(code)s(%(source)s)"
43
+ if message.location.function is None
44
+ else "[%(code)s(%(source)s), %(function)s]"
45
+ )
46
+ template = (
47
+ f"{template_location}: {template_code}: %(message)s"
48
+ if template_location
49
+ else f"{template_code}: %(message)s"
39
50
  )
40
- template = f"{template_location}: {template_code}: %(message)s"
41
51
 
42
52
  output.append(
43
53
  template
@@ -3,9 +3,11 @@ from typing import Optional, Union
3
3
 
4
4
 
5
5
  class Location:
6
+ _path: Optional[Path]
7
+
6
8
  def __init__(
7
9
  self,
8
- path: Union[Path, str],
10
+ path: Optional[Union[Path, str]],
9
11
  module: Optional[str],
10
12
  function: Optional[str],
11
13
  line: Optional[int],
@@ -15,6 +17,8 @@ class Location:
15
17
  self._path = path.absolute()
16
18
  elif isinstance(path, str):
17
19
  self._path = Path(path).absolute()
20
+ elif path is None:
21
+ self._path = None
18
22
  else:
19
23
  raise ValueError
20
24
  self.module = module or None
@@ -23,13 +27,15 @@ class Location:
23
27
  self.character = None if character == -1 else character
24
28
 
25
29
  @property
26
- def path(self) -> Path:
30
+ def path(self) -> Optional[Path]:
27
31
  return self._path
28
32
 
29
- def absolute_path(self) -> Path:
33
+ def absolute_path(self) -> Optional[Path]:
30
34
  return self._path
31
35
 
32
- def relative_path(self, root: Optional[Path]) -> Path:
36
+ def relative_path(self, root: Optional[Path]) -> Optional[Path]:
37
+ if self._path is None:
38
+ return None
33
39
  return self._path.relative_to(root) if root else self._path
34
40
 
35
41
  def __repr__(self) -> str:
@@ -46,6 +52,13 @@ class Location:
46
52
  def __lt__(self, other: "Location") -> bool:
47
53
  if not isinstance(other, Location):
48
54
  raise ValueError
55
+
56
+ if self._path is None and other._path is None:
57
+ return False
58
+ if self._path is None:
59
+ return True
60
+ if other._path is None:
61
+ return False
49
62
  if self._path == other._path:
50
63
  if self.line == other.line:
51
64
  return (self.character or -1) < (other.character or -1)
@@ -1,11 +1,10 @@
1
1
  from pathlib import Path
2
- from typing import List
3
2
 
4
3
  from prospector.message import Message
5
4
  from prospector.suppression import get_suppressions
6
5
 
7
6
 
8
- def filter_messages(filepaths: List[Path], messages: List[Message]) -> List[Message]:
7
+ def filter_messages(filepaths: list[Path], messages: list[Message]) -> list[Message]:
9
8
  """
10
9
  This method post-processes all messages output by all tools, in order to filter
11
10
  out any based on the overall output.
@@ -29,7 +28,7 @@ def filter_messages(filepaths: List[Path], messages: List[Message]) -> List[Mess
29
28
  filtered = []
30
29
  for message in messages:
31
30
  # first get rid of the pylint informational messages
32
- relative_message_path = Path(message.location.path)
31
+ relative_message_path = message.location.path
33
32
 
34
33
  if message.source == "pylint" and message.code in (
35
34
  "suppressed-message",
@@ -24,6 +24,7 @@ import re
24
24
  import warnings
25
25
  from collections import defaultdict
26
26
  from pathlib import Path
27
+ from typing import Optional
27
28
 
28
29
  from prospector import encoding
29
30
  from prospector.exceptions import FatalProspectorException
@@ -63,9 +64,11 @@ _PYLINT_EQUIVALENTS = {
63
64
  }
64
65
 
65
66
 
66
- def _parse_pylint_informational(messages: list[Message]) -> tuple[set[Path], dict[Path, dict[int, list[str]]]]:
67
- ignore_files: set[Path] = set()
68
- ignore_messages: dict[Path, dict[int, list[str]]] = defaultdict(lambda: defaultdict(list))
67
+ def _parse_pylint_informational(
68
+ messages: list[Message],
69
+ ) -> tuple[set[Optional[Path]], dict[Optional[Path], dict[int, list[str]]]]:
70
+ ignore_files: set[Optional[Path]] = set()
71
+ ignore_messages: dict[Optional[Path], dict[int, list[str]]] = defaultdict(lambda: defaultdict(list))
69
72
 
70
73
  for message in messages:
71
74
  if message.source == "pylint":
@@ -86,15 +89,15 @@ def _parse_pylint_informational(messages: list[Message]) -> tuple[set[Path], dic
86
89
 
87
90
  def get_suppressions(
88
91
  filepaths: list[Path], messages: list[Message]
89
- ) -> tuple[set[Path], dict[Path, set[int]], dict[Path, dict[int, set[tuple[str, str]]]]]:
92
+ ) -> tuple[set[Optional[Path]], dict[Path, set[int]], dict[Optional[Path], dict[int, set[tuple[str, str]]]]]:
90
93
  """
91
94
  Given every message which was emitted by the tools, and the
92
95
  list of files to inspect, create a list of files to ignore,
93
96
  and a map of filepath -> line-number -> codes to ignore
94
97
  """
95
- paths_to_ignore: set[Path] = set()
98
+ paths_to_ignore: set[Optional[Path]] = set()
96
99
  lines_to_ignore: dict[Path, set[int]] = defaultdict(set)
97
- messages_to_ignore: dict[Path, dict[int, set[tuple[str, str]]]] = defaultdict(lambda: defaultdict(set))
100
+ messages_to_ignore: dict[Optional[Path], dict[int, set[tuple[str, str]]]] = defaultdict(lambda: defaultdict(set))
98
101
 
99
102
  # first deal with 'noqa' style messages
100
103
  for filepath in filepaths:
@@ -113,12 +116,12 @@ def get_suppressions(
113
116
  # now figure out which messages were suppressed by pylint
114
117
  pylint_ignore_files, pylint_ignore_messages = _parse_pylint_informational(messages)
115
118
  paths_to_ignore |= pylint_ignore_files
116
- for filepath, line in pylint_ignore_messages.items():
119
+ for pylint_filepath, line in pylint_ignore_messages.items():
117
120
  for line_number, codes in line.items():
118
121
  for code in codes:
119
- messages_to_ignore[filepath][line_number].add(("pylint", code))
122
+ messages_to_ignore[pylint_filepath][line_number].add(("pylint", code))
120
123
  if code in _PYLINT_EQUIVALENTS:
121
124
  for equivalent in _PYLINT_EQUIVALENTS[code]:
122
- messages_to_ignore[filepath][line_number].add(equivalent)
125
+ messages_to_ignore[pylint_filepath][line_number].add(equivalent)
123
126
 
124
127
  return paths_to_ignore, lines_to_ignore, messages_to_ignore
@@ -1,5 +1,4 @@
1
1
  from io import StringIO
2
- from typing import List
3
2
 
4
3
  from pylint.exceptions import UnknownMessageError
5
4
  from pylint.message import Message as PylintMessage
@@ -35,5 +34,5 @@ class Collector(BaseReporter):
35
34
  message = Message("pylint", msg_symbol, loc, msg.msg)
36
35
  self._messages.append(message)
37
36
 
38
- def get_messages(self) -> List[Message]:
37
+ def get_messages(self) -> list[Message]:
39
38
  return self._messages
@@ -47,6 +47,16 @@ class RuffTool(ToolBase):
47
47
  completed_process = subprocess.run( # noqa: S603
48
48
  [self.ruff_bin, *self.ruff_args, *found_files.python_modules], capture_output=True
49
49
  )
50
+ if not completed_process.stdout:
51
+ messages.append(
52
+ Message(
53
+ "ruff",
54
+ "",
55
+ Location(None, None, None, None, None),
56
+ completed_process.stderr.decode(),
57
+ )
58
+ )
59
+ return messages
50
60
  for message in json.loads(completed_process.stdout):
51
61
  sub_message = {}
52
62
  if message.get("url"):
@@ -4,8 +4,9 @@ from typing import Optional
4
4
 
5
5
 
6
6
  class CaptureStream(TextIOWrapper):
7
- def __init__(self) -> None:
7
+ def __init__(self, tty: bool) -> None:
8
8
  self.contents = ""
9
+ self._tty = tty
9
10
 
10
11
  def write(self, text: str, /) -> int:
11
12
  self.contents += text
@@ -17,6 +18,9 @@ class CaptureStream(TextIOWrapper):
17
18
  def flush(self) -> None:
18
19
  pass
19
20
 
21
+ def isatty(self) -> bool:
22
+ return self._tty
23
+
20
24
 
21
25
  class CaptureOutput:
22
26
  _prev_streams = None
@@ -28,14 +32,16 @@ class CaptureOutput:
28
32
 
29
33
  def __enter__(self) -> "CaptureOutput":
30
34
  if self.hide:
35
+ is_a_tty = hasattr(sys.stdout, "isatty") and sys.stdout.isatty()
36
+
31
37
  self._prev_streams = (
32
38
  sys.stdout,
33
39
  sys.stderr,
34
40
  sys.__stdout__,
35
41
  sys.__stderr__,
36
42
  )
37
- self.stdout = CaptureStream()
38
- self.stderr = CaptureStream()
43
+ self.stdout = CaptureStream(is_a_tty)
44
+ self.stderr = CaptureStream(is_a_tty)
39
45
  sys.stdout, sys.__stdout__ = self.stdout, self.stdout # type: ignore[misc]
40
46
  sys.stderr, sys.__stderr__ = self.stderr, self.stderr # type: ignore[misc]
41
47
  return self
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "prospector"
3
- version = "1.13.1"
3
+ version = "1.13.3"
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>",
@@ -88,6 +88,7 @@ build-backend = "poetry.core.masonry.api"
88
88
 
89
89
  [tool.ruff]
90
90
  line-length = 120
91
+ target-version = "py39"
91
92
 
92
93
  [tool.ruff.lint]
93
94
  fixable = ["ALL"]
@@ -61,7 +61,7 @@ entry_points = \
61
61
 
62
62
  setup_kwargs = {
63
63
  'name': 'prospector',
64
- 'version': '1.13.1',
64
+ 'version': '1.13.3',
65
65
  'description': 'Prospector is a tool to analyse Python code by aggregating the result of other tools.',
66
66
  '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',
67
67
  'author': 'Carl Crowder',
File without changes
File without changes