Skip to content

Commit 0566d1e

Browse files
authored
chore: Adapt lint.sh to Windows Git Bash (google#3950)
1 parent 1c42933 commit 0566d1e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,28 @@ file.
9090
[monitored by codecov.io]: https://codecov.io/gh/google/go-github
9191
[REVIEWERS]: ./REVIEWERS
9292

93+
### Windows users
94+
95+
Use Git Bash as a terminal or WSL instead of PowerShell.
96+
97+
To avoid [issues][] with a few linters and formatters within golangci-lint,
98+
make sure you check out files only with LF endings:
99+
100+
```sh
101+
git config core.autocrlf false
102+
git config core.eol lf
103+
```
104+
105+
To convert an existing cloned repo from CRLF to LF, use the following commands:
106+
107+
```sh
108+
git config core.autocrlf false
109+
git rm --cached -r .
110+
git reset --hard HEAD
111+
```
112+
113+
[issues]: https://github.com/golangci/golangci-lint/discussions/5840
114+
93115
## Tips
94116

95117
Although we have not (yet) banned AI-driven contributions to this repo (as many

github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
//go:generate go run gen-accessors.go
77
//go:generate go run gen-stringify-test.go
8-
//go:generate ../script/metadata.sh update-go
8+
//go:generate sh ../script/metadata.sh update-go
99

1010
package github
1111

0 commit comments

Comments
 (0)