Skip to content

Commit 3c621d8

Browse files
committed
Run black.
1 parent 7a5f119 commit 3c621d8

File tree

5 files changed

+46
-11
lines changed

5 files changed

+46
-11
lines changed

aws_doc_sdk_examples_tools/categories.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ def from_yaml(cls, yaml: Dict[str, str] | None) -> Optional[TitleInfo]:
3030
title_abbrev = yaml.get("title_abbrev")
3131
synopsis = yaml.get("synopsis")
3232

33-
return cls(title=title, title_suffixes=title_suffixes, title_abbrev=title_abbrev, synopsis=synopsis)
33+
return cls(
34+
title=title,
35+
title_suffixes=title_suffixes,
36+
title_abbrev=title_abbrev,
37+
synopsis=synopsis,
38+
)
3439

3540

3641
@dataclass
@@ -52,17 +57,30 @@ def validate(self, errors: MetadataErrors):
5257
errors.append(CategoryWithNoDisplayError(id=self.key))
5358

5459
@classmethod
55-
def from_yaml(cls, key: str, yaml: Dict[str, Any]) -> tuple[Category, MetadataErrors]:
60+
def from_yaml(
61+
cls, key: str, yaml: Dict[str, Any]
62+
) -> tuple[Category, MetadataErrors]:
5663
errors = MetadataErrors()
5764
display = str(yaml.get("display"))
5865
defaults = TitleInfo.from_yaml(yaml.get("defaults"))
5966
overrides = TitleInfo.from_yaml(yaml.get("overrides"))
6067
description = yaml.get("description")
6168

62-
return cls(key=key, display=display, defaults=defaults, overrides=overrides, description=description), errors
63-
64-
65-
def parse(file: Path, yaml: Dict[str, Any]) -> tuple[List[str], Dict[str, Category], MetadataErrors]:
69+
return (
70+
cls(
71+
key=key,
72+
display=display,
73+
defaults=defaults,
74+
overrides=overrides,
75+
description=description,
76+
),
77+
errors,
78+
)
79+
80+
81+
def parse(
82+
file: Path, yaml: Dict[str, Any]
83+
) -> tuple[List[str], Dict[str, Category], MetadataErrors]:
6684
categories: Dict[str, Category] = {}
6785
errors = MetadataErrors()
6886

aws_doc_sdk_examples_tools/categories_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
)
1515

1616

17-
def load(path: str) -> Tuple[List[str], Dict[str, Category], metadata_errors.MetadataErrors]:
17+
def load(
18+
path: str,
19+
) -> Tuple[List[str], Dict[str, Category], metadata_errors.MetadataErrors]:
1820
root = Path(__file__).parent
1921
filename = root / "test_resources" / path
2022
with open(filename) as file:
@@ -63,7 +65,7 @@ def test_categories():
6365
key="TributaryLite",
6466
display="Tea light",
6567
description="light your way.",
66-
)
68+
),
6769
}
6870

6971

aws_doc_sdk_examples_tools/doc_gen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ def for_root(
208208
categories_path = config / "categories.yaml"
209209
with categories_path.open(encoding="utf-8") as file:
210210
meta = yaml.safe_load(file)
211-
standard_categories, categories, errs = parse_categories(categories_path, meta)
211+
standard_categories, categories, errs = parse_categories(
212+
categories_path, meta
213+
)
212214
self.standard_categories = standard_categories
213215
self.categories = categories
214216
self.errors.extend(errs)

aws_doc_sdk_examples_tools/metadata_errors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ class URLMissingTitle(SdkVersionError):
369369
def message(self):
370370
return f"URL {self.url} is missing a title"
371371

372+
372373
@dataclass
373374
class MissingCategoryBody(MetadataParseError):
374375
def message(self):

aws_doc_sdk_examples_tools/metadata_test.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ def load(
3333
with path.open() as file:
3434
meta = yaml.safe_load(file)
3535
return parse_examples(
36-
path, meta, doc_gen.sdks, doc_gen.services, doc_gen.standard_categories, blocks, doc_gen.validation
36+
path,
37+
meta,
38+
doc_gen.sdks,
39+
doc_gen.services,
40+
doc_gen.standard_categories,
41+
blocks,
42+
doc_gen.validation,
3743
)
3844

3945

@@ -120,7 +126,13 @@ def load(
120126
def test_parse():
121127
meta = yaml.safe_load(GOOD_SINGLE_CPP)
122128
parsed, errors = parse_examples(
123-
Path("test_cpp.yaml"), meta, SDKS, SERVICES, STANDARD_CATS, set(), DOC_GEN.validation
129+
Path("test_cpp.yaml"),
130+
meta,
131+
SDKS,
132+
SERVICES,
133+
STANDARD_CATS,
134+
set(),
135+
DOC_GEN.validation,
124136
)
125137
assert len(errors) == 0
126138
assert len(parsed) == 1

0 commit comments

Comments
 (0)