diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b04a3e05a..7d1960ae6 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -106,6 +106,7 @@ Bart Louwers Sam Penny Yutsuten Zoom +Stefan Kangas ******************** diff --git a/docs/development.md b/docs/development.md index 5aaeccb9c..5ac6b6413 100644 --- a/docs/development.md +++ b/docs/development.md @@ -95,7 +95,7 @@ about 6 gigabytes of temporary files. Once you've created the wheels, you can remove the other files to free up space if you wish. - `bazel clean --expunge` will remove the generated Bazel files, freeing up - most of the space. The files are usualy stored in a subdir of + most of the space. The files are usually stored in a subdir of `~/.cache/bazel` or `\bazel\anki` - `rm -rf ~/.cache/bazel*` or `\bazel\anki` will remove cached downloads as well, requiring them to be redownloaded if you want to build again. diff --git a/docs/protobuf.md b/docs/protobuf.md index 240b73beb..df5f3927f 100644 --- a/docs/protobuf.md +++ b/docs/protobuf.md @@ -1,7 +1,7 @@ # Protocol Buffers Anki uses [different implementations of Protocol Buffers](./architecture.md#protobuf) -and each has its own pecularities. This document highlights some aspects relevant +and each has its own peculiarities. This document highlights some aspects relevant to Anki and hopefully helps to avoid some common pitfalls. For information about Protobuf's types and syntax, please see the official [language guide](https://developers.google.com/protocol-buffers/docs/proto3). @@ -83,8 +83,8 @@ when choosing _Downgrade_), does not make use of Protobuf messages. ### Field Numbers Field numbers larger than 15 need an additional byte to encode, so `repeated` fields -should preferrably be assigned a number between 1 and 15. If a message contains -`reserved` fields, this is usually to accomodate potential future `repeated` fields. +should preferably be assigned a number between 1 and 15. If a message contains +`reserved` fields, this is usually to accommodate potential future `repeated` fields. ## Implementation-Specific Notes diff --git a/proto/anki/backend.proto b/proto/anki/backend.proto index 6cb7959f9..f57e24c7a 100644 --- a/proto/anki/backend.proto +++ b/proto/anki/backend.proto @@ -72,7 +72,7 @@ message BackendError { Kind kind = 2; // optional page in the manual optional links.HelpPageLinkRequest.HelpPage help_page = 3; - // additional information about the context in which the error occured + // additional information about the context in which the error occurred string context = 4; // a backtrace of the underlying error; requires RUST_BACKTRACE to be set string backtrace = 5; diff --git a/proto/anki/scheduler.proto b/proto/anki/scheduler.proto index f7c049b00..cc4b46834 100644 --- a/proto/anki/scheduler.proto +++ b/proto/anki/scheduler.proto @@ -259,7 +259,7 @@ message CustomStudyRequest { CRAM_KIND_ALL = 3; } CramKind kind = 1; - // the maximimum number of cards + // the maximum number of cards uint32 card_limit = 2; // cards must match one of these, if unempty repeated string tags_to_include = 3; diff --git a/pylib/anki/BUILD.bazel b/pylib/anki/BUILD.bazel index 64b104ed5..480b7ba4b 100644 --- a/pylib/anki/BUILD.bazel +++ b/pylib/anki/BUILD.bazel @@ -74,7 +74,7 @@ py_wheel( "//platforms:macos_x86_64": "macosx_10_13_x86_64", "//platforms:macos_arm64": "macosx_11_0_arm64", # the glibc versions below are set for the official builds; - # you can adjust them to suit your enviroment + # you can adjust them to suit your environment "//platforms:linux_x86_64": "manylinux_2_28_x86_64", "//platforms:linux_arm64": "manylinux_2_31_aarch64", }), diff --git a/pylib/anki/_vendor/stringcase.py b/pylib/anki/_vendor/stringcase.py index 01007129c..316b212a1 100644 --- a/pylib/anki/_vendor/stringcase.py +++ b/pylib/anki/_vendor/stringcase.py @@ -120,7 +120,7 @@ def backslashcase(string): str1 = re.sub(r"_", r"\\", snakecase(string)) return str1 - # return re.sub(r"\\n", "", str1)) # TODO: make regex fot \t ... + # return re.sub(r"\\n", "", str1)) # TODO: make regex for \t ... def sentencecase(string): @@ -249,7 +249,7 @@ def alphanumcase(string): string: String to convert. Returns: - string: String with cutted non-alphanumeric symbols. + string: String with cut non-alphanumeric symbols. """ # return filter(str.isalnum, str(string)) diff --git a/pylib/anki/importing/supermemo_xml.py b/pylib/anki/importing/supermemo_xml.py index 4064f8aa5..6cbae01e4 100644 --- a/pylib/anki/importing/supermemo_xml.py +++ b/pylib/anki/importing/supermemo_xml.py @@ -23,7 +23,7 @@ class SmartDict(dict): See http://www.peterbe.com/plog/SmartDict Copyright 2005, Peter Bengtsson, peter@fry-it.com - A smart dict can be instanciated either from a pythonic dict + A smart dict can be instantiated either from a pythonic dict or an instance object (eg. SQL recordsets) but it ensures that you can do all the convenient lookups such as x.first_name, x['first_name'] or x.get('first_name'). @@ -84,7 +84,7 @@ class SupermemoXmlImporter(NoteImporter): """ def __init__(self, col: Collection, file: str) -> None: - """Initialize internal varables. + """Initialize internal variables. Pameters to be exposed to GUI are stored in self.META""" NoteImporter.__init__(self, col, file) m = _legacy_add_basic_model(self.col) @@ -108,7 +108,7 @@ class SupermemoXmlImporter(NoteImporter): self.cntMeta.popTitles = False self.cntMeta.title = [] - # META stores controls of import scritp, should be + # META stores controls of import script, should be # exposed to import dialog. These are default values. self.META = SmartDict() self.META.resetLearningData = False # implemented @@ -116,7 +116,7 @@ class SupermemoXmlImporter(NoteImporter): self.META.loggerLevel = 2 # implemented 0no,1info,2error,3debug self.META.tagAllTopics = True self.META.pathsToBeTagged = [ - "English for begginers", + "English for beginners", "Advanced English 97", "Phrasal Verbs", ] # path patterns to be tagged - in gui entered like 'Advanced English 97|My Vocablary' @@ -145,7 +145,7 @@ class SupermemoXmlImporter(NoteImporter): def _decode_htmlescapes(self, html: str) -> str: """Unescape HTML code.""" - # In case of bad formated html you can import MinimalSoup etc.. see BeautifulSoup source code + # In case of bad formatted html you can import MinimalSoup etc.. see BeautifulSoup source code from bs4 import BeautifulSoup # my sm2004 also ecaped & char in escaped sequences. @@ -254,7 +254,7 @@ class SupermemoXmlImporter(NoteImporter): # normalize - remove diacritic punctuation from unicode chars to ascii item.lTitle = [self._unicode2ascii(topic) for topic in item.lTitle] - # Transfrom xyz / aaa / bbb / ccc on Title path to Tag xyzAaaBbbCcc + # Transform xyz / aaa / bbb / ccc on Title path to Tag xyzAaaBbbCcc # clean things like [999] or [111-2222] from title path, example: xyz / [1000-1200] zyx / xyz # clean whitespaces # set Capital letters for first char of the word @@ -405,7 +405,7 @@ class SupermemoXmlImporter(NoteImporter): # migrate only memorized otherway skip/continue if self.META.onlyMemorizedItems and not (int(smel.Interval) > 0): - self.logger("Element skiped \t- not memorized ...", level=3) + self.logger("Element skipped \t- not memorized ...", level=3) else: # import sm element data to Anki self.addItemToCards(smel) @@ -418,11 +418,11 @@ class SupermemoXmlImporter(NoteImporter): "\t{} {}".format((key + ":").ljust(15), smel[key]), level=3 ) else: - self.logger("Element skiped \t- no valid Q and A ...", level=3) + self.logger("Element skipped \t- no valid Q and A ...", level=3) else: # now we know that item was topic - # parseing of whole node is now finished + # parsing of whole node is now finished # test if it's really topic if smel.Title is not None: diff --git a/python/python.bzl b/python/python.bzl index ee47bdc84..45edd29e0 100644 --- a/python/python.bzl +++ b/python/python.bzl @@ -52,7 +52,7 @@ def _get_platform(rctx): fail("unexpected platform", rctx.os.name) def _impl(rctx): - # bundled python overriden? + # bundled python overridden? if rctx.os.environ.get("PYO3_PYTHON"): path = rctx.os.environ.get("PYO3_PYTHON") rctx.symlink(path, "python") diff --git a/qt/aqt/addons.py b/qt/aqt/addons.py index 4790e5ed5..9a6805e82 100644 --- a/qt/aqt/addons.py +++ b/qt/aqt/addons.py @@ -407,7 +407,7 @@ class AddonManager: force_enable: bool = False, ) -> InstallOk | InstallError: """Install add-on from path or file-like object. Metadata is read - from the manifest file, with keys overriden by supplying a 'manifest' + from the manifest file, with keys overridden by supplying a 'manifest' dictionary""" try: zfile = ZipFile(file) diff --git a/qt/aqt/browser/table/table.py b/qt/aqt/browser/table/table.py index 242f7a027..ea1824d95 100644 --- a/qt/aqt/browser/table/table.py +++ b/qt/aqt/browser/table/table.py @@ -275,7 +275,7 @@ class Table: def _reset_selection(self) -> None: """Remove selection and focus without emitting signals. - If no selection change is triggerd afterwards, `browser.on_all_or_selected_rows_changed()` + If no selection change is triggered afterwards, `browser.on_all_or_selected_rows_changed()` and `browser.on_current_row_changed()` must be called. """ self._view.selectionModel().reset() diff --git a/qt/aqt/deckbrowser.py b/qt/aqt/deckbrowser.py index 752f88ba2..4e580521c 100644 --- a/qt/aqt/deckbrowser.py +++ b/qt/aqt/deckbrowser.py @@ -129,7 +129,7 @@ class DeckBrowser: _body = """
- +
%(tree)s
diff --git a/qt/aqt/importing.py b/qt/aqt/importing.py index ed04bbba2..904a7bcdd 100644 --- a/qt/aqt/importing.py +++ b/qt/aqt/importing.py @@ -124,7 +124,7 @@ class ImportDialog(QDialog): def onDelimiter(self) -> None: # Open a modal dialog to enter an delimiter - # Todo/Idea Constrain the maximum width, so it doesnt take up that much screen space + # Todo/Idea Constrain the maximum width, so it doesn't take up that much screen space delim, ok = getText( tr.importing_by_default_anki_will_detect_the(), self, diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 27f63f33d..33c1dd465 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -213,7 +213,7 @@ def _handle_local_file_request(request: LocalFileRequest) -> Response: def _builtin_data(path: str) -> bytes: """Return data from file in aqt/data folder. Path must use forward slash separators.""" - # overriden location? + # overridden location? if data_folder := os.getenv("ANKI_DATA_FOLDER"): full_path = os.path.join(data_folder, path) with open(full_path, "rb") as f: diff --git a/qt/aqt/reviewer.py b/qt/aqt/reviewer.py index 16504c54b..efd8d63b6 100644 --- a/qt/aqt/reviewer.py +++ b/qt/aqt/reviewer.py @@ -792,7 +792,7 @@ time = %(time)d; due, ) - buf = "
" + buf = "
" for ease, label in self._answerButtonList(): buf += but(ease, label) buf += "
" diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index cf8fa083a..ceba1e257 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -871,7 +871,7 @@ def current_window() -> QWidget | None: def send_to_trash(path: Path) -> None: - "Place file/folder in recyling bin, or delete permanently on failure." + "Place file/folder in recycling bin, or delete permanently on failure." if not path.exists(): return try: diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index b634b1115..b5f672c08 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -175,7 +175,7 @@ class WebContent: Important Notes: - When modifying the attributes specified above, please make sure your - changes only perform the minimum requried edits to make your add-on work. + changes only perform the minimum required edits to make your add-on work. You should avoid overwriting or interfering with existing data as much as possible, instead opting to append your own changes, e.g.: diff --git a/qt/bundle/win/fileassoc.nsh b/qt/bundle/win/fileassoc.nsh index f76c28e35..aa5a3a8c6 100644 --- a/qt/bundle/win/fileassoc.nsh +++ b/qt/bundle/win/fileassoc.nsh @@ -14,7 +14,7 @@ ; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "$INSTDIR\myapp.exe,0" \ ; "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\"" ; -; Never insert the APP_ASSOCIATE macro multiple times, it is only ment +; Never insert the APP_ASSOCIATE macro multiple times, it is only meant ; to associate an application with a single file and using the ; the "open" verb as default. To add more verbs (actions) to a file ; use the APP_ASSOCIATE_ADDVERB macro. diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 85f4b50b0..fe7c00e71 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -512,7 +512,7 @@ hooks = [ args=["columns: dict[str, aqt.browser.Column]"], doc="""Allows you to add custom columns to the browser. - columns is a dictionary of data obejcts. You can add an entry with a custom + columns is a dictionary of data objects. You can add an entry with a custom column to describe how it should be displayed in the browser or modify existing entries. diff --git a/rslib/src/config/deck.rs b/rslib/src/config/deck.rs index d78d7d387..d684534c0 100644 --- a/rslib/src/config/deck.rs +++ b/rslib/src/config/deck.rs @@ -5,7 +5,7 @@ use strum::IntoStaticStr; use crate::prelude::*; -/// Auxillary deck state, stored in the config table. +/// Auxiliary deck state, stored in the config table. #[derive(Debug, Clone, Copy, IntoStaticStr)] #[strum(serialize_all = "camelCase")] pub enum DeckConfigKey { diff --git a/rslib/src/media/files.rs b/rslib/src/media/files.rs index 2fae6bf04..ab3178770 100644 --- a/rslib/src/media/files.rs +++ b/rslib/src/media/files.rs @@ -255,7 +255,7 @@ fn split_and_truncate_filename(fname: &str, max_bytes: usize) -> (&str, &str) { } /// Return a substring on a valid UTF8 boundary. -/// Based on a funtion in the Rust stdlib. +/// Based on a function in the Rust stdlib. fn truncated_to_char_boundary(s: &str, mut max: usize) -> &str { if max >= s.len() { s diff --git a/rslib/src/notetype/cardgen.rs b/rslib/src/notetype/cardgen.rs index 9a15df913..6ebbc6584 100644 --- a/rslib/src/notetype/cardgen.rs +++ b/rslib/src/notetype/cardgen.rs @@ -75,7 +75,7 @@ impl> CardGenContext { } /// If template[ord] generates a non-empty question given nonempty_fields, return the provided - /// deck id, or an overriden one. If question is empty, return None. + /// deck id, or an overridden one. If question is empty, return None. fn is_nonempty(&self, card_ord: usize, nonempty_fields: &HashSet<&str>) -> bool { let card = &self.cards[card_ord]; let template = match card.template { diff --git a/rslib/src/scheduler/queue/mod.rs b/rslib/src/scheduler/queue/mod.rs index c9e4d8774..bb50efdb2 100644 --- a/rslib/src/scheduler/queue/mod.rs +++ b/rslib/src/scheduler/queue/mod.rs @@ -198,7 +198,7 @@ impl Collection { cutoff_snapshot, })); } else { - // we currenly allow the queues to be empty for unit tests + // we currently allow the queues to be empty for unit tests } Ok(()) diff --git a/rslib/src/scheduler/reviews.rs b/rslib/src/scheduler/reviews.rs index fe1d270ee..dfc62c672 100644 --- a/rslib/src/scheduler/reviews.rs +++ b/rslib/src/scheduler/reviews.rs @@ -68,7 +68,7 @@ pub fn parse_due_date_str(s: &str) -> Result { r#"(?x)^ # a number (?P\d+) - # an optional hypen and another number + # an optional hyphen and another number (?: - (?P\d+) diff --git a/rslib/src/scheduler/timing.rs b/rslib/src/scheduler/timing.rs index caffbe711..e536cf3f5 100644 --- a/rslib/src/scheduler/timing.rs +++ b/rslib/src/scheduler/timing.rs @@ -271,7 +271,7 @@ mod test { // with the current time being MST let now = mst.ymd(2019, 12, 26).and_hms(20, 0, 0).timestamp(); assert_eq!(elap(crt, now, mdt_offset, mst_offset, 4), 507); - // the previous implementation generated a diferent elapsed number of days with a change + // the previous implementation generated a different elapsed number of days with a change // to DST, but the number shouldn't change assert_eq!(elap(crt, now, mdt_offset, mdt_offset, 4), 507); diff --git a/rslib/src/tags/findreplace.rs b/rslib/src/tags/findreplace.rs index 7f3dcac69..a11e35ce8 100644 --- a/rslib/src/tags/findreplace.rs +++ b/rslib/src/tags/findreplace.rs @@ -9,7 +9,7 @@ use super::{is_tag_separator, join_tags, split_tags}; use crate::{notes::NoteTags, prelude::*}; impl Collection { - /// Replace occurences of a search with a new value in tags. + /// Replace occurrences of a search with a new value in tags. pub fn find_and_replace_tag( &mut self, nids: &[NoteId], diff --git a/rslib/src/timestamp.rs b/rslib/src/timestamp.rs index 79693bb25..a9c7eb6eb 100644 --- a/rslib/src/timestamp.rs +++ b/rslib/src/timestamp.rs @@ -87,7 +87,7 @@ impl TimestampMillis { fn elapsed() -> time::Duration { if *crate::PYTHON_UNIT_TESTS { - // shift clock around rollover time to accomodate Python tests that make bad assumptions. + // shift clock around rollover time to accommodate Python tests that make bad assumptions. // we should update the tests in the future and remove this hack. let mut elap = time::SystemTime::now() .duration_since(time::SystemTime::UNIX_EPOCH) diff --git a/ts/domlib/surround/surround-format.ts b/ts/domlib/surround/surround-format.ts index ec5222960..af4dd2b79 100644 --- a/ts/domlib/surround/surround-format.ts +++ b/ts/domlib/surround/surround-format.ts @@ -12,7 +12,7 @@ export interface SurroundFormat { */ matcher: (element: HTMLElement | SVGElement, match: MatchType) => void; /** - * @returns Whehter before or after are allowed to merge to a single + * @returns Whether before or after are allowed to merge to a single * FormattingNode range */ merger?: (before: FormattingNode, after: FormattingNode) => boolean; diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte index ee5f29554..e7b6afd65 100644 --- a/ts/editor/NoteEditor.svelte +++ b/ts/editor/NoteEditor.svelte @@ -381,7 +381,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html Serves as a pre-slotted convenience component which combines all the common components and functionality for general note editing. -Functionality exclusive to specifc note-editing views (e.g. in the browser or +Functionality exclusive to specific note-editing views (e.g. in the browser or the AddCards dialog) should be implemented in the user of this component. -->
diff --git a/ts/editor/symbols-overlay/character-entities.ts b/ts/editor/symbols-overlay/character-entities.ts index 286963f12..51c3f3b75 100644 --- a/ts/editor/symbols-overlay/character-entities.ts +++ b/ts/editor/symbols-overlay/character-entities.ts @@ -8,7 +8,7 @@ import type { SymbolsTable } from "./symbols-types"; // Not all characters work well in the editor field delete characterEntities["Tab"]; -// A single character entity can be present under differnet names +// A single character entity can be present under different names // So we change the mapping to symbol => name[] const characterTable: Record = {}; diff --git a/ts/sveltelib/closing-click.ts b/ts/sveltelib/closing-click.ts index 99bf0d1bf..8a616a6ca 100644 --- a/ts/sveltelib/closing-click.ts +++ b/ts/sveltelib/closing-click.ts @@ -26,7 +26,7 @@ interface ClosingClickArgs { /** * Returns a derived store, which translates `MouseEvent`s into a boolean - * indicating whether they constitue a click that should close `floating`. + * indicating whether they constitute a click that should close `floating`. * * @param: Should be an event store wrapping document.click. */ diff --git a/ts/sveltelib/closing-keyup.ts b/ts/sveltelib/closing-keyup.ts index 187e0b36c..3be7543df 100644 --- a/ts/sveltelib/closing-keyup.ts +++ b/ts/sveltelib/closing-keyup.ts @@ -17,7 +17,7 @@ interface ClosingKeyupArgs { /** * Returns a derived store, which translates `MouseEvent`s into a boolean - * indicating whether they constitue a click that should close `floating`. + * indicating whether they constitute a click that should close `floating`. * * @param: Should be an event store wrapping document.click. */ diff --git a/ts/sveltelib/dynamic-slotting.ts b/ts/sveltelib/dynamic-slotting.ts index f0bfb7f5d..6b169ee72 100644 --- a/ts/sveltelib/dynamic-slotting.ts +++ b/ts/sveltelib/dynamic-slotting.ts @@ -69,7 +69,7 @@ export interface DynamicSlottingAPI< * Allow add-on developers to dynamically extend/modify components our components * * @remarks - * It allows to insert elements inbetween the components, or modify their props. + * It allows to insert elements in between the components, or modify their props. * Practically speaking, we let Svelte do the initial insertion of an element, * but then immediately move it to its destination, and save a reference to it. *