diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76b6096..74e3b62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,10 +23,12 @@ jobs: with: submodules: true fetch-depth: 1 - - name: Install ruff for linting - run: pip install ruff + - name: Install requirements for linting + run: pip install -r requirements-dev.txt - name: Lint - run: ruff check calibre-plugin + run: sh lint.sh + # - name: Run tests + # run: python -m unittest -v tests - name: Install gtext run: sudo apt-get -y install gettext - name: Generate commit.txt and build .mo files diff --git a/.mypy.ini b/.mypy.ini new file mode 100644 index 0000000..05c2ef0 --- /dev/null +++ b/.mypy.ini @@ -0,0 +1,29 @@ +[mypy] +disable_error_code = has-type, annotation-unchecked + +[mypy-calibre.*] +ignore_missing_imports = True + +[mypy-qt.*] +ignore_missing_imports = True + +[mypy-polyglot.*] +ignore_missing_imports = True + +[mypy-bs4.*] +ignore_missing_imports = True + +[mypy-lxml.*] +ignore_missing_imports = True + +[mypy-calibre_plugins.*] +ignore_missing_imports = True + +[mypy-calibre-plugin.overdrive.*] +ignore_errors = True + +[mypy-calibre-plugin.libby.*] +ignore_errors = True + +[mypy-calibre-plugin.mutagen.*] +ignore_errors = True diff --git a/lint.sh b/lint.sh new file mode 100644 index 0000000..3cad251 --- /dev/null +++ b/lint.sh @@ -0,0 +1,2 @@ +ruff check calibre-plugin +mypy --package calibre-plugin diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..4473938 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +ruff +mypy