From 6eabd4a3a1a203d2e924d689bc1b87a379185184 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 28 Nov 2022 19:36:36 +0300 Subject: [PATCH] chore: Use `codespell` to fix typos in comments. (#4794) First part of replacement of #4651 --- .../migrations/0015_2_add_doc_document_m2m_fields.py | 2 +- ietf/doc/models.py | 6 +++--- ietf/doc/templatetags/ietf_filters.py | 2 +- ietf/doc/tests.py | 4 ++-- ietf/doc/tests_draft.py | 2 +- ietf/doc/utils.py | 2 +- ietf/doc/views_charter.py | 4 ++-- ietf/doc/views_search.py | 2 +- ietf/group/models.py | 2 +- ietf/group/tests_info.py | 2 +- ietf/group/tests_review.py | 10 +++++----- ietf/ietfauth/tests.py | 4 ++-- ietf/liaisons/forms.py | 2 +- ietf/meeting/helpers.py | 2 +- ietf/meeting/management/commands/populate_attended.py | 2 +- ietf/meeting/models.py | 2 +- ietf/meeting/tests_views.py | 2 +- ietf/meeting/views.py | 2 +- ietf/nomcom/tests.py | 2 +- ietf/person/factories.py | 8 ++++---- ietf/person/utils.py | 2 +- ietf/review/migrations/0025_repair_assignments.py | 2 +- ietf/secr/groups/views.py | 2 +- ietf/secr/proceedings/proc_utils.py | 2 +- ietf/secr/utils/decorators.py | 2 +- ietf/secr/utils/group.py | 2 +- ietf/settings.py | 2 +- ietf/static/js/datepicker.js | 2 +- ietf/static/js/listjs-search.js | 2 +- ietf/submit/forms.py | 4 ++-- ietf/submit/tests.py | 2 +- ietf/sync/iana.py | 2 +- ietf/utils/management/commands/mergedata.py | 4 ++-- .../utils/migrations/0002_convert_timestamps_to_utc.py | 2 +- ietf/utils/patch.py | 6 +++--- ietf/utils/test_runner.py | 2 +- ietf/utils/tests.py | 2 +- ietf/utils/text.py | 2 +- 38 files changed, 54 insertions(+), 54 deletions(-) diff --git a/ietf/doc/migrations/0015_2_add_doc_document_m2m_fields.py b/ietf/doc/migrations/0015_2_add_doc_document_m2m_fields.py index 99ff30c55..e49a40396 100644 --- a/ietf/doc/migrations/0015_2_add_doc_document_m2m_fields.py +++ b/ietf/doc/migrations/0015_2_add_doc_document_m2m_fields.py @@ -61,7 +61,7 @@ class Migration(migrations.Migration): field=models.ManyToManyField(blank=True, related_name='tagdocs', through='doc.DocumentTags', to='name.DocTagName'), ), # Here we copy the content of the existing implicit m2m tables for - # the Document m2m fields into the explicit through tabeles, in order + # the Document m2m fields into the explicit through tables, in order # to be able to later set the correct id from name migrations.RunPython(timestamp, timestamp), migrations.RunSQL( diff --git a/ietf/doc/models.py b/ietf/doc/models.py index f758c3360..bb2175355 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -215,7 +215,7 @@ class DocumentInfo(models.Model): which returns an url to the datatracker page for the document. """ # If self.external_url truly is an url, use it. This is a change from - # the earlier resulution order, but there's at the moment one single + # the earlier resolution order, but there's at the moment one single # instance which matches this (with correct results), so we won't # break things all over the place. if not hasattr(self, '_cached_href'): @@ -921,7 +921,7 @@ class Document(DocumentInfo): def last_presented(self): """ returns related SessionPresentation objects for the most recent meeting in the past""" - # Assumes no two meetings have the same start date - if the assumption is violated, one will be chosen arbitrariy + # Assumes no two meetings have the same start date - if the assumption is violated, one will be chosen arbitrarily today = date_today() candidate_presentations = self.sessionpresentation_set.filter(session__meeting__date__lte=today) candidate_meetings = set([p.session.meeting for p in candidate_presentations if p.session.meeting.end_date() 1: # should only inlcude one object (Person) + if len(deletable_objects_summary) > 1: # should only include one object (Person) print("Not Deleting Person: {}({})".format(source.ascii,source.pk), file=file) print("Related objects remain:", file=file) pprint.pprint(deletable_objects[1], stream=file) diff --git a/ietf/review/migrations/0025_repair_assignments.py b/ietf/review/migrations/0025_repair_assignments.py index 6f727255e..49ce65d02 100644 --- a/ietf/review/migrations/0025_repair_assignments.py +++ b/ietf/review/migrations/0025_repair_assignments.py @@ -140,7 +140,7 @@ def forward(apps, schema_editor): # review-ietf-detnet-mpls-over-udp-ip-06-opsdir-lc-romascanu-2020-09-03 2020-09-03 02:49:33 # review-ietf-detnet-mpls-over-udp-ip-06-opsdir-lc-romascanu-2020-09-03-2 2020-09-03 02:49:33 # - # Both of those are places where the submit button got hit twice in rapid successsion. + # Both of those are places where the submit button got hit twice in rapid succession. # Messages went to the list twice. No threads were started # The review assignments currently point to the -2 versions. I think we change them to point to the not -2 versions and delete the -2 version documents. # diff --git a/ietf/secr/groups/views.py b/ietf/secr/groups/views.py index 16b41a55a..48541efe3 100644 --- a/ietf/secr/groups/views.py +++ b/ietf/secr/groups/views.py @@ -230,7 +230,7 @@ def search(request): type = form.cleaned_data['type'] meeting = get_current_meeting() - # construct seach query + # construct search query if group_acronym: kwargs['acronym__istartswith'] = group_acronym if group_name: diff --git a/ietf/secr/proceedings/proc_utils.py b/ietf/secr/proceedings/proc_utils.py index 3961f907f..43d063d07 100644 --- a/ietf/secr/proceedings/proc_utils.py +++ b/ietf/secr/proceedings/proc_utils.py @@ -47,7 +47,7 @@ def _get_session(number,name,date,time): return assignment.session def _get_urls_from_json(doc): - '''Returns list of dictonary titel,url from search results''' + '''Returns list of dictionary title,url from search results''' urls = [] for item in doc['items']: title = item['snippet']['title'] diff --git a/ietf/secr/utils/decorators.py b/ietf/secr/utils/decorators.py index 3dcba2c96..f635bc7ec 100644 --- a/ietf/secr/utils/decorators.py +++ b/ietf/secr/utils/decorators.py @@ -18,7 +18,7 @@ from ietf.utils.response import permission_denied def check_for_cancel(redirect_url): """ - Decorator to make a view redirect to the given url if the reuqest is a POST which contains + Decorator to make a view redirect to the given url if the request is a POST which contains a submit=Cancel. """ def decorator(func): diff --git a/ietf/secr/utils/group.py b/ietf/secr/utils/group.py index 44ef5f022..a4c1c0f98 100644 --- a/ietf/secr/utils/group.py +++ b/ietf/secr/utils/group.py @@ -42,7 +42,7 @@ def get_my_groups(user,conclude=False): Returns a list of groups the user has access to. Rules are as follows secretariat - has access to all groups area director - has access to all groups in their area - wg chair or secretary - has acceses to their own group + wg chair or secretary - has access to their own group chair of irtf has access to all irtf groups If user=None than all groups are returned. diff --git a/ietf/settings.py b/ietf/settings.py index 8c1165cd6..37ebab643 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -630,7 +630,7 @@ MAX_WG_DELEGATES = 3 # document state: GROUP_STATES_WITH_EXTRA_PROCESSING = ["sub-pub", "rfc-edit", ] -# Review team releated settings +# Review team related settings GROUP_REVIEW_MAX_ITEMS_TO_SHOW_IN_REVIEWER_LIST = 10 GROUP_REVIEW_DAYS_TO_SHOW_IN_REVIEWER_LIST = 365 diff --git a/ietf/static/js/datepicker.js b/ietf/static/js/datepicker.js index c55d36675..1fe6d0314 100644 --- a/ietf/static/js/datepicker.js +++ b/ietf/static/js/datepicker.js @@ -1638,7 +1638,7 @@ options = typeof option === 'object' && option; if (!data){ var elopts = opts_from_el(this, 'date'), - // Preliminary otions + // Preliminary options xopts = $.extend({}, defaults, elopts, options), locopts = opts_from_locale(xopts.language), // Options priority: js args, data-attrs, locales, defaults diff --git a/ietf/static/js/listjs-search.js b/ietf/static/js/listjs-search.js index da921b25e..61a253375 100644 --- a/ietf/static/js/listjs-search.js +++ b/ietf/static/js/listjs-search.js @@ -119,7 +119,7 @@ module.exports = function (list) { var target = e.target || e.srcElement, // IE have srcElement alreadyCleared = target.value === '' && !list.searched if (!alreadyCleared) { - // If oninput already have resetted the list, do nothing + // If oninput has already reset the list, do nothing searchMethod(target.value) } }, list.searchDelay) diff --git a/ietf/submit/forms.py b/ietf/submit/forms.py index 4715f9bb5..79ecf46f6 100644 --- a/ietf/submit/forms.py +++ b/ietf/submit/forms.py @@ -799,8 +799,8 @@ class SubmissionEmailForm(forms.Form): Used to add a message to a submission or to create a new submission. This message is NOT a reply to a previous message but has arrived out of band - if submission_pk is None we are startign a new submission and name - must be unique. Otehrwise the name must match the submission.name. + if submission_pk is None we are starting a new submission and name + must be unique. Otherwise the name must match the submission.name. ''' name = forms.CharField(required=True, max_length=255, label="Draft name") submission_pk = forms.IntegerField(required=False, widget=forms.HiddenInput()) diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py index 9f6087d9b..03606b23f 100644 --- a/ietf/submit/tests.py +++ b/ietf/submit/tests.py @@ -1445,7 +1445,7 @@ class SubmitTests(BaseSubmitTestCase): self.assertEqual(r.status_code, 302) unprivileged_status_url = r['Location'] - # status page as unpriviliged => no edit button + # status page as unprivileged => no edit button r = self.client.get(unprivileged_status_url) self.assertContains(r, "Submission status of %s" % name) q = PyQuery(r.content) diff --git a/ietf/sync/iana.py b/ietf/sync/iana.py index 978b49507..9993d492a 100644 --- a/ietf/sync/iana.py +++ b/ietf/sync/iana.py @@ -195,7 +195,7 @@ def update_history_with_changes(changes, send_email=True): continue # the naive way of extracting prev_state here means - # that we assume these changes are cronologically + # that we assume these changes are chronologically # applied prev_state = doc.get_state(state_type) e = add_state_change_event(doc, system, prev_state, state, timestamp=timestamp) diff --git a/ietf/utils/management/commands/mergedata.py b/ietf/utils/management/commands/mergedata.py index 3a169c51e..861973482 100644 --- a/ietf/utils/management/commands/mergedata.py +++ b/ietf/utils/management/commands/mergedata.py @@ -188,7 +188,7 @@ class Command(LoadCommand): #debug.say("Found matching object with new pk: %s" % (obj.object.pk, )) new_pk = obj.object.pk if new_pk != old_pk: - # Update other objects refering to this + # Update other objects referring to this # object to use the new pk #debug.show('old_pk, new_pk') mname = model._meta.app_label + '.' + model.__name__ @@ -262,4 +262,4 @@ class Command(LoadCommand): fixture_files = [ (fixture_label, os.path.dirname(fixture_label) or os.getcwd(), os.path.basename(fixture_label)) ] else: fixture_files = super(Command, self).find_fixtures(fixture_label) - return fixture_files \ No newline at end of file + return fixture_files diff --git a/ietf/utils/migrations/0002_convert_timestamps_to_utc.py b/ietf/utils/migrations/0002_convert_timestamps_to_utc.py index 2494f177f..db4f34cd0 100644 --- a/ietf/utils/migrations/0002_convert_timestamps_to_utc.py +++ b/ietf/utils/migrations/0002_convert_timestamps_to_utc.py @@ -114,7 +114,7 @@ expected_datetime_columns = ( def convert_pre1970_timestamps(apps, schema_editor): """Convert timestamps that CONVERT_TZ cannot handle - This could be made to do the entire conversion but some tables that require converison + This could be made to do the entire conversion but some tables that require conversion do not use 'id' as their PK. Rather than reinvent the ORM, we'll let SQL do what it can with CONVERT_TZ and clean up after. The tables that have pre-1970 timestamps both have 'id' columns. diff --git a/ietf/utils/patch.py b/ietf/utils/patch.py index d14a34005..9de2270eb 100644 --- a/ietf/utils/patch.py +++ b/ietf/utils/patch.py @@ -185,7 +185,7 @@ def fromstring(s): def fromurl(url): """ Parse patch from an URL, return False - if an error occured. Note that this also + if an error occurred. Note that this also can throw urlopen() exceptions. """ ps = PatchSet( urllib_request.urlopen(url) ) @@ -749,7 +749,7 @@ class PatchSet(object): def diffstat(self): """ calculate diffstat and return as a string Notes: - - original diffstat ouputs target filename + - original diffstat outputs target filename - single + or - shouldn't escape histogram """ names = [] @@ -1181,7 +1181,7 @@ def main(): patch.apply(options.strip, root=options.directory.encode()) or sys.exit(-1) # todo: document and test line ends handling logic - patch.py detects proper line-endings - # for inserted hunks and issues a warning if patched file has incosistent line ends + # for inserted hunks and issues a warning if patched file has inconsistent line ends if __name__ == "__main__": diff --git a/ietf/utils/test_runner.py b/ietf/utils/test_runner.py index b4c952d2d..3e53808af 100644 --- a/ietf/utils/test_runner.py +++ b/ietf/utils/test_runner.py @@ -428,7 +428,7 @@ def get_template_paths(apps=None): def save_test_results(failures, test_labels): # Record the test result in a file, in order to be able to check the - # results and avoid re-running tests if we've alread run them with OK + # results and avoid re-running tests if we've already run them with OK # result after the latest code changes: tfile = io.open(".testresult", "a", encoding='utf-8') timestr = time.strftime("%Y-%m-%d %H:%M:%S") diff --git a/ietf/utils/tests.py b/ietf/utils/tests.py index 7051cdec6..f83ed4eef 100644 --- a/ietf/utils/tests.py +++ b/ietf/utils/tests.py @@ -162,7 +162,7 @@ def get_callbacks(urllist, namespace=None): callbacks.add(qualified(entry.name)) if hasattr(entry, 'lookup_str') and entry.lookup_str: callbacks.add(qualified(entry.lookup_str)) - # There are some entries we don't handle here, mostly clases + # There are some entries we don't handle here, mostly classes # (such as Feed subclasses) return list(callbacks) diff --git a/ietf/utils/text.py b/ietf/utils/text.py index 1f194a983..4bca87616 100644 --- a/ietf/utils/text.py +++ b/ietf/utils/text.py @@ -111,7 +111,7 @@ def fill(text, width): return "\n\n".join(wrapped) def wordwrap(text, width=80): - """Wraps long lines without loosing the formatting and indentation + """Wraps long lines without losing the formatting and indentation of short lines""" if not isinstance(text, str): return text