Skip to content

Commit

Permalink
Use Black skip-magic-trailing-comma option
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyn committed Mar 30, 2024
1 parent 2425113 commit 5550de0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 18 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[tool.black]
skip-magic-trailing-comma=true

[tool.isort]
profile="black"

Expand Down
5 changes: 1 addition & 4 deletions src/book/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,7 @@ def from_args(cls, b_dir: Path, dir_vars: DirVars, schema: Schema) -> "Book":
)
case SchemaItemTypes.String():
fields.strings[item.name] = _get_string(
metadata,
item,
metadata_dir,
_str_title_prefix(title.display),
metadata, item, metadata_dir, _str_title_prefix(title.display)
)

return cls(title, metadata_dir, fields, files)
2 changes: 1 addition & 1 deletion src/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __call__(
for val in vals:
if not (new_l_dir := Path(val)).is_dir():
raise SimpleEbookManagerExit(
f"ERROR: library dir '{new_l_dir}' is not a directory.",
f"ERROR: library dir '{new_l_dir}' is not a directory."
)

if new_l_dir in l_dirs:
Expand Down
3 changes: 1 addition & 2 deletions src/util/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ def from_args(cls, schema_dict: JSONType) -> "Schema":
]
if len(items_of_type) > 1:
raise _InvalidDuplicatesExit(
_get_type_name(type_no_dup),
[item.name for item in items_of_type],
_get_type_name(type_no_dup), [item.name for item in items_of_type]
)

return cls(tuple(schema_items))
Expand Down
5 changes: 2 additions & 3 deletions tests/test_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def test_inline_none(self) -> None:
SchemaItemTypes.String(self.name, inline=True),
Path("."),
self.title_prefix,
),
)
)

def test_non_inline_non_none(self) -> None:
Expand Down Expand Up @@ -650,8 +650,7 @@ def test_writing_arg_replace_unicode(self) -> None:
unicode_b_dir = t_dir / "unicode"
shutil.copytree(orig_b_dir, unicode_b_dir)
write_text(
get_string_fn(unicode_b_dir, self.desc_fieldname),
orig_desc + UNICODE_LINE,
get_string_fn(unicode_b_dir, self.desc_fieldname), orig_desc + UNICODE_LINE
)

# test no change with replace_unicode=False
Expand Down
9 changes: 1 addition & 8 deletions tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,7 @@ def _test_main(
db_fn.touch()

main_args = (
[
Args.DIR_VARS.opt,
"name1",
".",
Args.DIR_VARS.opt,
"name2",
".",
]
[Args.DIR_VARS.opt, "name1", ".", Args.DIR_VARS.opt, "name2", "."]
+ [Args.LIBRARY_DIRS.opt]
+ [str(l_dir) for l_dir in self.l_dirs]
+ [Args.USER_SQL_FILE.opt, str(USER_SQL_FN)]
Expand Down

0 comments on commit 5550de0

Please sign in to comment.