prospector 1.13.2__py3-none-any.whl → 1.13.3__py3-none-any.whl

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/postfilter.py CHANGED
@@ -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.
@@ -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
prospector/tools/utils.py CHANGED
@@ -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
  Metadata-Version: 2.1
2
2
  Name: prospector
3
- Version: 1.13.2
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+
@@ -23,7 +23,7 @@ prospector/formatters/xunit.py,sha256=e5ObAWSLm-ekvWs8xsi-OaIL2yoYedlxuJdUhLZ8gk
23
23
  prospector/formatters/yaml.py,sha256=0RAL5BaaL9A0DfWZ-bdpK1mwgr8zJ_ULVwlnSXVPlDU,684
24
24
  prospector/message.py,sha256=ty_e5T7fpZcZb69sAUIgvV-9qHuAx6-Nkq3bP6IVAqw,3279
25
25
  prospector/pathutils.py,sha256=CyZIj4WXGill8OfnqRvcVqZYX0lzL3QcIxpkxCz-dkE,1219
26
- prospector/postfilter.py,sha256=rJ37Zb-dqzKSwpzgpePZR-AIEgRdOTc2C5LbxGNDVm0,2225
26
+ prospector/postfilter.py,sha256=sbUv8P8XE1-7mXh12iZ539FVBK1JSoC-VmnsQyr6EOk,2201
27
27
  prospector/profiles/__init__.py,sha256=q9zPLVEwo7qoouYFrmENsmByFrKKkr27Dd_Wo9btTJI,683
28
28
  prospector/profiles/exceptions.py,sha256=MDky4KXVwfOlW1yCbyp8Y07D8Kfz76jL3z-8T3WQIFI,1062
29
29
  prospector/profiles/profile.py,sha256=U8vDdyfka0_Ht9cYT2i_c-xbMcktSpS1h53cU7tGerk,17828
@@ -57,15 +57,15 @@ prospector/tools/pycodestyle/__init__.py,sha256=uMpUxqsPsryEsfyfGxpLzwoWUjIvfxIQ
57
57
  prospector/tools/pydocstyle/__init__.py,sha256=WB-AT-c1FeUUUWATUzJbBLeREtu-lxT03bChh4nablo,2776
58
58
  prospector/tools/pyflakes/__init__.py,sha256=53NQFODU416KO991NxW14gChjagbSAhhfErx1ll7VUQ,5631
59
59
  prospector/tools/pylint/__init__.py,sha256=WoI23QXmGlumgZMRg1-tQJ8Tpzl9_KpLUQIKlb7vEkE,11108
60
- prospector/tools/pylint/collector.py,sha256=_PEV_8nV77_87m8rA2Td4WOqO9F2UaIQ4Bb_aUv_WQg,1377
60
+ prospector/tools/pylint/collector.py,sha256=OSDV_58EE5C-fykXxDykIji88N1e-GLfHB849HrjefA,1353
61
61
  prospector/tools/pylint/linter.py,sha256=YQ9SOna4WjbbauqSgUio6Ss8zN08PCr3aKdK9rMi7Ag,2143
62
62
  prospector/tools/pyright/__init__.py,sha256=USqauZofh-8ZSKGwXRXoaM2ItzfSFo2nGwPtLGEWICU,3346
63
63
  prospector/tools/pyroma/__init__.py,sha256=GPQRJZfbs_SI0RBTyySz-4SIuM__YoLfXAm7uYVXAS8,3151
64
64
  prospector/tools/ruff/__init__.py,sha256=HRj2S-I45DCg3y4T6035PvHyRutTPU9Boeh3IWU9_pw,3300
65
- prospector/tools/utils.py,sha256=4wj7Lz-mYs6QIdvP-kCLlXs-ZRSkrwLpSKn9xHvDpgw,1585
65
+ prospector/tools/utils.py,sha256=cRCogsMCH0lPBhdujPsIY0ovNAL6TAxBMohZRES02-4,1770
66
66
  prospector/tools/vulture/__init__.py,sha256=eaTh4X5onNlBMuz1x0rmcRn7x5XDVDgqftjIEd47eWI,3583
67
- prospector-1.13.2.dist-info/entry_points.txt,sha256=SxvCGt8MJTEZefHAvwnUc6jDetgCaaYY1Zpifuk8tqU,50
68
- prospector-1.13.2.dist-info/LICENSE,sha256=WoTRadDy8VbcIKoVzl5Q1QipuD_cexAf3ul4MaVLttc,18044
69
- prospector-1.13.2.dist-info/WHEEL,sha256=gSF7fibx4crkLz_A-IKR6kcuq0jJ64KNCkG8_bcaEao,88
70
- prospector-1.13.2.dist-info/METADATA,sha256=M45kwECENnOkBYWyx6v5887c_iujb4Mu554svWtnsbU,9962
71
- prospector-1.13.2.dist-info/RECORD,,
67
+ prospector-1.13.3.dist-info/entry_points.txt,sha256=SxvCGt8MJTEZefHAvwnUc6jDetgCaaYY1Zpifuk8tqU,50
68
+ prospector-1.13.3.dist-info/LICENSE,sha256=WoTRadDy8VbcIKoVzl5Q1QipuD_cexAf3ul4MaVLttc,18044
69
+ prospector-1.13.3.dist-info/WHEEL,sha256=gSF7fibx4crkLz_A-IKR6kcuq0jJ64KNCkG8_bcaEao,88
70
+ prospector-1.13.3.dist-info/METADATA,sha256=Ds5fPmZfhk-Lnx4mXweNkbi5w6Pwa8g8CP_1LknAMJ0,9962
71
+ prospector-1.13.3.dist-info/RECORD,,