Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codespell config + workflow and make it fix some typos #2588

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
skip = .git,*.pdf,*.svg,go.sum,*.css,.codespellrc,translations
check-hidden = true
# 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 =
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/scripting-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion plugins/itemfakevim/fakevim/fakevimactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
10 changes: 5 additions & 5 deletions plugins/itemfakevim/fakevim/fakevimhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]
hluk marked this conversation as resolved.
Show resolved Hide resolved
const bool hasG = cmd.matches("g", "global");
const bool hasV = cmd.matches("v", "vglobal");
if (!hasG && !hasV)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/itemtext/itemtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/common/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ void startProcess(QProcess *process, const QStringList &args, QIODevice::OpenMod
}

template <typename Entry, typename Container>
void appendAndClearNonEmpty(Entry &entry, Container &containter)
void appendAndClearNonEmpty(Entry &entry, Container &container)
{
if ( !entry.isEmpty() ) {
containter.append(entry);
container.append(entry);
entry.clear();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/dummy/dummyclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/tests/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions utils/fedora/copyq.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> - 2.6.1-1
- Upstream releease rhbz#1308340
- Upstream release rhbz#1308340

* Sat Feb 06 2016 Gerald Cox <[email protected]> - 2.6.0-1
- Upstream releease rhbz#1305247
- Upstream release rhbz#1305247

* Wed Feb 03 2016 Fedora Release Engineering <[email protected]> - 2.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
Expand Down
2 changes: 1 addition & 1 deletion utils/update_icon_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down