diff --git a/pyproject.toml b/pyproject.toml index 6f63d647..1f3f760a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -208,6 +208,9 @@ ignore = [ "D107", # Missing docstring in `__init__` "D401", # First line should be in imperative mood ] +unfixable = [ + "T201", +] [tool.ruff.lint.per-file-ignores] "docs/conf*.py" = ["ALL"] diff --git a/src/subliminal/__main__.py b/src/subliminal/__main__.py new file mode 100644 index 00000000..80b9d6dc --- /dev/null +++ b/src/subliminal/__main__.py @@ -0,0 +1,26 @@ +"""Module subliminal.""" + +from __future__ import annotations + +from textwrap import dedent + +if not (__name__ == '__main__' and __package__ == 'subliminal'): + import sys + + print( # noqa: T201 + dedent( + f""" + + The '__main__' module does not seem to have been run in the context + of a runnable package ... did you forget to add the '-m' flag? + + Usage: {sys.executable} -m subliminal {' '.join(sys.argv[1:])} + + """ + ) + ) + sys.exit(2) + +from subliminal.cli import cli + +cli()