From 77976bb7bdf95ad0acd41fcc6bce26731e92d35a Mon Sep 17 00:00:00 2001 From: Anurag Agrawal Date: Thu, 23 Apr 2026 18:57:44 +0530 Subject: [PATCH] fix typos across the codebase --- CONTRIBUTING.md | 4 ++-- README.md | 4 ++-- docker/dev-db/README.md | 2 +- wp1/credentials.py.dev.example | 2 +- wp1/logic/builder_test.py | 2 +- wp1/scores.py | 4 ++-- wp1/web/oauth_test.py | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc3dda7ce..5c0229158 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ Pull requests should be focused and address a single concern. Include a clear de - All new code MUST include appropriate tests. This project proudly maintains over 90% test coverage. - Python tests for wp1/logic/foo.py should live in wp1/logic/foo_test.py. - Use the provided base test classes (in `base_db_test.py` and `wiki_db_test.py`). When you call `super().setUp()`, the base test class will handle giving you a fresh, empty database. - - Feel free ot make liberal use of `@patch` and mocks in Python tests. + - Feel free to make liberal use of `@patch` and mocks in Python tests. - Cypress frontend tests should almost ALWAYS mock the backend API (see the `fixtures` directory). - Similarly, Python tests should NEVER make actual outbound network requests, even if a service is free, idempotent or reliably available. Always mock the necessary methods on the `requests` library. - Follow existing patterns and conventions in the codebase. In particular: @@ -45,7 +45,7 @@ Pull requests should be focused and address a single concern. Include a clear de - The main exception to this is that data models that have tables in the database should have an [attrs](https://www.attrs.org/en/stable/) based data model class. So there is a a `selections` table and a `selection.py` data model class. - Flask API handlers (in `wp1/web/`) should strive to be as "lean" as possible. Don't put lots of complex logic there, instead delegate to methods in `wp1/logic`. - Long running or periodic tasks should be delegated to `rq`. - - It is better to raise an exception and "crash" a request than to give an incorrect or incomplete answer. However, forseeable error conditions should be handled, including providing detailed error messages. + - It is better to raise an exception and "crash" a request than to give an incorrect or incomplete answer. However, foreseeable error conditions should be handled, including providing detailed error messages. - User data should be validated on the frontend as a convenience, when possible. However ultimately all validation and policy enforcement is done in the backend. ## Usage of LLMs/AI coding assistants diff --git a/README.md b/README.md index 75b9d8c50..fd69ae518 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ You may need to install the `jq` tool with [these instructions](https://github.c necessary as they contain the latest parameters needed to run the `mwoffliner` scraper. - In your `credentials.py`, set the defintion version to any of the versions pulled from the API. For example, if `1.17.2` was one of the downloaded definitions of the mwoffliner scraper, you want to set `definition_version` under the `ZIMFARM` section: + In your `credentials.py`, set the definition version to any of the versions pulled from the API. For example, if `1.17.2` was one of the downloaded definitions of the mwoffliner scraper, you want to set `definition_version` under the `ZIMFARM` section: ```py "ZIMFARM": { @@ -277,7 +277,7 @@ pipenv run flask --app wp1.web.app --debug run ``` If you're having difficulties connecting to the backend server from the -frontend, especially in cypress e2e tests, and espcially on macOS, it might have +frontend, especially in cypress e2e tests, and especially on macOS, it might have something to do with IPv4 versus IPv6 networking stacks. You can try adding the option `--host 127.0.0.1` to the command line above (see https://github.com/openzim/wp1/pull/859). diff --git a/docker/dev-db/README.md b/docker/dev-db/README.md index c1b1ea5bc..2954eab9e 100644 --- a/docker/dev-db/README.md +++ b/docker/dev-db/README.md @@ -31,7 +31,7 @@ More information on YoYo Migrations is available After migrations have been applied to production and are stable, it makes sense to "permanently" apply them to the dev database dump so that the migrations do -not have to be run everytime the dev database is recreated. +not have to be run every time the dev database is recreated. As part of this process, you will create a MySQL dump file of the dev database. It is important to recognize that all data from your dev database will be included diff --git a/wp1/credentials.py.dev.example b/wp1/credentials.py.dev.example index e687af204..0c51fdb49 100644 --- a/wp1/credentials.py.dev.example +++ b/wp1/credentials.py.dev.example @@ -2,7 +2,7 @@ # for the dev rq workers, which run within the docker-compose environment and must # connect to redis and mysql using special paths. -# To get end-to-end testing in the dev enviroment to work YOU MUST EDIT THIS FILE in +# To get end-to-end testing in the dev environment to work YOU MUST EDIT THIS FILE in # the places indicated, then copy it to wp1/wp1/credentials.py.dev. Specifically, edit # the objects for the key 'STORAGE'. diff --git a/wp1/logic/builder_test.py b/wp1/logic/builder_test.py index 9d31fc105..382be1521 100644 --- a/wp1/logic/builder_test.py +++ b/wp1/logic/builder_test.py @@ -1833,7 +1833,7 @@ def test_regenerate_zim_updates_old_task_when_selection_version_changed( self, mock_utcnow, mock_request_zimfarm_task ): """ - Ensure the existing zim_task is updated (not dupplicated) when the selection version changes. + Ensure the existing zim_task is updated (not duplicated) when the selection version changes. """ self._insert_builder() zim_schedule_id = self._setup_failed_zim_regeneration_scenario( diff --git a/wp1/scores.py b/wp1/scores.py index aa864babe..2609e6b1c 100644 --- a/wp1/scores.py +++ b/wp1/scores.py @@ -226,11 +226,11 @@ def update_pageviews(filter_lang=None, commit_after=50000): n += 1 if n >= commit_after: - logger.debug("Commiting in temp db") + logger.debug("Committing in temp db") wp10db.commit() n = 0 wp10db.commit() - logger.debug("Swaping data from temp db to scores db") + logger.debug("Swapping data from temp db to scores db") swap_temp_pageviews_to_scores(wp10db) reset_missing_articles_pageviews(wp10db) truncate_temp_pageviews(wp10db) diff --git a/wp1/web/oauth_test.py b/wp1/web/oauth_test.py index a3cf75ca5..623ebc697 100644 --- a/wp1/web/oauth_test.py +++ b/wp1/web/oauth_test.py @@ -326,7 +326,7 @@ def test_initiate_dev_mode_idempotency(self): @patch("wp1.web.oauth.ENV", Environment.DEVELOPMENT) @patch("wp1.web.oauth.CREDENTIALS", DEV_NO_CREDS) def test_initiate_dev_mode_multiple_sessions_same_user(self): - """Test : different sesssions hitting initiate don't duplicate users.""" + """Test : different sessions hitting initiate don't duplicate users.""" self.app = create_app() with self.override_db(self.app): with self.app.test_client() as client1: