diff --git a/contrib/pg-import.py b/contrib/pg-import.py index 61c7a1a3..5288527a 100755 --- a/contrib/pg-import.py +++ b/contrib/pg-import.py @@ -6,7 +6,7 @@ # - update the sogs.ini to change the db to postgres # - start sogs # -# This operation is not currently reversible, this script is only ocassionally tested and may be +# This operation is not currently reversible, this script is only occasionally tested and may be # outdated, and you should not do this unless you know what you are doing. import psycopg diff --git a/docs/generate-api-docs.py b/docs/generate-api-docs.py index a9d629b3..1ad00ab1 100755 --- a/docs/generate-api-docs.py +++ b/docs/generate-api-docs.py @@ -29,7 +29,7 @@ "-o", "--output", type=str, - help="Specify output file (or directory, when using -m); specifing a - or omitting outputs to " + help="Specify output file (or directory, when using -m); specifying a - or omitting outputs to " "stdout, but is not accepted in multi-file (-m) mode.", ) parser.add_argument( diff --git a/sogs/migrations/seqno_etc.py b/sogs/migrations/seqno_etc.py index 2650374a..78828f32 100644 --- a/sogs/migrations/seqno_etc.py +++ b/sogs/migrations/seqno_etc.py @@ -27,7 +27,7 @@ def migrate(conn, *, check_only): raise DatabaseUpgradeRequired("sequence column renames & pinned_messages table") # We can't insert the required pinned_messages because we don't have the pinned_by user, but - # that isn't a big deal since we didn't have any endpoints for pinned messsages before this + # that isn't a big deal since we didn't have any endpoints for pinned messages before this # anyway, so we just recreate the whole thing (along with triggers which we also need to # update/fix) logging.warning("Recreating pinned_messages table") diff --git a/sogs/model/exc.py b/sogs/model/exc.py index 53588d6d..1dff3548 100644 --- a/sogs/model/exc.py +++ b/sogs/model/exc.py @@ -61,7 +61,7 @@ def __init__(self, msg=None): class InvalidData(RuntimeError): """Thrown if something in model was fed invalid data, for example a signature of an invalid - size, or an unparseable entity.""" + size, or an unparsable entity.""" class PostRejected(RuntimeError): diff --git a/sogs/model/room.py b/sogs/model/room.py index 7217b116..6991fa86 100644 --- a/sogs/model/room.py +++ b/sogs/model/room.py @@ -655,7 +655,7 @@ def get_messages_for( whisper_clause = ( # For a mod we want to see: - # - all whisper_mods messsages + # - all whisper_mods messages # - anything directed to us specifically # - anything we sent (i.e. outbound whispers) # - non-whispers diff --git a/sogs/routes/auth.py b/sogs/routes/auth.py index dbbf5abf..5f492f93 100644 --- a/sogs/routes/auth.py +++ b/sogs/routes/auth.py @@ -218,7 +218,7 @@ def handle_http_auth(): touching its last activity timestamp). If there are no auth headers at all this sets g.user to None. - If authentication headers are present but are unparseable (e.g. wrong size nonce, or failure to + If authentication headers are present but are unparsable (e.g. wrong size nonce, or failure to decode, or one or more of the headers are missing) then this throws a flask abort with a 400 Bad Request response. Otherwise this can return a request error of: - 401 Unauthorized -- invalid signature, for example because of nonce reuse or signature diff --git a/sogs/routes/dm.py b/sogs/routes/dm.py index ac09ec28..720c45c9 100644 --- a/sogs/routes/dm.py +++ b/sogs/routes/dm.py @@ -55,7 +55,7 @@ def poll_outbox(msgid): @auth.blind_user_required def get_inbox(): """ - Retrieves all of the user's recieved messages (up to `limit`). + Retrieves all of the user's received messages (up to `limit`). """ return _box(False) diff --git a/sogs/routes/general.py b/sogs/routes/general.py index ae6c4562..6e3c3985 100644 --- a/sogs/routes/general.py +++ b/sogs/routes/general.py @@ -15,7 +15,7 @@ def get_caps(): """ Return the list of server features/capabilities. Optionally takes a required= parameter - containing a comma-separated list of capabilites; if any are not satisfied we return a 412 + containing a comma-separated list of capabilities; if any are not satisfied we return a 412 (Precondition Failed) response with missing requested capabilities in the `missing` key. """ diff --git a/sogs/routes/messages.py b/sogs/routes/messages.py index 34b65447..980c1b0f 100644 --- a/sogs/routes/messages.py +++ b/sogs/routes/messages.py @@ -39,7 +39,7 @@ def messages_since(room, seqno): - `t` — string indicating the types of updates that the client supports, thus allowing the client to opt-out of update types that it does not yet support. Each letter of the string is - a flag; flags may be specified in any order, and are case-sensistive. Unknown flags are + a flag; flags may be specified in any order, and are case-sensitive. Unknown flags are ignored by SOGS (to allow for backwards compatibility). Current flags: - `r` — include message reaction updates diff --git a/sogs/routes/onion_request.py b/sogs/routes/onion_request.py index bdf53a3d..19914d11 100644 --- a/sogs/routes/onion_request.py +++ b/sogs/routes/onion_request.py @@ -160,7 +160,7 @@ def handle_v4_onionreq_plaintext(body): would be encoded as the two-string bencoded list: - l72:{"method":"POST","endpoint":"/some/thing","headers":{"Some-Header":"a"}}14:post body heree + l72:{"method":"POST","endpoint":"/some/thing","headers":{"Some-Header":"a"}}14:post body here ^^^^^^^^72-byte request info json^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^body^^^^^ The return value of the request is always a 2-part bencoded list where the first part contains diff --git a/tests/test_blinding.py b/tests/test_blinding.py index 9c46b599..015a1966 100644 --- a/tests/test_blinding.py +++ b/tests/test_blinding.py @@ -12,7 +12,7 @@ from auth import x_sogs -# For test reproducability use this fixed server pubkey for the blinding derivation tests (because +# For test reproducibility use this fixed server pubkey for the blinding derivation tests (because # each test environment typically has its own, which completely changes the derived pubkeys). fake_server_pubkey_bytes = bytes.fromhex( '6a32c7b491f4199dd1260a4cc60ae51c6bd71dad939cc521e738409f53f943be' diff --git a/tests/test_rooms.py b/tests/test_rooms.py index 59b4469e..f51b3228 100644 --- a/tests/test_rooms.py +++ b/tests/test_rooms.py @@ -608,7 +608,7 @@ def test_pinning(room, room2, user, mod, admin, global_admin, no_rate_limit): {"id": 6, "pinned_by": global_admin.session_id}, ] - # Non-existant id should fail + # Non-existent id should fail with pytest.raises(exc.NoSuchPost): room.pin(123, admin)