Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
docs: update unit testing (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Sep 16, 2023
1 parent 80ed39a commit aa19cb1
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ build:
os: ubuntu-20.04
tools:
python: "3.10"
jobs:
post_build:
- rstcheck -r . # lint rst files
# - rstfmt --check --diff -w 120 . # check rst formatting

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
8 changes: 8 additions & 0 deletions .rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# configuration file for rstcheck, an rst linting tool
# https://rstcheck.readthedocs.io/en/latest/usage/config

[rstcheck]
ignore_directives =
include,
mdinclude,
todo,
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
furo==2023.9.10
m2r2==0.3.3.post2
rstcheck[sphinx]==6.2.0
rstfmt==0.0.14
Sphinx==7.2.6
sphinx-copybutton==0.5.2
4 changes: 2 additions & 2 deletions docs/source/about/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Installation
..
The recommended method for running Themerr-jellyfin is to add the `repository`_ to Jellyfin.
.. Tip:: See `Jellyfin Plugins <https://jellyfin.org/docs/general/server/plugins/>`_ for more information about
.. Tip:: See `Jellyfin Plugins <https://jellyfin.org/docs/general/server/plugins/>`__ for more information about
installing plugins.

..
Repository
----------
#. In Jellyfin, go to `<http://localhost:8096/web/index.html#!/repositories.html>`_.
#. In Jellyfin, go to `<http://localhost:8096/web/index.html#!/repositories.html>`__.
#. Add the repository ``https://repo.lizardbyte.dev/jellyfin/manifest.json``.
#. Go to Catalog and search for `Themerr`.
#. Select and install the plugin.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/about/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Jellyfin Server Logs
Unfortunately, Jellyfin does not separate the logs by plugin. You will need to review the server logs.

The log location varies, depending on your environment. See
`Jellyfin Server Logs <https://jellyfin.org/docs/general/administration/configuration#log-directory>`_ for more
`Jellyfin Server Logs <https://jellyfin.org/docs/general/administration/configuration#log-directory>`__ for more
information.

.. Attention:: Before uploading logs, it would be wise to review the data in the log file. Themerr does not have
Expand Down
4 changes: 2 additions & 2 deletions docs/source/about/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ Manual

To initialize a download task manually, follow these steps:

#. Navigate to `<http://localhost:8096/web/index.html#!/configurationpage?name=Themerr>`_.
#. Navigate to `<http://localhost:8096/web/index.html#!/configurationpage?name=Themerr>`__.
#. Select `Download Theme Songs`.

Or alternatively:

#. Navigate to `<http://localhost:8096/web/index.html#!/scheduledtasks.html>`_.
#. Navigate to `<http://localhost:8096/web/index.html#!/scheduledtasks.html>`__.
#. Select `Download Theme Songs` under the `Themerr` section.

Scheduled
Expand Down
8 changes: 4 additions & 4 deletions docs/source/contributing/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Build
=====
Compiling Themerr-jellyfin requires the following:

- `git <https://git-scm.com/>`_
- `.net6.0 SDK <https://dotnet.microsoft.com/en-us/download/dotnet/6.0>`_
- `python 3.x <https://www.python.org/downloads/>`_
- `git <https://git-scm.com/>`__
- `.net6.0 SDK <https://dotnet.microsoft.com/en-us/download/dotnet/6.0>`__
- `python 3.x <https://www.python.org/downloads/>`__

Clone
-----
Ensure `git <https://git-scm.com/>`_ is installed and run the following:
Ensure `git <https://git-scm.com/>`__ is installed and run the following:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/database.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Database
========

The database of themes is held in our `ThemerrDB <https://github.com/LizardByte/ThemerrDB>`_ repository. To contribute
The database of themes is held in our `ThemerrDB <https://github.com/LizardByte/ThemerrDB>`__ repository. To contribute
to the database, follow the documentation there.
53 changes: 53 additions & 0 deletions docs/source/contributing/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Testing
=======

flake8
------
Themerr-jellyfin uses `flake8 <https://pypi.org/project/flake8/>`__ for enforcing consistent code styling. flake8 is
included in the ``requirements-dev.txt``.

The config file for flake8 is ``.flake8``. This is already included in the root of the repo and should not be modified.

Test with flake8
.. code-block:: bash
python -m flake8
Sphinx
------
Themerr-jellyfin uses `Sphinx <https://www.sphinx-doc.org/en/master/>`__ for documentation building. Sphinx, along with
other required python dependencies are included in the `./docs/requirements.txt` file. Python is required to build
sphinx docs. Installation and setup of python will not be covered here.

.. todo::
Add documentation within C# code to be included in sphinx docs.

The config file for Sphinx is ``docs/source/conf.py``. This is already included in the root of the repo and should not
be modified.

Test with Sphinx
.. code-block:: bash
cd docs
make html
Alternatively

.. code-block:: bash
cd docs
sphinx-build -b html source build
Lint with rstcheck
.. code-block:: bash
rstcheck -r .
Unit Testing
------------
Themerr-jellyfin uses `xUnit <https://www.nuget.org/packages/xunit>`__ for unit testing.

Test with xUnit
.. code-block:: bash
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
1 change: 1 addition & 0 deletions docs/source/toc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

contributing/database
contributing/build
contributing/testing
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
flake8==6.1.0
jprm==0.5.1

0 comments on commit aa19cb1

Please sign in to comment.