Skip to content

Commit 4b2ca6d

Browse files
authored
Add codespell support (config, CI action to detect new typos) + fix some typos (#605)
* Add github action to codespell master on push and PRs * Add rudimentary codespell config * Ignore some variable/email * [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * [DATALAD RUNCMD] Apply clang-format to fix indentation affected by codespell === Do not change lines below === { "chain": [], "cmd": "clang-format -i src/terminal/TelemetryService.cpp", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
1 parent 2f8dfdd commit 4b2ca6d

File tree

11 files changed

+48
-21
lines changed

11 files changed

+48
-21
lines changed

.codespellrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[codespell]
2+
skip = .git,*.pdf,*.svg,.codespellrc
3+
check-hidden = true
4+
ignore-regex = \[email protected]\b
5+
ignore-words-list = te

.github/workflows/codespell.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Codespell
3+
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
codespell:
15+
name: Check for spelling errors
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
- name: Codespell
22+
uses: codespell-project/actions-codespell@v2

.github/workflows/linux_ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
3131
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
32-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
32+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
3333
path: |
3434
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
3535
${{ env.VCPKG_ROOT }}
@@ -74,7 +74,7 @@ jobs:
7474
with:
7575
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
7676
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
77-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
77+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
7878
path: |
7979
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
8080
${{ env.VCPKG_ROOT }}
@@ -119,7 +119,7 @@ jobs:
119119
with:
120120
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
121121
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
122-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
122+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
123123
path: |
124124
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
125125
${{ env.VCPKG_ROOT }}
@@ -164,7 +164,7 @@ jobs:
164164
with:
165165
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
166166
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
167-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
167+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
168168
path: |
169169
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
170170
${{ env.VCPKG_ROOT }}
@@ -209,7 +209,7 @@ jobs:
209209
with:
210210
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
211211
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
212-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
212+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
213213
path: |
214214
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
215215
${{ env.VCPKG_ROOT }}

.github/workflows/mac_ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
3030
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
31-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
31+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
3232
path: |
3333
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
3434
${{ env.VCPKG_ROOT }}
@@ -73,7 +73,7 @@ jobs:
7373
with:
7474
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
7575
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
76-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
76+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
7777
path: |
7878
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
7979
${{ env.VCPKG_ROOT }}
@@ -117,7 +117,7 @@ jobs:
117117
with:
118118
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
119119
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
120-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
120+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
121121
path: |
122122
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
123123
${{ env.VCPKG_ROOT }}
@@ -161,7 +161,7 @@ jobs:
161161
with:
162162
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
163163
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
164-
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
164+
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
165165
path: |
166166
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
167167
${{ env.VCPKG_ROOT }}

cmake/Findsodium.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
########################################################################
1313
# Tries to find the local libsodium installation.
1414
#
15-
# On Windows the sodium_DIR enviroment variable is used as a default
15+
# On Windows the sodium_DIR environment variable is used as a default
1616
# hint which can be overridden by setting the corresponding cmake variable.
1717
#
1818
# Once done the following variables will be defined:

src/base/BackedReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int BackedReader::read(Packet* packet) {
4747
socketHandler->read(socketFd, tmpBuf, 4 - partialMessage.length());
4848
if (bytesRead == 0) {
4949
// Connection is closed. Instead of closing the socket, set EPIPE.
50-
// In EternalTCP, the server needs to explictly tell the client that
50+
// In EternalTCP, the server needs to explicitly tell the client that
5151
// the session is over.
5252
SetErrno(EPIPE);
5353
return -1;
@@ -73,7 +73,7 @@ int BackedReader::read(Packet* packet) {
7373
ssize_t bytesRead = socketHandler->read(socketFd, &s[0], s.length());
7474
if (bytesRead == 0) {
7575
// Connection is closed. Instead of closing the socket, set EPIPE.
76-
// In EternalTCP, the server needs to explictly tell the client that
76+
// In EternalTCP, the server needs to explicitly tell the client that
7777
// the session is over.
7878
SetErrno(EPIPE);
7979
return -1;

src/base/SocketHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void SocketHandler::readAll(int fd, void* buf, size_t count, bool timeout) {
2020
ssize_t bytesRead = read(fd, ((char*)buf) + pos, count - pos);
2121
if (bytesRead == 0) {
2222
// Connection is closed. Instead of closing the socket, set EPIPE.
23-
// In EternalTCP, the server needs to explictly tell the client that
23+
// In EternalTCP, the server needs to explicitly tell the client that
2424
// the session is over.
2525
SetErrno(EPIPE);
2626
bytesRead = -1;

src/htm/MultiplexerState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ string MultiplexerState::toJsonString() {
8686

8787
void MultiplexerState::appendData(const string &uid, const string &data) {
8888
if (panes.find(uid) == panes.end()) {
89-
STFATAL << "Tried to write to non-existant terminal";
89+
STFATAL << "Tried to write to non-existent terminal";
9090
}
9191
panes[uid]->terminal->appendData(data);
9292
}

src/terminal/ServerFifoPath.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void TryCreateDirectory(string dir, mode_t mode) {
8282

8383
CHECK_EQ(::umask(oldMode), 0)
8484
<< "Unexpected result when restoring umask, which should return the "
85-
"previous overriden value (0).";
85+
"previous overridden value (0).";
8686
}
8787

8888
} // namespace
@@ -106,7 +106,7 @@ void ServerFifoPath::createDirectoriesIfRequired() {
106106
//
107107
// Create subdirectories for ~/.local/share. These may already be created
108108
// with different permissions on different machines, so also create an
109-
// etserver subdir to enforce 0700 permssions.
109+
// etserver subdir to enforce 0700 permissions.
110110
const string homeDir = GetHome();
111111
TryCreateDirectory(homeDir + "/.local", 0755);
112112
TryCreateDirectory(homeDir + "/.local/share", 0755);

src/terminal/TelemetryService.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ void TelemetryService::logToSentry(el::Level level, const string& message) {
269269
void TelemetryService::logToDatadog(const string& logText, el::Level logLevel,
270270
const string& filename, const int line) {
271271
map<string, string> messageJson = {
272-
{"message", logText}, {"level", logLevelToString(logLevel)},
273-
{"Enviroment", environment}, {"Application", "Eternal Terminal"},
274-
{"Version", ET_VERSION}, {"TelemetryId", telemetryId.str()},
275-
{"File", filename}, {"Line", to_string(line)}};
272+
{"message", logText}, {"level", logLevelToString(logLevel)},
273+
{"Environment", environment}, {"Application", "Eternal Terminal"},
274+
{"Version", ET_VERSION}, {"TelemetryId", telemetryId.str()},
275+
{"File", filename}, {"Line", to_string(line)}};
276276

277277
lock_guard<recursive_mutex> lock(logMutex);
278278
if (logBuffer.size() > 16 * 1024) {

0 commit comments

Comments
 (0)