• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

andreoliwa / nitpick / 9594924093

20 Jun 2024 09:21AM UTC coverage: 96.746%. Remained the same
9594924093

push

github

andreoliwa
build(deps): bump urllib3 from 2.0.7 to 2.2.2

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.7 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.0.7...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

788 of 827 branches covered (95.28%)

Branch coverage included in aggregate %.

2096 of 2154 relevant lines covered (97.31%)

4.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/nitpick/exceptions.py
1
"""Nitpick exceptions."""
2

3
from __future__ import annotations
5✔
4

5
import warnings
5✔
6
from typing import TYPE_CHECKING, Any
5✔
7

8
from more_itertools import always_iterable
5✔
9

10
from nitpick.constants import PRE_COMMIT_CONFIG_YAML, PROJECT_NAME
5✔
11

12
if TYPE_CHECKING:
13
    from nitpick.violations import Fuss
14

15

16
class QuitComplainingError(Exception):
5✔
17
    """Quit complaining and exit the application."""
18

19
    def __init__(self, violations: Fuss | list[Fuss]) -> None:
5✔
20
        super().__init__()
5✔
21
        self.violations: list[Fuss] = list(always_iterable(violations))
5✔
22

23

24
class Deprecation:
5✔
25
    """All deprecation messages in a single class.
26

27
    When it's time to break compatibility, remove a method/warning below,
28
    and older config files will trigger validation errors on Nitpick.
29
    """
30

31
    @staticmethod
5✔
32
    def pre_commit_without_dash(path_from_root: str) -> bool:
5✔
33
        """The pre-commit config should start with a dot on the config file."""
34
        if path_from_root == PRE_COMMIT_CONFIG_YAML[1:]:
5✔
35
            warnings.warn(
5✔
36
                f'The section name for dotfiles should start with a dot: [".{path_from_root}"]',
37
                DeprecationWarning,
38
                stacklevel=2,
39
            )
40
            return True
5✔
41

42
        return False
5✔
43

44
    @staticmethod
5✔
45
    def jsonfile_section(style_errors: dict[str, Any]) -> bool:
5✔
46
        """The [nitpick.JSONFile] is not needed anymore; JSON files are now detected by the extension."""
47
        has_nitpick_jsonfile_section = style_errors.get(PROJECT_NAME, {}).pop("JSONFile", None)
5✔
48
        if has_nitpick_jsonfile_section:
5✔
49
            style_errors.pop(PROJECT_NAME)
5✔
50
            warnings.warn(
5✔
51
                "The [nitpick.JSONFile] section is not needed anymore; just declare your JSON files directly",
52
                DeprecationWarning,
53
                stacklevel=2,
54
            )
55
            return True
5✔
56
        return False
5✔
57

58
    @staticmethod
5✔
59
    def pre_commit_repos_with_yaml_key() -> bool:
5✔
60
        """The pre-commit config should not have the "repos.yaml" key anymore; this is the old style.
61

62
        Slight breaking change in the TOML config format: ditching the old TOML config.
63
        """
64
        from nitpick.plugins.yaml import KEY_REPOS, KEY_YAML  # pylint: disable=import-outside-toplevel
5✔
65

66
        warnings.warn(
5✔
67
            f"The {KEY_REPOS}.{KEY_YAML} key is not supported anymore."
68
            " Check the documentation and please update your YAML styles",
69
            DeprecationWarning,
70
            stacklevel=2,
71
        )
72
        return True
5✔
73

74

75
def pretty_exception(err: Exception, message: str = ""):
5✔
76
    """Return a pretty error message with the full path of the Exception."""
77
    return f"{message} ({err.__module__}.{err.__class__.__name__}: {err!s})"
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc