Skip to content

Commit 5a0ac95

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8569525 commit 5a0ac95

6 files changed

Lines changed: 46 additions & 29 deletions

File tree

_test/test_issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
# cannot do "from .roundtrip" because of pytest, so mypy cannot find this
88
from roundtrip import ( # type: ignore
9+
YAML,
910
dedent,
1011
na_round_trip,
1112
round_trip,
1213
round_trip_dump,
1314
round_trip_load,
1415
save_and_run,
15-
YAML,
1616
)
1717

1818

_test/test_z_check_debug_leftovers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pytest # type: ignore # NOQA
77
from roundtrip import dedent, round_trip_dump, round_trip_load # type: ignore
8+
89
from ruyaml.emitter import Emitter
910

1011

@@ -48,7 +49,8 @@ def test_02(self, capsys: Any) -> None:
4849
- { }
4950
- [ 3.14 , 42 ]
5051
- [ ]
51-
""")
52+
"""
53+
)
5254
d = round_trip_load(s)
5355

5456
current_map_start = Emitter.flow_map_start

_test/test_z_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

3-
import sys
43
import os
4+
import sys
55
import warnings # NOQA
66
from pathlib import Path
77
from typing import Any, List, Optional, Tuple

lib/ruyaml/composer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
from ruyaml.error import MarkedYAMLError, ReusedAnchorWarning
88
from ruyaml.events import (
99
AliasEvent,
10-
MappingStartEvent,
1110
MappingEndEvent,
11+
MappingStartEvent,
1212
ScalarEvent,
13-
SequenceStartEvent,
1413
SequenceEndEvent,
15-
StreamStartEvent,
14+
SequenceStartEvent,
1615
StreamEndEvent,
16+
StreamStartEvent,
1717
)
1818
from ruyaml.nodes import MappingNode, ScalarNode, SequenceNode
1919

lib/ruyaml/constructor.py

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,45 @@
88
from collections.abc import Hashable, MutableMapping, MutableSequence # type: ignore
99
from datetime import timedelta as TimeDelta
1010

11-
# fmt: off
12-
from ruyaml.error import (MarkedYAMLError, MarkedYAMLFutureWarning,
13-
MantissaNoDotYAML1_1Warning)
14-
from ruyaml.nodes import * # NOQA
15-
from ruyaml.nodes import (SequenceNode, MappingNode, ScalarNode)
16-
from ruyaml.compat import (builtins_module, # NOQA
17-
nprint, nprintf, version_tnf)
18-
from ruyaml.compat import ordereddict
11+
from ruyaml.comments import * # NOQA
12+
from ruyaml.comments import (
13+
C_KEY_EOL,
14+
C_KEY_POST,
15+
C_KEY_PRE,
16+
C_VALUE_EOL,
17+
C_VALUE_POST,
18+
C_VALUE_PRE,
19+
CommentedKeyMap,
20+
CommentedKeySeq,
21+
CommentedMap,
22+
CommentedOrderedMap,
23+
CommentedSeq,
24+
CommentedSet,
25+
TaggedScalar,
26+
)
27+
from ruyaml.compat import builtins_module # NOQA
28+
from ruyaml.compat import nprint, nprintf, ordereddict, version_tnf
1929

20-
from ruyaml.tag import Tag
21-
from ruyaml.comments import * # NOQA
22-
from ruyaml.comments import (CommentedMap, CommentedOrderedMap, CommentedSet,
23-
CommentedKeySeq, CommentedSeq, TaggedScalar,
24-
CommentedKeyMap,
25-
C_KEY_PRE, C_KEY_EOL, C_KEY_POST,
26-
C_VALUE_PRE, C_VALUE_EOL, C_VALUE_POST,
27-
)
28-
from ruyaml.scalarstring import (SingleQuotedScalarString, DoubleQuotedScalarString,
29-
LiteralScalarString, FoldedScalarString,
30-
PlainScalarString, ScalarString)
31-
from ruyaml.scalarint import ScalarInt, BinaryInt, OctalInt, HexInt, HexCapsInt
32-
from ruyaml.scalarfloat import ScalarFloat
30+
# fmt: off
31+
from ruyaml.error import (
32+
MantissaNoDotYAML1_1Warning,
33+
MarkedYAMLError,
34+
MarkedYAMLFutureWarning,
35+
)
36+
from ruyaml.nodes import * # NOQA
37+
from ruyaml.nodes import MappingNode, ScalarNode, SequenceNode
3338
from ruyaml.scalarbool import ScalarBoolean
39+
from ruyaml.scalarfloat import ScalarFloat
40+
from ruyaml.scalarint import BinaryInt, HexCapsInt, HexInt, OctalInt, ScalarInt
41+
from ruyaml.scalarstring import (
42+
DoubleQuotedScalarString,
43+
FoldedScalarString,
44+
LiteralScalarString,
45+
PlainScalarString,
46+
ScalarString,
47+
SingleQuotedScalarString,
48+
)
49+
from ruyaml.tag import Tag
3450
from ruyaml.timestamp import TimeStamp
3551
from ruyaml.util import create_timestamp, timestamp_regexp
3652

lib/ruyaml/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import annotations
22

33
import glob
4+
import warnings
45
from importlib import import_module
56
from io import BytesIO, StringIO
67
from typing import TYPE_CHECKING, Any, List, Optional, Text, Union
7-
import warnings
88

99
import ruyaml
1010
from ruyaml.comments import C_PRE, CommentedMap, CommentedSeq
@@ -21,7 +21,6 @@
2121
from ruyaml.events import * # NOQA
2222
from ruyaml.loader import BaseLoader # NOQA
2323
from ruyaml.loader import Loader # NOQA
24-
from ruyaml.loader import Loader as UnsafeLoader
2524
from ruyaml.loader import RoundTripLoader, SafeLoader # NOQA
2625
from ruyaml.nodes import * # NOQA
2726
from ruyaml.representer import (

0 commit comments

Comments
 (0)