Skip to content

Commit b68c102

Browse files
yarikopticclaude
andauthored
Add codespell support with configuration and fixes (#8761)
* ci(codespell): add codespell config and GitHub Actions workflow Add .codespellrc with skip patterns for generated files, camelCase/PascalCase ignore-regex, and project-specific word list (convertor, crypted, te, thur). Add GitHub Actions workflow to run codespell on push to main and PRs. Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yaroslav Halchenko <debian@onerussian.com> * fix(codespell): fix ambiguous typos requiring context review Manual fixes for typos that needed human review to avoid breaking code: - Comment/string typos: occured->occurred, destory->destroy, writting->writing, retreive->retrieve, identifer->identifier, etc. - Struct field comments and documentation corrections - Migration script comment fixes (preserving Go identifiers like DataConvertor) Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yaroslav Halchenko <debian@onerussian.com> * fix(codespell): fix non-ambiguous typos with codespell -w Automated fix via `codespell -w` for clear-cut typos across backend, config-ui, and grafana dashboards. Examples: sucess->success, occurence->occurrence, exeucte->execute, asynchornous->asynchronous, Grafana panel typos, etc. Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yaroslav Halchenko <debian@onerussian.com> --------- Signed-off-by: Yaroslav Halchenko <debian@onerussian.com> Co-authored-by: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
1 parent 840c728 commit b68c102

File tree

67 files changed

+174
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+174
-107
lines changed

.codespellrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
[codespell]
19+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
20+
skip = .git,.gitignore,.gitattributes,*.svg,go.sum,*.lock,*.css,.codespellrc,.cache,.npm,.yarn,*/e2e/raw_tables/*,*/e2e/snapshot_tables/*
21+
check-hidden = true
22+
# Ignore camelCase and PascalCase identifiers (common in Go and TypeScript code)
23+
ignore-regex = \b[a-z]+[A-Z]\w*\b|\b[A-Z][a-z]+[A-Z]\w*\b
24+
# convertor,convertors - project's deliberate spelling for Go types and filenames (DataConvertor, etc.)
25+
# crypted - variable name in AES encrypt/decrypt functions
26+
# te - Tapd API field name (Te/te struct fields)
27+
# thur - Thursday abbreviation in Grafana dashboard SQL column alias
28+
ignore-words-list = convertor,convertors,crypted,te,thur

.github/actions/auto-cherry-pick/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ name: "Auto Cherry Pick"
1919
description: "cherry pick commits from Pull Requests into Release branch"
2020
inputs:
2121
trigger_label_prefix:
22-
description: "The trigger label prefic"
22+
description: "The trigger label prefix"
2323
default: "needs-cherrypick-"
2424
required: false
2525
author_email:

.github/workflows/codespell.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Codespell configuration is within .codespellrc
18+
---
19+
name: Codespell
20+
21+
on:
22+
push:
23+
branches: [main]
24+
pull_request:
25+
branches: [main]
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
codespell:
32+
name: Check for spelling errors
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Codespell
39+
uses: codespell-project/actions-codespell@v2

backend/core/models/domainlayer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The following rules make sure Domain Layer Entities serve its purpose
5757

5858
- Read data from platform specific table, convert and store record into one(or multiple) domain table(s)
5959
- Generate its own `Id` accordingly
60-
- Generate foreign key accordlingly
60+
- Generate foreign key accordingly
6161
- Fields conversion
6262

6363
Sample code:

backend/core/models/locking.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package models
1919

2020
import "time"
2121

22-
// LockingHistory is desgned for preventing mutiple delake instances from sharing the same database which may cause
22+
// LockingHistory is desgned for preventing multiple delake instances from sharing the same database which may cause
2323
// problems like #3537, #3466. It works by the following step:
2424
//
2525
// 1. Each devlake insert a record to this table whie `Succeeded=false`

backend/core/plugin/plugin_blueprint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ type DataSourcePluginBlueprintV200 interface {
7878
// BlueprintConnectionV200 contains the pluginName/connectionId and related Scopes,
7979

8080
// MetricPluginBlueprintV200 is similar to the DataSourcePluginBlueprintV200
81-
// but for Metric Plugin, take dora as an example, it doens't have any scope,
81+
// but for Metric Plugin, take dora as an example, it doesn't have any scope,
8282
// nor does it produce any, however, it does require other plugin to be
83-
// executed beforehand, like calcuating refdiff before it can connect PR to the
83+
// executed beforehand, like calculating refdiff before it can connect PR to the
8484
// right Deployment keep in mind it would be called IFF the plugin was enabled
8585
// for the project.
8686
type MetricPluginBlueprintV200 interface {

backend/core/plugin/plugin_task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type SubTaskMeta struct {
106106
Dependencies []*SubTaskMeta
107107
DependencyTables []string
108108
ProductTables []string
109-
ForceRunOnResume bool // Should a subtask be ran dispite it was finished before
109+
ForceRunOnResume bool // Should a subtask be ran despite it was finished before
110110
}
111111

112112
// PluginTask Implement this interface to let framework run tasks for you

backend/core/utils/network_helper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestResolvePort(t *testing.T) {
5353
}
5454
_, err = ResolvePort("", "rabbitmq")
5555
if err == nil {
56-
t.Errorf("Expected error %s, Got nil", "schema not fount")
56+
t.Errorf("Expected error %s, Got nil", "schema not found")
5757
}
5858
_, err = ResolvePort("", "")
5959
if err == nil {

backend/helpers/e2ehelper/data_flow_tester.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func NewDataFlowTester(t *testing.T, pluginName string, pluginMeta plugin.Plugin
112112
cfg.Set(`DB_URL`, cfg.GetString(`E2E_DB_URL`))
113113
db, err := runner.NewGormDb(cfg, logruslog.Global)
114114
if err != nil {
115-
// if here fail with error `acces denied for user` you need to create database by your self as follow command
115+
// if here fail with error `access denied for user` you need to create database by your self as follow command
116116
// create databases lake_test;
117117
// grant all on lake_test.* to 'merico'@'%';
118118
panic(err)

backend/helpers/migrationhelper/migrationhelper.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
3333
)
3434

35-
// AutoMigrateTables runs AutoMigrate for muliple tables
35+
// AutoMigrateTables runs AutoMigrate for multiple tables
3636
func AutoMigrateTables(basicRes context.BasicRes, dst ...interface{}) errors.Error {
3737
db := basicRes.GetDal()
3838
for _, entity := range dst {
@@ -74,14 +74,14 @@ func ChangeColumnsType[D any](
7474

7575
err = db.AutoMigrate(new(D), dal.From(tableName))
7676
if err != nil {
77-
return errors.Default.Wrap(err, "AutoMigrate for Add Colume Error")
77+
return errors.Default.Wrap(err, "AutoMigrate for Add Column Error")
7878
}
7979

8080
defer func() {
8181
if err != nil {
8282
err1 := db.DropColumns(tableName, columns...)
8383
if err1 != nil {
84-
err = errors.Default.Wrap(err, fmt.Sprintf("RollBack by DropColume failed.Relevant data needs to be repaired manually.%s", err1.Error()))
84+
err = errors.Default.Wrap(err, fmt.Sprintf("RollBack by DropColumn failed.Relevant data needs to be repaired manually.%s", err1.Error()))
8585
}
8686
}
8787
}()

0 commit comments

Comments
 (0)