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

abravalheri / validate-pyproject / 6173991897923584

11 Nov 2024 04:41PM UTC coverage: 97.859%. Remained the same
6173991897923584

Pull #218

cirrus-ci

pre-commit-ci[bot]
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
Pull Request #218: [pre-commit.ci] pre-commit autoupdate

293 of 306 branches covered (95.75%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

941 of 955 relevant lines covered (98.53%)

6.89 hits per line

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

100.0
/src/validate_pyproject/repo_review.py
1
from typing import Any, Dict
7✔
2

3
import fastjsonschema
7✔
4

5
from . import api, plugins
7✔
6

7
__all__ = ["VPP001", "repo_review_checks", "repo_review_families"]
7✔
8

9

10
class VPP001:
7✔
11
    """Validate pyproject.toml"""
12

13
    family = "validate-pyproject"
7✔
14

15
    @staticmethod
7✔
16
    def check(pyproject: Dict[str, Any]) -> str:
7✔
17
        validator = api.Validator()
7✔
18
        try:
7✔
19
            validator(pyproject)
7✔
20
            return ""
7✔
21
        except fastjsonschema.JsonSchemaValueException as e:
7✔
22
            return f"Invalid pyproject.toml! Error: {e}"
7✔
23

24

25
def repo_review_checks() -> Dict[str, VPP001]:
7✔
26
    return {"VPP001": VPP001()}
7✔
27

28

29
def repo_review_families(pyproject: Dict[str, Any]) -> Dict[str, Dict[str, str]]:
7✔
30
    has_distutils = "distutils" in pyproject.get("tool", {})
7✔
31
    plugin_names = (ep.name for ep in plugins.iterate_entry_points())
7✔
32
    plugin_list = (
7✔
33
        f"`[tool.{n}]`" for n in plugin_names if n != "distutils" or has_distutils
34
    )
35
    descr = f"Checks `[build-system]`, `[project]`, {', '.join(plugin_list)}"
7✔
36
    return {"validate-pyproject": {"name": "Validate-PyProject", "description": descr}}
7✔
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