Skip to content

Commit 769dcdc

Browse files
committed
Docs: fix linting issues
1 parent c2043da commit 769dcdc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+839
-704
lines changed

docs/_templates/autosummary/base.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{{ fullname | escape | underline}}
22
.. currentmodule:: {{ module }}
3-
.. auto{{ objtype }}:: {{ objname }}
3+
.. auto{{ objtype }}:: {{ objname }}

docs/_templates/autosummary/class.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
.. currentmodule:: {{ module }}
44

55
.. autoclass:: {{ objname }}
6-
:members: <-- add at least this line
6+
:members: <-- add at least this line
77
:private-members:
8-
:show-inheritance: <-- plus I want to show inheritance...
9-
:inherited-members: <-- ...and inherited members too
8+
:show-inheritance: <-- plus I want to show inheritance...
9+
:inherited-members: <-- ...and inherited members too
1010

1111
{% block methods %}
1212
.. automethod:: __init__
@@ -25,4 +25,3 @@
2525
{% endblock %}
2626

2727
.. rubric:: {{ _('Methods definition') }}
28-

docs/_templates/autosummary/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
{%- endfor %}
1010
{% endif %}
11-
{% endblock %}
11+
{% endblock %}

docs/api/database.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Queries
4444

4545
Query
4646
FieldQuery
47-
AndQuery
47+
AndQuery

docs/changelog.rst

Lines changed: 292 additions & 235 deletions
Large diffs are not rendered by default.

docs/dev/library.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ invocation of beets usually has only one :class:`Library`. It's powered by
2020
abstraction, something like a very minimal `ORM`_. The library is also
2121
responsible for handling queries to retrieve stored objects.
2222

23-
Overview
23+
Overview
2424
''''''''
2525

2626
You can add new items or albums to the library via the
2727
:py:meth:`Library.add` and :py:meth:`Library.add_album` methods.
2828

2929
You may also query the library for items and albums using the
30-
:py:meth:`Library.items`, :py:meth:`Library.albums`, :py:meth:`Library.get_item` and :py:meth:`Library.get_album` methods.
30+
:py:meth:`Library.items`, :py:meth:`Library.albums`, :py:meth:`Library.get_item`
31+
and :py:meth:`Library.get_album` methods.
3132

3233
Any modifications to the library must go through a
3334
:class:`Transaction` object, which you can get using the
@@ -64,7 +65,7 @@ We provide CRUD-like methods for interacting with the database:
6465

6566
* :py:meth:`LibModel.store`
6667
* :py:meth:`LibModel.load`
67-
* :py:meth:`LibModel.remove`
68+
* :py:meth:`LibModel.remove`
6869
* :py:meth:`LibModel.add`
6970

7071
The base class :class:`beets.dbcore.Model` has a ``dict``-like interface, so

docs/dev/plugins.rst

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -151,50 +151,50 @@ registration process in this case::
151151

152152
The events currently available are:
153153

154-
* `pluginload`: called after all the plugins have been loaded after the ``beet``
155-
command starts
154+
* ``pluginload``: called after all the plugins have been loaded after the
155+
``beet`` command starts
156156

157-
* `import`: called after a ``beet import`` command finishes (the ``lib`` keyword
158-
argument is a Library object; ``paths`` is a list of paths (strings) that were
159-
imported)
157+
* ``import``: called after a ``beet import`` command finishes (the ``lib``
158+
keyword argument is a Library object; ``paths`` is a list of paths (strings)
159+
that were imported)
160160

161-
* `album_imported`: called with an ``Album`` object every time the ``import``
161+
* ``album_imported``: called with an ``Album`` object every time the ``import``
162162
command finishes adding an album to the library. Parameters: ``lib``,
163163
``album``
164164

165-
* `album_removed`: called with an ``Album`` object every time an album is
165+
* ``album_removed``: called with an ``Album`` object every time an album is
166166
removed from the library (even when its file is not deleted from disk).
167167

168-
* `item_copied`: called with an ``Item`` object whenever its file is copied.
168+
* ``item_copied``: called with an ``Item`` object whenever its file is copied.
169169
Parameters: ``item``, ``source`` path, ``destination`` path
170170

171-
* `item_imported`: called with an ``Item`` object every time the importer adds a
172-
singleton to the library (not called for full-album imports). Parameters:
173-
``lib``, ``item``
171+
* ``item_imported``: called with an ``Item`` object every time the importer
172+
adds a singleton to the library (not called for full-album imports).
173+
Parameters: ``lib``, ``item``
174174

175-
* `before_item_moved`: called with an ``Item`` object immediately before its
175+
* ``before_item_moved``: called with an ``Item`` object immediately before its
176176
file is moved. Parameters: ``item``, ``source`` path, ``destination`` path
177177

178-
* `item_moved`: called with an ``Item`` object whenever its file is moved.
178+
* ``item_moved``: called with an ``Item`` object whenever its file is moved.
179179
Parameters: ``item``, ``source`` path, ``destination`` path
180180

181-
* `item_linked`: called with an ``Item`` object whenever a symlink is created
181+
* ``item_linked``: called with an ``Item`` object whenever a symlink is created
182182
for a file.
183183
Parameters: ``item``, ``source`` path, ``destination`` path
184184

185-
* `item_hardlinked`: called with an ``Item`` object whenever a hardlink is
185+
* ``item_hardlinked``: called with an ``Item`` object whenever a hardlink is
186186
created for a file.
187187
Parameters: ``item``, ``source`` path, ``destination`` path
188188

189-
* `item_reflinked`: called with an ``Item`` object whenever a reflink is
189+
* ``item_reflinked``: called with an ``Item`` object whenever a reflink is
190190
created for a file.
191191
Parameters: ``item``, ``source`` path, ``destination`` path
192192

193-
* `item_removed`: called with an ``Item`` object every time an item (singleton
193+
* ``item_removed``: called with an ``Item`` object every time an item (singleton
194194
or album's part) is removed from the library (even when its file is not
195195
deleted from disk).
196196

197-
* `write`: called with an ``Item`` object, a ``path``, and a ``tags``
197+
* ``write``: called with an ``Item`` object, a ``path``, and a ``tags``
198198
dictionary just before a file's metadata is written to disk (i.e.,
199199
just before the file on disk is opened). Event handlers may change
200200
the ``tags`` dictionary to customize the tags that are written to the
@@ -203,84 +203,83 @@ The events currently available are:
203203
operation. Beets will catch that exception, print an error message
204204
and continue.
205205

206-
* `after_write`: called with an ``Item`` object after a file's metadata is
206+
* ``after_write``: called with an ``Item`` object after a file's metadata is
207207
written to disk (i.e., just after the file on disk is closed).
208208

209-
* `import_task_created`: called immediately after an import task is
210-
initialized. Plugins can use this to, for example, change imported files of a
211-
task before anything else happens. It's also possible to replace the task
212-
with another task by returning a list of tasks. This list can contain zero
213-
or more `ImportTask`s. Returning an empty list will stop the task.
214-
Parameters: ``task`` (an `ImportTask`) and ``session`` (an `ImportSession`).
209+
* ``import_task_created``: called immediately after an import task is
210+
initialized. Plugins can use this to, for example, change imported files of
211+
a task before anything else happens. It's also possible to replace the task
212+
with another task by returning a list of tasks. This list can contain zero or
213+
more ``ImportTask``. Returning an empty list will stop the task.
214+
Parameters: ``task`` (an ``ImportTask``) and ``session`` (an
215+
``ImportSession``).
215216

216-
* `import_task_start`: called when before an import task begins processing.
217+
* ``import_task_start``: called when before an import task begins processing.
217218
Parameters: ``task`` and ``session``.
218219

219-
* `import_task_apply`: called after metadata changes have been applied in an
220+
* ``import_task_apply``: called after metadata changes have been applied in an
220221
import task. This is called on the same thread as the UI, so use this
221222
sparingly and only for tasks that can be done quickly. For most plugins, an
222223
import pipeline stage is a better choice (see :ref:`plugin-stage`).
223224
Parameters: ``task`` and ``session``.
224225

225-
* `import_task_before_choice`: called after candidate search for an import task
226-
before any decision is made about how/if to import or tag. Can be used to
227-
present information about the task or initiate interaction with the user
226+
* ``import_task_before_choice``: called after candidate search for an import
227+
task before any decision is made about how/if to import or tag. Can be used
228+
to present information about the task or initiate interaction with the user
228229
before importing occurs. Return an importer action to take a specific action.
229230
Only one handler may return a non-None result.
230231
Parameters: ``task`` and ``session``
231232

232-
* `import_task_choice`: called after a decision has been made about an import
233+
* ``import_task_choice``: called after a decision has been made about an import
233234
task. This event can be used to initiate further interaction with the user.
234235
Use ``task.choice_flag`` to determine or change the action to be
235236
taken. Parameters: ``task`` and ``session``.
236237

237-
* `import_task_files`: called after an import task finishes manipulating the
238+
* ``import_task_files``: called after an import task finishes manipulating the
238239
filesystem (copying and moving files, writing metadata tags). Parameters:
239240
``task`` and ``session``.
240241

241-
* `library_opened`: called after beets starts up and initializes the main
242+
* ``library_opened``: called after beets starts up and initializes the main
242243
Library object. Parameter: ``lib``.
243244

244-
* `database_change`: a modification has been made to the library database. The
245+
* ``database_change``: a modification has been made to the library database. The
245246
change might not be committed yet. Parameters: ``lib`` and ``model``.
246247

247-
* `cli_exit`: called just before the ``beet`` command-line program exits.
248+
* ``cli_exit``: called just before the ``beet`` command-line program exits.
248249
Parameter: ``lib``.
249250

250-
* `import_begin`: called just before a ``beet import`` session starts up.
251+
* ``import_begin``: called just before a ``beet import`` session starts up.
251252
Parameter: ``session``.
252253

253-
* `trackinfo_received`: called after metadata for a track item has been
254+
* ``trackinfo_received``: called after metadata for a track item has been
254255
fetched from a data source, such as MusicBrainz. You can modify the tags
255256
that the rest of the pipeline sees on a ``beet import`` operation or during
256257
later adjustments, such as ``mbsync``. Slow handlers of the event can impact
257258
the operation, since the event is fired for any fetched possible match
258-
`before` the user (or the autotagger machinery) gets to see the match.
259+
``before`` the user (or the autotagger machinery) gets to see the match.
259260
Parameter: ``info``.
260261

261-
* `albuminfo_received`: like `trackinfo_received`, the event indicates new
262+
* ``albuminfo_received``: like ``trackinfo_received``, the event indicates new
262263
metadata for album items. The parameter is an ``AlbumInfo`` object instead
263264
of a ``TrackInfo``.
264265
Parameter: ``info``.
265266

266-
* `before_choose_candidate`: called before the user is prompted for a decision
267+
* ``before_choose_candidate``: called before the user is prompted for a decision
267268
during a ``beet import`` interactive session. Plugins can use this event for
268269
:ref:`appending choices to the prompt <append_prompt_choices>` by returning a
269270
list of ``PromptChoices``. Parameters: ``task`` and ``session``.
270-
271-
* `mb_track_extract`: called after the metadata is obtained from
272-
MusicBrainz. The parameter is a ``dict`` containing the tags retrieved from
273-
MusicBrainz for a track. Plugins must return a new (potentially empty)
274-
``dict`` with additional ``field: value`` pairs, which the autotagger will
275-
apply to the item, as flexible attributes if ``field`` is not a hardcoded
276-
field. Fields already present on the track are overwritten.
277-
Parameter: ``data``
278-
279-
* `mb_album_extract`: Like `mb_track_extract`, but for album tags. Overwrites
280-
tags set at the track level, if they have the same ``field``.
271+
* ``mb_track_extract``: called after the metadata is obtained from MusicBrainz.
272+
The parameter is a ``dict`` containing the tags retrieved from MusicBrainz for
273+
a track. Plugins must return a new (potentially empty) ``dict`` with
274+
additional ``field: value`` pairs, which the autotagger will apply to the
275+
item, as flexible attributes if ``field`` is not a hardcoded field. Fields
276+
already present on the track are overwritten. Parameter: ``data``
277+
* ``mb_album_extract``: Like ``mb_track_extract``, but for album tags.
278+
Overwrites tags set at the track level, if they have the same ``field``.
281279
Parameter: ``data``
282280

283-
The included ``mpdupdate`` plugin provides an example use case for event listeners.
281+
The included ``mpdupdate`` plugin provides an example use case for event
282+
listeners.
284283

285284
Extend the Autotagger
286285
^^^^^^^^^^^^^^^^^^^^^
@@ -330,10 +329,10 @@ Read Configuration Options
330329
^^^^^^^^^^^^^^^^^^^^^^^^^^
331330

332331
Plugins can configure themselves using the ``config.yaml`` file. You can read
333-
configuration values in two ways. The first is to use `self.config` within
332+
configuration values in two ways. The first is to use ``self.config`` within
334333
your plugin class. This gives you a view onto the configuration values in a
335334
section with the same name as your plugin's module. For example, if your plugin
336-
is in ``greatplugin.py``, then `self.config` will refer to options under the
335+
is in ``greatplugin.py``, then ``self.config`` will refer to options under the
337336
``greatplugin:`` section of the config file.
338337

339338
For example, if you have a configuration value called "foo", then users can put
@@ -343,19 +342,19 @@ this in their ``config.yaml``::
343342
foo: bar
344343

345344
To access this value, say ``self.config['foo'].get()`` at any point in your
346-
plugin's code. The `self.config` object is a *view* as defined by the `Confuse`_
347-
library.
345+
plugin's code. The ``self.config`` object is a *view* as defined by the
346+
`Confuse`_ library.
348347

349348
.. _Confuse: https://confuse.readthedocs.io/en/latest/
350349

351350
If you want to access configuration values *outside* of your plugin's section,
352-
import the `config` object from the `beets` module. That is, just put ``from
351+
import the ``config`` object from the ``beets`` module. That is, just put ``from
353352
beets import config`` at the top of your plugin and access values from there.
354353

355354
If your plugin provides configuration values for sensitive data (e.g.,
356355
passwords, API keys, ...), you should add these to the config so they can be
357356
redacted automatically when users dump their config. This can be done by
358-
setting each value's `redact` flag, like so::
357+
setting each value's ``redact`` flag, like so::
359358

360359
self.config['password'].redact = True
361360

@@ -421,7 +420,7 @@ to extend the kinds of metadata that they can easily manage.
421420

422421
The ``MediaFile`` class uses ``MediaField`` descriptors to provide
423422
access to file tags. If you have created a descriptor you can add it through
424-
your plugins :py:meth:`beets.plugins.BeetsPlugin.add_media_field()`` method.
423+
your plugins :py:meth:`beets.plugins.BeetsPlugin.add_media_field()` method.
425424

426425
.. _MediaFile: https://mediafile.readthedocs.io/en/latest/
427426

@@ -462,9 +461,9 @@ Multiple stages run in parallel but each stage processes only one task at a time
462461
and each task is processed by only one stage at a time.
463462

464463
Plugins provide stages as functions that take two arguments: ``config`` and
465-
``task``, which are ``ImportSession`` and ``ImportTask`` objects (both defined in
466-
``beets.importer``). Add such a function to the plugin's ``import_stages`` field
467-
to register it::
464+
``task``, which are ``ImportSession`` and ``ImportTask`` objects (both defined
465+
in ``beets.importer``). Add such a function to the plugin's ``import_stages``
466+
field to register it::
468467

469468
from beets.plugins import BeetsPlugin
470469
class ExamplePlugin(BeetsPlugin):
@@ -543,11 +542,11 @@ should have an integer type::
543542
def album_types(self):
544543
return {'rating': types.INTEGER}
545544

546-
A plugin may define two attributes: `item_types` and `album_types`.
545+
A plugin may define two attributes: ``item_types`` and ``album_types``.
547546
Each of those attributes is a dictionary mapping a flexible field name
548547
to a type instance. You can find the built-in types in the
549-
`beets.dbcore.types` and `beets.library` modules or implement your own
550-
type by inheriting from the `Type` class.
548+
``beets.dbcore.types`` and ``beets.library`` modules or implement your own
549+
type by inheriting from the ``Type`` class.
551550

552551
Specifying types has several advantages:
553552

docs/faq.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,11 @@ it's helpful to run on the "bleeding edge". To run the latest source:
161161
git clone https://github.com/beetbox/beets.git
162162
poetry install
163163
164-
This approach lets you decide where the
165-
source is stored, with any changes immediately reflected in your
166-
environment.
164+
This approach lets you decide where the source is stored, with any
165+
changes immediately reflected in your environment.
167166

168-
More details about the beets source are available on the :doc:`developer documentation </dev/index>`
169-
pages.
167+
More details about the beets source are available on the :doc:`developer
168+
documentation </dev/index>` pages.
170169

171170

172171
.. _bugs:
@@ -240,7 +239,8 @@ move all your files.
240239
If you've already moved your music *outside* of beets, you have a few options:
241240

242241
- Move the music back (with an ordinary ``mv``) and then use the above steps.
243-
- Delete your database and re-create it from the new paths using ``beet import -AWC``.
242+
- Delete your database and re-create it from the new paths using ``beet import
243+
-AWC``.
244244
- Resort to manually modifying the SQLite database (not recommended).
245245

246246

docs/guides/advanced.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ using the :ref:`modify-cmd` command::
109109

110110
By default, beets will show you the changes that are about to be applied and ask
111111
if you really want to apply them to all, some or none of the items or albums.
112-
You can type y for "yes", n for "no", or s for "select". If you choose the latter,
113-
the command will prompt you for each individual matching item or album.
112+
You can type y for "yes", n for "no", or s for "select". If you choose the
113+
latter, the command will prompt you for each individual matching item or album.
114114

115115
Then :doc:`query </reference/query>` your music just as you would with any
116116
other field::

0 commit comments

Comments
 (0)