Skip to content

Commit 6ef9519

Browse files
veeceeyclaude
andcommitted
Defer exit in lint() and fix all duplicate-word cases
Restructure the duplicate-word check in lint() to set a failure flag instead of calling sys.exit(1) immediately, so all checks run before exiting. Fix all existing duplicate-word cases across the codebase by deduplicating or rephrasing as appropriate. Also require 2+ letter words in the duplicate-word pattern to avoid false positives from single-letter matches in escape sequences. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent d014d09 commit 6ef9519

30 files changed

Lines changed: 44 additions & 41 deletions

guides/api-style.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ The main reasons for preferring this style are:
149149
* Errors at test import time tend to throw people and be correspondingly hard
150150
for them to debug.
151151
There's an expectation that errors in your test code result in failures in
152-
your tests, and the fact that that test code happens to be defined in a
152+
your tests, and the fact that the test code happens to be defined in a
153153
decorator doesn't seem to change that expectation for people.
154154
* Things like deprecation warnings etc. localize better when they happen
155155
inside the test - test runners will often swallow them or put them in silly

guides/internals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ but is now just noise.
240240

241241
Because the shrinker runs in a big loop, if we've made progress the shrink pass
242242
will always be run again (assuming we don't hit some limit that terminates the
243-
shrink early, but by making the shrinker better we try to ensure that that
243+
shrink early, but by making the shrinker better we try to ensure that this
244244
never happens).
245245
This means that we will always get an opportunity to start again later if we
246246
made progress, and if we didn't make progress we've tried everything anyway.

guides/testing-hypothesis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Note: This guide is currently entirely specific to the Python version of
66
Hypothesis.
77

88
This is a guide to the process of testing Hypothesis itself, both how to
9-
run its tests and how to to write new ones.
9+
run its tests and how to write new ones.
1010

1111
--------------------------
1212
General Testing Philosophy

hypothesis-python/docs/changelog.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8272,7 +8272,7 @@ caused an internal error. This bug was introduced in :ref:`version 5.8.1 <v5.8.
82728272
5.10.1 - 2020-04-19
82738273
-------------------
82748274

8275-
This release is a small internal refactoring to how shrinking interacts with :ref:`targeted property-based testing <targeted>` that should have no user user visible impact.
8275+
This release is a small internal refactoring to how shrinking interacts with :ref:`targeted property-based testing <targeted>` that should have no user visible impact.
82768276

82778277
.. _v5.10.0:
82788278

@@ -8773,7 +8773,7 @@ Removals
87738773
- ``hypothesis.settings.buffer``, without replacement
87748774
- ``hypothesis.PrintSettings``, because :obj:`hypothesis.settings.print_blob` takes ``True`` or ``False``
87758775
- ``hypothesis.settings.timeout``, in favor of :obj:`hypothesis.settings.deadline`
8776-
- ``hypothesis.unlimited`` without replacement (only only useful as argument to ``timeout``)
8776+
- ``hypothesis.unlimited`` without replacement (only useful as argument to ``timeout``)
87778777

87788778
Hypothesis 4.x
87798779
==============
@@ -14193,7 +14193,7 @@ Hypothesis now emits deprecation warnings if you apply
1419314193
:func:`@given <hypothesis.given>` more than once to a target.
1419414194

1419514195
Applying :func:`@given <hypothesis.given>` repeatedly wraps the target multiple
14196-
times. Each wrapper will search the space of of possible parameters separately.
14196+
times. Each wrapper will search the space of possible parameters separately.
1419714197
This is equivalent but will be much more inefficient than doing it with a
1419814198
single call to :func:`@given <hypothesis.given>`.
1419914199

@@ -15659,7 +15659,7 @@ Minor bug fix release.
1565915659
can both now be called with an empty argument
1566015660
list, in which case they also never generate any values.
1566115661
* :func:`~hypothesis.strategies.one_of` may now be called with a single argument that is a collection of strategies
15662-
as well as as varargs.
15662+
as well as varargs.
1566315663
* Add a :func:`~hypothesis.strategies.runner` strategy which returns the instance of the current test object
1566415664
if there is one.
1566515665
* 'Bundle' for RuleBasedStateMachine is now a normal(ish) strategy and can be used
@@ -16807,7 +16807,7 @@ This release could also be called 1.0-RC1.
1680716807

1680816808
It contains a teeny tiny bugfix, but the real point of this release is to declare
1680916809
feature freeze. There will be zero functionality changes between 0.9.0 and 1.0 unless
16810-
something goes really really wrong. No new features will be added, no breaking API changes
16810+
something goes seriously wrong. No new features will be added, no breaking API changes
1681116811
will occur, etc. This is the final shakedown before I declare Hypothesis stable and ready
1681216812
to use and throw a party to celebrate.
1681316813

@@ -17026,7 +17026,7 @@ Bug fixes:
1702617026

1702717027
Other:
1702817028

17029-
* A lot of internals have been been rewritten. This shouldn't affect you at all, but
17029+
* A lot of internals have been rewritten. This shouldn't affect you at all, but
1703017030
it opens the way for certain of hypothesis's oddities to be a lot more extensible by
1703117031
users. Whether this is a good thing may be up for debate...
1703217032

hypothesis-python/src/_hypothesis_ftz_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def key(name: str) -> tuple[bool, int, str]:
147147

148148

149149
if __name__ == "__main__":
150-
# This would be really really annoying to write automated tests for, so I've
150+
# This would be extremely annoying to write automated tests for, so I've
151151
# done some manual exploratory testing: `pip install grequests gevent==21.12.0`,
152152
# and call print() as desired to observe behavior.
153153
import grequests # noqa

hypothesis-python/src/hypothesis/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ def _get_bytes(self, url: str) -> bytes | None: # pragma: no cover
10271027
else:
10281028
warning_message = (
10291029
"Could not get the latest artifact from GitHub. "
1030-
"This could be because because the repository "
1030+
"This could be because the repository "
10311031
"or artifact does not exist. "
10321032
)
10331033
# see https://github.com/python/cpython/issues/128734

hypothesis-python/src/hypothesis/extra/_array_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def _draw_loop_dimensions(self, data, use=None):
607607
else:
608608
side = dim_side
609609

610-
# Use a trick where where a biased coin is queried to see
610+
# Use a trick where a biased coin is queried to see
611611
# if the given shape-tuple will continue to be grown. All
612612
# of the relevant draws will still be made for the given
613613
# shape-tuple even if it is no longer being added to.

hypothesis-python/src/hypothesis/extra/array_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def indices(
784784
:func:`~hypothesis.strategies.slices` instead.
785785
* ``min_dims`` is the minimum dimensionality of the resulting array from use
786786
of the generated index.
787-
* ``max_dims`` is the the maximum dimensionality of the resulting array,
787+
* ``max_dims`` is the maximum dimensionality of the resulting array,
788788
defaulting to ``len(shape) if not allow_newaxis else
789789
max(len(shape), min_dims) + 2``.
790790
* ``allow_ellipsis`` specifies whether ``None`` is allowed in the index.

hypothesis-python/src/hypothesis/extra/numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ def basic_indices(
11661166
* ``min_dims`` is the minimum dimensionality of the resulting array from use
11671167
of the generated index. When ``min_dims == 0``, scalars and zero-dimensional
11681168
arrays are both allowed.
1169-
* ``max_dims`` is the the maximum dimensionality of the resulting array,
1169+
* ``max_dims`` is the maximum dimensionality of the resulting array,
11701170
defaulting to ``len(shape) if not allow_newaxis else
11711171
max(len(shape), min_dims) + 2``.
11721172
* ``allow_newaxis`` specifies whether ``None`` is allowed in the index.

hypothesis-python/src/hypothesis/internal/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def on_access(self, key: K, value: V, score: Any) -> Any:
193193
return score
194194

195195
def on_evict(self, key: K, value: V, score: Any) -> Any:
196-
"""Called after a key has been evicted, with the score it had had at
196+
"""Called after a key has been evicted, with the score it had at
197197
the point of eviction."""
198198

199199
def check_valid(self) -> None:

0 commit comments

Comments
 (0)