File tree 5 files changed +22
-2
lines changed 5 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
[flake8]
2
2
ban-relative-imports = true
3
3
inline-quotes = "
4
+ per-file-ignores =
5
+ noxfile.py:D
6
+ referencing/tests/*:D
7
+ referencing/_attrs.py:D
4
8
ignore =
5
9
# Barring function calls in default args. Ha, no.
6
10
B008,
7
11
# See https://github.com/PyCQA/flake8-bugbear/issues/131
8
12
B306,
13
+ # This rule makes diffs uglier when expanding docstrings (and it's uglier)
14
+ D200,
9
15
# (flake8 default) old PEP8 boolean operator line breaks
10
16
W503,
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def style(session):
48
48
"flake8-broken-line" ,
49
49
"flake8-bugbear" ,
50
50
"flake8-commas" ,
51
+ "flake8-docstrings" ,
51
52
"flake8-quotes" ,
52
53
"flake8-tidy-imports" ,
53
54
)
Original file line number Diff line number Diff line change 1
- from referencing ._core import Registry , Resource , Specification # noqa: F401
1
+ """
2
+ Cross-specification, implementation-agnostic JSON referencing.
3
+ """
4
+ from referencing ._core import Registry , Resource , Specification
5
+
6
+ __all__ = ["Registry" , "Resource" , "Specification" ]
Original file line number Diff line number Diff line change @@ -46,9 +46,15 @@ class Resource(Generic[D]):
46
46
47
47
@classmethod
48
48
def from_contents (cls , contents : D ) -> Resource [D ]:
49
+ """
50
+ Attempt to discern which specification applies to the given contents.
51
+ """
49
52
return cls (contents = contents , specification = Specification .OPAQUE )
50
53
51
54
def id (self ) -> str | None :
55
+ """
56
+ Retrieve this resource's (specification-specific) identifier.
57
+ """
52
58
return self ._specification .id_of (self .contents )
53
59
54
60
@@ -82,7 +88,6 @@ def crawl(self) -> Registry[D]:
82
88
"""
83
89
Immediately crawl all added resources, discovering subresources.
84
90
"""
85
-
86
91
return self
87
92
88
93
def with_resources (
Original file line number Diff line number Diff line change
1
+ """
2
+ Type-annotation related support for the referencing library.
3
+ """
1
4
from __future__ import annotations
2
5
3
6
from typing import TypeVar
You can’t perform that action at this time.
0 commit comments