Skip to content

Commit 9b256e4

Browse files
committed
Apply sphinxcontrib-spelling to the docs for spell checking
Project URL: https://github.com/sphinx-contrib/spelling sphinxcontrib-spelling is a mature Sphinx extension to do spell checking across docs. It is used by other big name projects such as Django. This tool will now run as part of CI. All spelling mistakes caught by the tool have been fixed. The language is set to en_US so the British spelling of behaviour was converted to the American spelling. The credits.rst file is excluded from checking as it is mostly a list of people's names which often don't appear in the dictionary.
1 parent 89e7553 commit 9b256e4

File tree

13 files changed

+110
-64
lines changed

13 files changed

+110
-64
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ matrix:
1818
# Documentation
1919
- python: "3.8"
2020
env: TOXENV=docs
21+
before_install:
22+
- sudo apt-get -y install libenchant1c2a
2123
- python: "3.8"
2224
env: TOXENV=linkcheck
2325

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ doc:
9797
linkcheck:
9898
$(MAKE) -C $(DOC_DIR) linkcheck
9999

100+
spelling:
101+
$(MAKE) -C $(DOC_DIR) SPHINXOPTS=-W spelling
102+
100103
# DOC: Show this help message
101104
help:
102105
@grep -A1 '^# DOC:' Makefile \

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ while only declaring the test-specific fields:
6161
)
6262
# etc.
6363
64-
factory_boy is designed to work well with various ORMs (Django, Mongo, SQLAlchemy),
64+
factory_boy is designed to work well with various ORMs (Django, MongoDB, SQLAlchemy),
6565
and can easily be extended for other libraries.
6666

6767
Its main features include:
@@ -325,7 +325,7 @@ Support Policy
325325
- **Django**'s `supported
326326
versions <https://www.djangoproject.com/download/#supported-versions>`__.
327327
- **SQLAlchemy**: `latest version on PyPI <https://pypi.org/project/SQLAlchemy/>`__.
328-
- **mongoengine**: `latest version on PyPI <https://pypi.org/project/mongoengine/>`__.
328+
- **MongoEngine**: `latest version on PyPI <https://pypi.org/project/mongoengine/>`__.
329329

330330
Debugging factory_boy
331331
---------------------
@@ -407,7 +407,7 @@ Valid options are:
407407
* ``ALCHEMY`` for ``SQLAlchemy``
408408

409409

410-
To avoid running ``mongoengine`` tests (e.g no mongo server installed), run:
410+
To avoid running ``mongoengine`` tests (e.g no MongoDB server installed), run:
411411

412412
.. code-block:: sh
413413

docs/changelog.rst

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ChangeLog
2525
3.0.1 (2020-08-13)
2626
------------------
2727

28-
*Bugfix:*
28+
*Bug fix:*
2929

3030
- :issue:`769`: Fix ``import factory; factory.django.DjangoModelFactory`` and similar calls.
3131

@@ -76,10 +76,10 @@ The following aliases were removed:
7676

7777
- :issue:`561`: Display a developer-friendly error message when providing a model instead of a factory in a :class:`~factory.declarations.SubFactory` class.
7878

79-
*Bugfix:*
79+
*Bug fix:*
8080

81-
- Fix issue with SubFactory not preserving signal muting behaviour of the used factory, thanks `Patrick Stein <https://github.com/PFStein>`_.
82-
- Fix issue with overriding params in a Trait, thanks `Grégoire Rocher <https://github.com/cecedille1>`_.
81+
- Fix issue with SubFactory not preserving signal muting behavior of the used factory, thanks `Patrick Stein <https://github.com/PFStein>`_.
82+
- Fix issue with overriding parameters in a Trait, thanks `Grégoire Rocher <https://github.com/cecedille1>`_.
8383
- :issue:`598`: Limit ``get_or_create`` behavior to fields specified in ``django_get_or_create``.
8484
- :issue:`606`: Re-raise :class:`~django.db.IntegrityError` when ``django_get_or_create`` with multiple fields fails to lookup model using user provided keyword arguments.
8585
- :issue:`630`: TypeError masked by __repr__ AttributeError when initializing ``Maybe`` with inconsistent phases.
@@ -98,7 +98,7 @@ The following aliases were removed:
9898
- Add :class:`~factory.RelatedFactoryList` class for one-to-many support, thanks `Sean Harrington <https://github.com/seanharr11>`_.
9999
- Make the `locale` argument for :class:`~factory.faker.Faker` keyword-only
100100

101-
*Bugfix:*
101+
*Bug fix:*
102102

103103
- Allow renamed arguments to be optional, thanks to `Justin Crown <https://github.com/mrname>`_.
104104
- Fix `django_get_or_create` behavior when using multiple fields with `unique=True`, thanks to `@YPCrumble <https://github.com/YPCrumble>`
@@ -107,15 +107,15 @@ The following aliases were removed:
107107
2.11.1 (2018-05-05)
108108
-------------------
109109

110-
*Bugfix:*
110+
*Bug fix:*
111111

112112
- Fix passing deep context to a :class:`~factory.SubFactory` (``Foo(x__y__z=factory.Faker('name')``)
113113

114114

115115
2.11.0 (2018-05-05)
116116
-------------------
117117

118-
*Bugfix:*
118+
*Bug fix:*
119119

120120
- Fix :class:`~factory.fuzzy.FuzzyFloat` to return a 15 decimal digits precision float by default
121121
- :issue:`451`: Restore :class:`~factory.django.FileField` to a
@@ -127,7 +127,7 @@ The following aliases were removed:
127127
2.10.0 (2018-01-28)
128128
-------------------
129129

130-
*Bugfix:*
130+
*Bug fix:*
131131

132132
- :issue:`443`: Don't crash when calling :meth:`factory.Iterator.reset()` on a brand new iterator.
133133

@@ -141,7 +141,7 @@ The following aliases were removed:
141141
2.9.2 (2017-08-03)
142142
------------------
143143

144-
*Bugfix:*
144+
*Bug fix:*
145145

146146
- Fix declaration corruption bug when a factory defined `foo__bar__baz=1` and a caller
147147
provided a `foo__bar=x` parameter at call time: this got merged into the factory's base
@@ -152,7 +152,7 @@ The following aliases were removed:
152152
2.9.1 (2017-08-02)
153153
------------------
154154

155-
*Bugfix:*
155+
*Bug fix:*
156156

157157
- Fix packaging issues (see https://github.com/zestsoftware/zest.releaser/issues/212)
158158
- Don't crash when debugging PostGenerationDeclaration
@@ -163,7 +163,7 @@ The following aliases were removed:
163163
------------------
164164

165165
This version brings massive changes to the core engine, thus reducing the number of
166-
corner cases and weird behaviours.
166+
corner cases and weird behaviors.
167167

168168
*New:*
169169

@@ -184,7 +184,7 @@ corner cases and weird behaviours.
184184
2.8.1 (2016-12-17)
185185
------------------
186186

187-
*Bugfix:*
187+
*Bug fix:*
188188

189189
- Fix packaging issues.
190190

@@ -200,7 +200,7 @@ corner cases and weird behaviours.
200200
thanks to `Oleg Pidsadnyi <https://github.com/olegpidsadnyi>`_.
201201
- :issue:`309`: Provide new options for SQLAlchemy session persistence
202202

203-
*Bugfix:*
203+
*Bug fix:*
204204

205205
- :issue:`334`: Adjust for the package change in ``faker``
206206

@@ -251,7 +251,7 @@ corner cases and weird behaviours.
251251
- Simplify imports for ORM layers, now available through a simple ``factory`` import,
252252
at ``factory.alchemy.SQLAlchemyModelFactory`` / ``factory.django.DjangoModelFactory`` / ``factory.mongoengine.MongoEngineFactory``.
253253

254-
*Bugfix:*
254+
*Bug fix:*
255255

256256
- :issue:`201`: Properly handle custom Django managers when dealing with abstract Django models.
257257
- :issue:`212`: Fix :meth:`factory.django.mute_signals` to handle Django's signal caching
@@ -263,7 +263,7 @@ corner cases and weird behaviours.
263263
2.5.2 (2015-04-21)
264264
------------------
265265

266-
*Bugfix:*
266+
*Bug fix:*
267267

268268
- Add support for Django 1.7/1.8
269269
- Add support for mongoengine>=0.9.0 / pymongo>=2.1
@@ -273,7 +273,7 @@ corner cases and weird behaviours.
273273
2.5.1 (2015-03-27)
274274
------------------
275275

276-
*Bugfix:*
276+
*Bug fix:*
277277

278278
- Respect custom managers in :class:`~factory.django.DjangoModelFactory` (see :issue:`192`)
279279
- Allow passing declarations (e.g :class:`~factory.Sequence`) as parameters to :class:`~factory.django.FileField`
@@ -291,7 +291,7 @@ corner cases and weird behaviours.
291291
- Support non-default databases at the factory level (see :issue:`171`)
292292
- Make :class:`factory.django.FileField` and :class:`factory.django.ImageField` non-post_generation, i.e normal fields also available in ``save()`` (see :issue:`141`).
293293

294-
*Bugfix:*
294+
*Bug fix:*
295295

296296
- Avoid issues when using :meth:`factory.django.mute_signals` on a base factory class (see :issue:`183`).
297297
- Fix limitations of :class:`factory.StubFactory`, that can now use :class:`factory.SubFactory` and co (see :issue:`131`).
@@ -342,7 +342,7 @@ This takes care of all ``FACTORY_FOR`` occurrences; the files containing other a
342342
2.4.1 (2014-06-23)
343343
------------------
344344

345-
*Bugfix:*
345+
*Bug fix:*
346346

347347
- Fix overriding deeply inherited attributes (set in one factory, overridden in a subclass, used in a sub-sub-class).
348348

@@ -384,10 +384,10 @@ This takes care of all ``FACTORY_FOR`` occurrences; the files containing other a
384384
2.3.1 (2014-01-22)
385385
------------------
386386

387-
*Bugfix:*
387+
*Bug fix:*
388388

389389
- Fix badly written assert containing state-changing code, spotted by `chsigi <https://github.com/chsigi>`_ (:pr:`126`)
390-
- Don't crash when handling objects whose __repr__ is non-pure-ascii bytes on Py2,
390+
- Don't crash when handling objects whose ``__repr__`` is non-pure-ASCII bytes on Python 2,
391391
discovered by `mbertheau <https://github.com/mbertheau>`_ (:issue:`123`) and `strycore <https://github.com/strycore>`_ (:pr:`127`)
392392

393393
.. _v2.3.0:
@@ -406,7 +406,7 @@ This takes care of all ``FACTORY_FOR`` occurrences; the files containing other a
406406
2.2.1 (2013-09-24)
407407
------------------
408408

409-
*Bugfix:*
409+
*Bug fix:*
410410

411411
- Fixed sequence counter for :class:`~factory.django.DjangoModelFactory` when a factory
412412
inherits from another factory relating to an abstract model.
@@ -416,13 +416,13 @@ This takes care of all ``FACTORY_FOR`` occurrences; the files containing other a
416416
2.2.0 (2013-09-24)
417417
------------------
418418

419-
*Bugfix:*
419+
*Bug fix:*
420420

421421
- Removed duplicated :class:`~factory.alchemy.SQLAlchemyModelFactory` lurking in :mod:`factory`
422422
(:pr:`83`)
423423
- Properly handle sequences within object inheritance chains.
424-
If FactoryA inherits from FactoryB, and their associated classes share the same link,
425-
sequence counters will be shared (:issue:`93`)
424+
If ``FactoryA`` inherits from ``FactoryB``, and their associated classes
425+
share the same link, sequence counters will be shared (:issue:`93`)
426426
- Properly handle nested :class:`~factory.SubFactory` overrides
427427

428428
*New:*
@@ -449,7 +449,7 @@ This takes care of all ``FACTORY_FOR`` occurrences; the files containing other a
449449
2.1.1 (2013-07-02)
450450
------------------
451451

452-
*Bugfix:*
452+
*Bug fix:*
453453

454454
- Properly retrieve the ``color`` keyword argument passed to :class:`~factory.django.ImageField`
455455

@@ -476,9 +476,9 @@ This takes care of all ``FACTORY_FOR`` occurrences; the files containing other a
476476
- Add :class:`factory.django.FileField` and :class:`factory.django.ImageField` hooks for
477477
related Django model fields (:issue:`52`)
478478

479-
*Bugfix*
479+
*Bug fix*
480480

481-
- Properly handle non-integer pks in :class:`~factory.django.DjangoModelFactory` (:issue:`57`).
481+
- Properly handle non-integer primary keys in :class:`~factory.django.DjangoModelFactory` (:issue:`57`).
482482
- Disable :class:`~factory.RelatedFactory` generation when a specific value was
483483
passed (:issue:`62`, thanks to `Gabe Koscky <https://github.com/dhekke>`_)
484484

@@ -603,7 +603,7 @@ All warnings will turn into errors starting from v2.0.0.
603603
In order to upgrade client code, apply the following rules:
604604

605605
- Add a ``FACTORY_FOR`` attribute pointing to the target class to each
606-
:class:`~factory.Factory`, instead of relying on automagic associated class
606+
:class:`~factory.Factory`, instead of relying on automatic associated class
607607
discovery
608608
- When using factory_boy for Django models, have each factory inherit from
609609
:class:`~factory.django.DjangoModelFactory`
@@ -633,7 +633,7 @@ In order to upgrade client code, apply the following rules:
633633
1.1.5 (2012-07-09)
634634
------------------
635635

636-
*Bugfix:*
636+
*Bug fix:*
637637

638638
- Fix :class:`~factory.PostGenerationDeclaration` and derived classes.
639639

@@ -657,7 +657,7 @@ In order to upgrade client code, apply the following rules:
657657
1.1.3 (2012-03-09)
658658
------------------
659659

660-
*Bugfix:*
660+
*Bug fix:*
661661

662662
- Fix packaging rules
663663

@@ -696,9 +696,9 @@ In order to upgrade client code, apply the following rules:
696696
- Provide the :func:`~factory.make_factory` helper: ``MyClassFactory = make_factory(MyClass, x=3, y=4)``
697697
- Add :func:`~factory.build`, :func:`~factory.create`, :func:`~factory.stub` helpers
698698

699-
*Bugfix:*
699+
*Bug fix:*
700700

701-
- Allow classmethod/staticmethod on factories
701+
- Allow ``classmethod``/``staticmethod`` on factories
702702

703703
*Deprecation:*
704704

@@ -721,11 +721,11 @@ In order to upgrade client code, apply the following rules:
721721
- Provide :class:`~factory.django.DjangoModelFactory`, whose :class:`~factory.Sequence` counter starts at the next free database id
722722
- Introduce :class:`~factory.SelfAttribute`, a shortcut for ``factory.LazyAttribute(lambda o: o.foo.bar.baz``.
723723

724-
*Bugfix:*
724+
*Bug fix:*
725725

726726
- Handle nested :class:`~factory.SubFactory`
727727
- Share sequence counter between parent and subclasses
728-
- Fix :class:`~factory.SubFactory` / :class:`~factory.Sequence` interferences
728+
- Fix :class:`~factory.SubFactory` / :class:`~factory.Sequence` interference
729729

730730

731731
.. _v1.0.2:
@@ -748,7 +748,7 @@ In order to upgrade client code, apply the following rules:
748748
- Allow :class:`~factory.Factory` inheritance
749749
- Improve handling of custom build/create functions
750750

751-
*Bugfix:*
751+
*Bug fix:*
752752

753753
- Fix concurrency between :class:`~factory.LazyAttribute` and :class:`~factory.Sequence`
754754

@@ -766,8 +766,6 @@ In order to upgrade client code, apply the following rules:
766766
Credits
767767
-------
768768

769-
* Initial version by Mark Sandstrom (2010)
770-
* Developed by Raphaël Barrois since 2011
771-
769+
See :doc:`credits`.
772770

773771
.. vim:et:ts=4:sw=4:tw=119:ft=rst:

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,9 @@
8585
'https://docs.sqlalchemy.org/en/latest/objects.inv',
8686
),
8787
}
88+
89+
90+
# -- spelling ---------------------------------------------------------------
91+
spelling_exclude_patterns = [
92+
'credits.rst',
93+
]

docs/internals.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ Parsing, Step 2: adapting the class definition
4646
for declaration ``foo``.
4747

4848

49-
Instantiating, Step 1: Converging entrypoints
50-
---------------------------------------------
49+
Instantiating, Step 1: Converging entry points
50+
----------------------------------------------
5151

5252
First, decide the strategy:
5353

54-
- If the entrypoint is specific to a strategy (:meth:`~Factory.build`,
54+
- If the entry point is specific to a strategy (:meth:`~Factory.build`,
5555
:meth:`~Factory.create_batch`, ...), use it
5656
- If it is generic (:meth:`~Factory.generate`, :meth:`Factory.__call__`),
5757
use the strategy defined at the :attr:`class Meta <Factory.Meta>` level
5858

5959

6060
Then, we'll pass the strategy and passed-in overrides to the :meth:`~Factory._generate` method.
6161

62-
.. note:: According to the project roadmap, a future version will use a :meth:`~Factory._generate_batch`` at its core instead.
62+
.. note:: According to the project road map, a future version will use a :meth:`~Factory._generate_batch`` at its core instead.
6363

6464
A factory's :meth:`~Factory._generate` function actually delegates to a ``StepBuilder()`` object.
6565
This object will carry the overall "build an object" context (strategy, depth, and possibly other).

docs/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ This is handled by the :data:`~factory.FactoryOptions.inline_args` attribute:
266266
<MyClass(1, 4, z=3)>
267267
268268
269-
Altering a factory's behaviour: parameters and traits
270-
-----------------------------------------------------
269+
Altering a factory's behavior: parameters and traits
270+
----------------------------------------------------
271271

272272
Some classes are better described with a few, simple parameters, that aren't fields on the actual model.
273273
In that case, use a :attr:`~factory.Factory.Params` declaration:

docs/orms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ To work, this class needs an `SQLAlchemy`_ session object affected to the :attr:
334334

335335
.. attribute:: sqlalchemy_session_persistence
336336

337-
Control the action taken by sqlalchemy session at the end of a create call.
337+
Control the action taken by ``sqlalchemy_session`` at the end of a create call.
338338

339339
Valid values are:
340340

0 commit comments

Comments
 (0)