samuelcolvin / rtoml
Showing 1 of 5 files from the diff.
Other files ignored by Codecov
src/lib.rs has changed.
rtoml/_rtoml.pyi has changed.
README.md has changed.

@@ -35,18 +35,27 @@
Loading
35 35
    return _rtoml.deserialize(toml, parse_datetime)
36 36
37 37
38 -
def dumps(obj: Any) -> str:
38 +
def dumps(obj: Any, *, pretty: bool = False) -> str:
39 39
    """
40 40
    Serialize a python object to TOML.
41 +
42 +
    If `pretty` is true, output has a more "pretty" format.
41 43
    """
42 -
    return _rtoml.serialize(obj)
44 +
    if pretty:
45 +
        serialize = _rtoml.serialize_pretty
46 +
    else:
47 +
        serialize = _rtoml.serialize
43 48
49 +
    return serialize(obj)
44 50
45 -
def dump(obj: Any, file: Union[Path, TextIO]) -> int:
51 +
52 +
def dump(obj: Any, file: Union[Path, TextIO], *, pretty: bool = False) -> int:
46 53
    """
47 54
    Serialize a python object to TOML and write it to a file. `file` may be a `Path` or file object from `open()`.
55 +
56 +
    If `pretty` is true, output has a more "pretty" format.
48 57
    """
49 -
    s = dumps(obj)
58 +
    s = dumps(obj, pretty=pretty)
50 59
    if isinstance(file, Path):
51 60
        return file.write_text(s)
52 61
    else:
Files Coverage
rtoml/__init__.py 100.00%
Project Totals (1 files) 100.00%
Untitled
Untitled

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading