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

abravalheri / validate-pyproject / 5414796992970752

03 Jan 2024 10:12PM UTC coverage: 98.204% (-0.2%) from 98.357%
5414796992970752

Pull #131

cirrus-ci

henryiii
chore: move pretty/showerr to tox

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Pull Request #131: chore: more typing

317 of 325 branches covered (0.0%)

Branch coverage included in aggregate %.

886 of 900 relevant lines covered (98.44%)

10.79 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
11✔
2

3
import fastjsonschema
11✔
4

5
from . import api, plugins
11✔
6

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

9

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

13
    family = "validate-pyproject"
11✔
14

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

24

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

28

29
def repo_review_families(pyproject: Dict[str, Any]) -> Dict[str, Dict[str, str]]:
11✔
30
    has_distutils = "distutils" in pyproject.get("tool", {})
11✔
31
    plugin_names = (ep.name for ep in plugins.iterate_entry_points())
11✔
32
    plugin_list = (
11✔
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)}"
11✔
36
    return {"validate-pyproject": {"name": "Validate-PyProject", "description": descr}}
11✔
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