Add codespell support and fix a good number of typos with its help (#3270)
More about codespell: https://github.com/codespell-project/codespell . I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback. ``` ❯ grep lint-spell Makefile @echo " - lint-spell lint spelling" @echo " - lint-spell-fix lint spelling and fix issues" lint: lint-frontend lint-backend lint-spell lint-fix: lint-frontend-fix lint-backend-fix lint-spell-fix .PHONY: lint-spell lint-spell: lint-codespell .PHONY: lint-spell-fix lint-spell-fix: lint-codespell-fix ❯ git grep lint- -- .forgejo/ .forgejo/workflows/testing.yml: - run: make --always-make -j$(nproc) lint-backend checks-backend # ensure the "go-licenses" make target runs .forgejo/workflows/testing.yml: - run: make lint-frontend ``` so how would you like me to invoke `lint-codespell` on CI? (without that would be IMHO very suboptimal and let typos sneak in) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3270 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> Co-committed-by: Yaroslav Halchenko <debian@onerussian.com>
This commit is contained in:
parent
06843c1cdc
commit
2b2fd2728c
80 changed files with 183 additions and 136 deletions
|
@ -21,7 +21,7 @@ make clean build
|
|||
act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
|
||||
```
|
||||
|
||||
Warning: This file defines many jobs, so it will be resource-intensive and therefor not recommended.
|
||||
Warning: This file defines many jobs, so it will be resource-intensive and therefore not recommended.
|
||||
|
||||
### Run single job
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ func TestActionsAutomerge(t *testing.T) {
|
|||
job := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRunJob{ID: 292})
|
||||
|
||||
assert.False(t, pr.HasMerged, "PR should not be merged")
|
||||
assert.Equal(t, issues_model.PullRequestStatusMergeable, pr.Status, "PR should be mergable")
|
||||
assert.Equal(t, issues_model.PullRequestStatusMergeable, pr.Status, "PR should be mergeable")
|
||||
|
||||
scheduled, err := automerge.ScheduleAutoMerge(ctx, user, pr, repo_model.MergeStyleMerge, "Dummy")
|
||||
|
||||
|
|
|
@ -134,9 +134,9 @@ func TestAPIRepoIssueConfigPaths(t *testing.T) {
|
|||
".github/issue_template/config",
|
||||
}
|
||||
|
||||
for _, canidate := range templateConfigCandidates {
|
||||
for _, candidate := range templateConfigCandidates {
|
||||
for _, extension := range []string{".yaml", ".yml"} {
|
||||
fullPath := canidate + extension
|
||||
fullPath := candidate + extension
|
||||
t.Run(fullPath, func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ func TestPackageMaven(t *testing.T) {
|
|||
t.Run("UploadVerifySHA1", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
t.Run("Missmatch", func(t *testing.T) {
|
||||
t.Run("Mismatch", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
putFile(t, fmt.Sprintf("/%s/%s.sha1", packageVersion, filename), "test", http.StatusBadRequest)
|
||||
|
|
|
@ -75,7 +75,7 @@ func TestCompareBranches(t *testing.T) {
|
|||
|
||||
session := loginUser(t, "user2")
|
||||
|
||||
// Inderect compare remove-files-b (head) with add-csv (base) branch
|
||||
// Indirect compare remove-files-b (head) with add-csv (base) branch
|
||||
//
|
||||
// 'link_hi' and 'test.csv' are deleted, 'test.txt' is added
|
||||
req := NewRequest(t, "GET", "/user2/repo20/compare/add-csv...remove-files-b")
|
||||
|
@ -87,7 +87,7 @@ func TestCompareBranches(t *testing.T) {
|
|||
|
||||
inspectCompare(t, htmlDoc, diffCount, diffChanges)
|
||||
|
||||
// Inderect compare remove-files-b (head) with remove-files-a (base) branch
|
||||
// Indirect compare remove-files-b (head) with remove-files-a (base) branch
|
||||
//
|
||||
// 'link_hi' and 'test.csv' are deleted, 'test.txt' is added
|
||||
|
||||
|
@ -100,7 +100,7 @@ func TestCompareBranches(t *testing.T) {
|
|||
|
||||
inspectCompare(t, htmlDoc, diffCount, diffChanges)
|
||||
|
||||
// Inderect compare remove-files-a (head) with remove-files-b (base) branch
|
||||
// Indirect compare remove-files-a (head) with remove-files-b (base) branch
|
||||
//
|
||||
// 'link_hi' and 'test.csv' are deleted
|
||||
|
||||
|
@ -138,7 +138,7 @@ func TestCompareWithPRsDisabled(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
defer func() {
|
||||
// Reenable PRs on the repo
|
||||
// Re-enable PRs on the repo
|
||||
err := repo_service.UpdateRepositoryUnits(db.DefaultContext, repo,
|
||||
[]repo_model.RepoUnit{{
|
||||
RepoID: repo.ID,
|
||||
|
|
|
@ -405,7 +405,7 @@ func TestCommitMail(t *testing.T) {
|
|||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
// Upload two separate times, so we have two different 'uploads' that can
|
||||
// be used indepently of each other.
|
||||
// be used independently of each other.
|
||||
uploadFile := func(t *testing.T, name, content string) string {
|
||||
t.Helper()
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ func TestPullrequestReopen(t *testing.T) {
|
|||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
// Create the pull reuqest.
|
||||
// Create the pull request.
|
||||
pullIssue := &issues_model.Issue{
|
||||
RepoID: baseRepo.ID,
|
||||
Title: "Testing reopen functionality",
|
||||
|
|
|
@ -433,7 +433,7 @@ func TestPullView_GivenApproveOrRejectReviewOnClosedPR(t *testing.T) {
|
|||
|
||||
t.Run("Submit approve/reject review on closed PR", func(t *testing.T) {
|
||||
// Created a closed PR (made by user1) in the upstream repo1.
|
||||
testEditFileToNewBranch(t, user1Session, "user1", "repo1", "master", "a-test-branch", "README.md", "Hello, World (Editied...again)\n")
|
||||
testEditFileToNewBranch(t, user1Session, "user1", "repo1", "master", "a-test-branch", "README.md", "Hello, World (Edited...again)\n")
|
||||
resp := testPullCreate(t, user1Session, "user1", "repo1", false, "master", "a-test-branch", "This is a pull title")
|
||||
elem := strings.Split(test.RedirectURL(resp), "/")
|
||||
assert.EqualValues(t, "pulls", elem[3])
|
||||
|
|
|
@ -54,7 +54,7 @@ func testRenameBranch(t *testing.T, u *url.URL) {
|
|||
assert.Equal(t, "main", repo1.DefaultBranch)
|
||||
})
|
||||
|
||||
t.Run("Database syncronization", func(t *testing.T) {
|
||||
t.Run("Database synchronization", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
req := NewRequestWithValues(t, "POST", "/user2/repo1/settings/rename_branch", map[string]string{
|
||||
|
|
|
@ -115,7 +115,7 @@ func TestRepoFork(t *testing.T) {
|
|||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
// Make sure the repo we try to fork is private.
|
||||
// We're also choosing user15/big_test_private_2, becase it has the Code unit disabled.
|
||||
// We're also choosing user15/big_test_private_2, because it has the Code unit disabled.
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 20, IsPrivate: true})
|
||||
|
||||
// user1, even though an admin, can't fork a repo without a code unit.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue