Skip to content

Commit aa17437

Browse files
authored
doc: update usage and limitation
1 parent 97e8762 commit aa17437

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ go install github.com/Abirdcfly/dupword/cmd/dupword@main
6060
### 1. default
6161

6262
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.
6465

6566
```bash
6667
$ dupword ./...
@@ -127,7 +128,9 @@ Flags:
127128
128129
### 5. my advice
129130
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.
131134
132135
```bash
133136
$ dupword --keyword=the,and,a -fix ./...
@@ -141,8 +144,7 @@ $ dupword --keyword=the,and,a -fix ./...
141144
## Limitation
142145
143146
1. Only for `*.go` file.But some miswritten occurs in `*.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.)
146148
147149
## License
148150

0 commit comments

Comments
 (0)