diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 00000000..e8947bd2 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,2 @@ +[lint] +select = ["E4", "E7", "E9", "F", "I", "W"] diff --git a/readalongs/api.py b/readalongs/api.py index c77454de..7ae413f3 100644 --- a/readalongs/api.py +++ b/readalongs/api.py @@ -86,7 +86,7 @@ def align( output_base=output_base, language=language, output_formats=output_formats, - **kwargs + **kwargs, ) cli.align.callback(**align_args) # type: ignore @@ -136,7 +136,7 @@ def make_xml( language=JoinerCallbackForClick(get_langs_deferred())( value_groups=language ), - **kwargs + **kwargs, ) cli.make_xml.callback(**make_xml_args) # type: ignore except OSError as e: diff --git a/readalongs/text/make_package.py b/readalongs/text/make_package.py index 1f012fb6..e9d418bd 100644 --- a/readalongs/text/make_package.py +++ b/readalongs/text/make_package.py @@ -99,9 +99,8 @@ def encode_from_path(path: str) -> str: ): # We declare it to be application/readalong+xml, not what mimetypes thinks mime_type = "application/readalong+xml" elif mime[0]: - mime_type = mime[0].replace( - "video", "audio" - ) # Hack: until we properly extract audio from video files, force any video-based mime type to be read as audio + # Hack: until we properly extract audio from video files, force any video-based mime type to be read as audio + mime_type = mime[0].replace("video", "audio") else: mime_type = "application" LOGGER.warning( diff --git a/readalongs/web_api.py b/readalongs/web_api.py index d70d0387..cd179f39 100644 --- a/readalongs/web_api.py +++ b/readalongs/web_api.py @@ -166,7 +166,7 @@ async def assemble( }, } ] - ) + ), ): """Create an input RAS from the given text (as plain text or XML). Also creates the required grammar, pronunciation dictionary, diff --git a/test/basic_test_case.py b/test/basic_test_case.py index fde3348d..5f10c27d 100644 --- a/test/basic_test_case.py +++ b/test/basic_test_case.py @@ -5,6 +5,7 @@ from unittest import TestCase from click.testing import CliRunner + from readalongs.log import LOGGER diff --git a/test/run.py b/test/run.py index ead4fda3..456af8ef 100755 --- a/test/run.py +++ b/test/run.py @@ -86,11 +86,11 @@ def describe_suite(suite: TestSuite): full_list = list(list_tests(full_suite)) requested_list = list(list_tests(suite)) requested_set = set(requested_list) - print("Test suite includes:", *sorted(requested_list), sep="\n"), + print("Test suite includes:", *sorted(requested_list), sep="\n") print( "\nTest suite excludes:", *sorted(test for test in full_list if test not in requested_set), - sep="\n" + sep="\n", )