From 9c3419f8dc88e58f16f405802d4984f3c7a50121 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 9 Jan 2024 14:28:46 -0500 Subject: [PATCH 1/6] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..daa4072c1a --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From f84c9d33e36058e61be74348e65a061e9c991ba0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 9 Jan 2024 14:28:46 -0500 Subject: [PATCH 2/6] Add rudimentary codespell config --- .codespellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..1526b43c1c --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +skip = .git,*.pdf,*.svg,go.sum,*.css,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From edb945062d4502dc1af692dfd214f172ad51ce5b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 9 Jan 2024 14:30:53 -0500 Subject: [PATCH 3/6] Ignore translations etc for codespell --- .codespellrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 1526b43c1c..b57b53ab5a 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,7 @@ # Ref: https://github.com/codespell-project/codespell#using-a-config-file [codespell] -skip = .git,*.pdf,*.svg,go.sum,*.css,.codespellrc +skip = .git,*.pdf,*.svg,go.sum,*.css,.codespellrc,translations check-hidden = true -# ignore-regex = +# ignore translations, names, etc +ignore-regex = (Comment|GenericName)\[.*|\bSimon Ser\b|DoubleClick|{0xf.*, (true|false),.*|\b\S+&\S+\b # ignore-words-list = From 39fd616b22ce9df4723a784be64d37fa27fdb263 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 9 Jan 2024 14:34:53 -0500 Subject: [PATCH 4/6] [DATALAD RUNCMD] run codespell throughout but ignore fail === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/installation.rst | 2 +- docs/scripting-api.rst | 2 +- plugins/itemfakevim/fakevim/fakevimhandler.cpp | 8 ++++---- plugins/itemtext/itemtext.cpp | 2 +- src/common/action.cpp | 4 ++-- src/tests/tests.cpp | 2 +- utils/fedora/copyq.spec | 4 ++-- utils/update_icon_font.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index b92e5c06af..fe3b8c43cb 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -18,7 +18,7 @@ install stable version from official repositories: .. code-block:: bash sudo apt install copyq - # copyq-plugins and copyq-doc is splitted out and can be installed independently + # copyq-plugins and copyq-doc is split out and can be installed independently On **Ubuntu** set up the official PPA repository and install the app from terminal: diff --git a/docs/scripting-api.rst b/docs/scripting-api.rst index 610c860eb5..30859fe11d 100644 --- a/docs/scripting-api.rst +++ b/docs/scripting-api.rst @@ -273,7 +273,7 @@ unlike in GUI, where row numbers start from 1 by default. Returns true only if clipboard contains MIME type. - :returns: ``true`` if clipboad contains the format, otherwise ``false``. + :returns: ``true`` if clipboard contains the format, otherwise ``false``. :rtype: bool .. js:function:: hasSelectionFormat(mimeType) diff --git a/plugins/itemfakevim/fakevim/fakevimhandler.cpp b/plugins/itemfakevim/fakevim/fakevimhandler.cpp index a29996539b..f5003340a3 100644 --- a/plugins/itemfakevim/fakevim/fakevimhandler.cpp +++ b/plugins/itemfakevim/fakevim/fakevimhandler.cpp @@ -864,7 +864,7 @@ static QString getProcessOutput(const QString &command, const QString &input) proc.write(toLocalEncoding(input)); proc.closeWriteChannel(); - // FIXME: Process should be interruptable by user. + // FIXME: Process should be interruptible by user. // Solution is to create a QObject for each process and emit finished state. proc.waitForFinished(); @@ -4091,7 +4091,7 @@ bool FakeVimHandler::Private::handleMovement(const Input &input) } else if (input.is('/') || input.is('?')) { g.lastSearchForward = input.is('/'); if (s.useCoreSearch.value()) { - // re-use the core dialog. + // reuse the core dialog. g.findPending = true; m_findStartPosition = position(); g.movetype = MoveExclusive; @@ -6504,7 +6504,7 @@ bool FakeVimHandler::Private::handleExMultiRepeatCommand(const ExCommand &cmd) { // :[range]g[lobal]/{pattern}/[cmd] // :[range]g[lobal]!/{pattern}/[cmd] - // :[range]v[globa]!/{pattern}/[cmd] + // :[range]v[global]!/{pattern}/[cmd] const bool hasG = cmd.matches("g", "global"); const bool hasV = cmd.matches("v", "vglobal"); if (!hasG && !hasV) @@ -9202,7 +9202,7 @@ bool FakeVimHandler::Private::selectArgumentTextObject(bool inner) tcEnd.setPosition(tcEnd.position() + 1); } - // Never include the opening paranthesis + // Never include the opening parenthesis if (characterAt(tcStart.position()) == '(') { tcStart.setPosition(tcStart.position() + 1); } else if (inner) { diff --git a/plugins/itemtext/itemtext.cpp b/plugins/itemtext/itemtext.cpp index 13f1f9faa3..7bedce2eb7 100644 --- a/plugins/itemtext/itemtext.cpp +++ b/plugins/itemtext/itemtext.cpp @@ -38,7 +38,7 @@ const QLatin1String optionMaximumLines("max_lines"); const QLatin1String optionMaximumHeight("max_height"); const QLatin1String optionDefaultStyleSheet("default_style_sheet"); -// Some applications insert \0 teminator at the end of text data. +// Some applications insert \0 terminator at the end of text data. // It needs to be removed because QTextBrowser can render the character. void removeTrailingNull(QString *text) { diff --git a/src/common/action.cpp b/src/common/action.cpp index 2c33053f1d..56465ec532 100644 --- a/src/common/action.cpp +++ b/src/common/action.cpp @@ -29,10 +29,10 @@ void startProcess(QProcess *process, const QStringList &args, QIODevice::OpenMod } template -void appendAndClearNonEmpty(Entry &entry, Container &containter) +void appendAndClearNonEmpty(Entry &entry, Container &container) { if ( !entry.isEmpty() ) { - containter.append(entry); + container.append(entry); entry.clear(); } } diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp index 1a019547b3..efbd6940d6 100644 --- a/src/tests/tests.cpp +++ b/src/tests/tests.cpp @@ -2453,7 +2453,7 @@ void Tests::configMaxitems() RUN("separator" << " " << "read" << "0" << "1", "F E"); RUN("size", "2\n"); - // Ading too many items fails. + // Adding too many items fails. RUN_EXPECT_ERROR("add" << "1" << "2" << "3", CommandException); RUN("separator" << " " << "read" << "0" << "1", "F E"); RUN("size", "2\n"); diff --git a/utils/fedora/copyq.spec b/utils/fedora/copyq.spec index e3aff0e30b..a00236ed74 100644 --- a/utils/fedora/copyq.spec +++ b/utils/fedora/copyq.spec @@ -227,10 +227,10 @@ appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/com.gi - Upstream release rhbz#1332032 * Sun Feb 14 2016 Gerald Cox - 2.6.1-1 -- Upstream releease rhbz#1308340 +- Upstream release rhbz#1308340 * Sat Feb 06 2016 Gerald Cox - 2.6.0-1 -- Upstream releease rhbz#1305247 +- Upstream release rhbz#1305247 * Wed Feb 03 2016 Fedora Release Engineering - 2.5.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/utils/update_icon_font.py b/utils/update_icon_font.py index fdcc823371..82288eae1f 100755 --- a/utils/update_icon_font.py +++ b/utils/update_icon_font.py @@ -2,7 +2,7 @@ ''' Updates icon font and header files for CopyQ repository. -First argument is path to upacked Font Awesome archive (https://fontawesome.com/). +First argument is path to unpacked Font Awesome archive (https://fontawesome.com/). ''' import json import os From fbde264ba133809aa5e7c06bdfc0b2fdf8dc868b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 9 Jan 2024 14:36:03 -0500 Subject: [PATCH 5/6] [DATALAD RUNCMD] Do interactive fixing of some ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- plugins/itemfakevim/fakevim/fakevimhandler.cpp | 2 +- src/platform/dummy/dummyclipboard.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/itemfakevim/fakevim/fakevimhandler.cpp b/plugins/itemfakevim/fakevim/fakevimhandler.cpp index f5003340a3..d050297e0e 100644 --- a/plugins/itemfakevim/fakevim/fakevimhandler.cpp +++ b/plugins/itemfakevim/fakevim/fakevimhandler.cpp @@ -8940,7 +8940,7 @@ void FakeVimHandler::Private::selectParagraphTextObject(bool inner) moveToParagraphStartOrEnd(d); - // If selection already changed, decreate count. + // If selection already changed, decrease count. if ((setupAnchor && g.submode != NoSubMode) || oldVisualMode != g.visualMode || m_cursor != oldCursor) diff --git a/src/platform/dummy/dummyclipboard.cpp b/src/platform/dummy/dummyclipboard.cpp index 8ca48244c1..e68596e96f 100644 --- a/src/platform/dummy/dummyclipboard.cpp +++ b/src/platform/dummy/dummyclipboard.cpp @@ -58,7 +58,7 @@ const QMimeData *DummyClipboard::mimeData(ClipboardMode mode) const } if (isHidden(*data)) { - log( QStringLiteral("Hidding secret %1 data").arg(modeText) ); + log( QStringLiteral("Hiding secret %1 data").arg(modeText) ); return nullptr; } From e10c0fb9154b03ff5f0b2b01355e9acc237d5169 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 9 Jan 2024 14:38:30 -0500 Subject: [PATCH 6/6] Allow for pragma skips and ignore generally annotated shortcuts --- .codespellrc | 4 ++-- plugins/itemfakevim/fakevim/fakevimactions.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.codespellrc b/.codespellrc index b57b53ab5a..aac092f085 100644 --- a/.codespellrc +++ b/.codespellrc @@ -2,6 +2,6 @@ [codespell] skip = .git,*.pdf,*.svg,go.sum,*.css,.codespellrc,translations check-hidden = true -# ignore translations, names, etc -ignore-regex = (Comment|GenericName)\[.*|\bSimon Ser\b|DoubleClick|{0xf.*, (true|false),.*|\b\S+&\S+\b +# ignore translations, names, Some&annotations, etc +ignore-regex = (Comment|GenericName)\[.*|\bSimon Ser\b|DoubleClick|{0xf.*, (true|false),.*|\b\S+&(amp;)?\S+\b|.*codespell-ignore.* # ignore-words-list = diff --git a/plugins/itemfakevim/fakevim/fakevimactions.cpp b/plugins/itemfakevim/fakevim/fakevimactions.cpp index f8eee8df32..9745bf23fa 100644 --- a/plugins/itemfakevim/fakevim/fakevimactions.cpp +++ b/plugins/itemfakevim/fakevim/fakevimactions.cpp @@ -91,7 +91,7 @@ FakeVimSettings::FakeVimSettings() setup(&isKeyword, "@,48-57,_,192-255,a-z,A-Z", "IsKeyword", "isk", tr("Keyword characters:")); setup(&clipboard, {}, "Clipboard", "cb", tr("")); - setup(&formatOptions, {}, "formatoptions", "fo", tr("")); + setup(&formatOptions, {}, "formatoptions", "fo", tr("")); // pragma: codespell-ignore // Emulated plugins setup(&emulateVimCommentary, false, "commentary", {}, "vim-commentary");