You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,8 @@ go install github.com/Abirdcfly/dupword/cmd/dupword@main
60
60
### 1. default
61
61
62
62
Run with default settings(include test file):
63
-
**But note that not all repeated words are wrong**
63
+
64
+
**But note that not all repeated words are wrong** see [dupword#4](https://github.com/Abirdcfly/dupword/issues/4) for real code example.
64
65
65
66
```bash
66
67
$ dupword ./...
@@ -127,7 +128,9 @@ Flags:
127
128
128
129
### 5. my advice
129
130
130
-
use `--keyword=the,and,a` and `-fix` together.
131
+
use `--keyword=the,and,a` and `-fix` together. I personally think that specifying only common repeated prepositions can effectively avoid false positives.
132
+
133
+
see [dupword#4](https://github.com/Abirdcfly/dupword/issues/4) for real code example.
1. Only for`*.go` file.But some miswritten occursin`*.md` or `*.json` file.(example: kubernetes), In this case, my advice is to use [rg](https://github.com/BurntSushi/ripgrep) to do the lookup and replace manually.
144
-
2. The first time, `-fix` args can't auto-fix `*_test.go` file, you need to run the command once again, this is a bug of golang/x/tools, see [https://github.com/golang/go/issues/54740](https://github.com/golang/go/issues/54740) for more information and it will be fixed by ~~[CL 426594](https://go-review.googlesource.com/c/tools/+/426594)~~ [CL 426734](https://go-review.googlesource.com/c/tools/+/426734/) . (ps: This problem occurs with basically all linters that use the `go/analysis` package), In this case, my advice is to run the linter command multiple times.:sweat_smile:
145
-
3. When use `-fix`, also running `go fmt` in the dark.([This logic is determined upstream](https://github.com/golang/tools/blob/248c34b88a4148128f89e41923498bd86f805b7d/go/analysis/internal/checker/checker.go#L424-L433), the project does not have this part of the code.)
147
+
2. When use `-fix`, also running `go fmt`in the dark.([This logic is determined upstream](https://github.com/golang/tools/blob/248c34b88a4148128f89e41923498bd86f805b7d/go/analysis/internal/checker/checker.go#L424-L433), the project does not have this part of the code.)
0 commit comments