Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Peter Weinberger b0f44d5fb4 copyright: limit copyright checking to .go files
The existing code looked at any file ending 'go' including,
for instance, default.pgo.

Change-Id: I9a8344d2e23da351ca13a888a367457537e5c1b1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/622895
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-10-28 19:27:37 +00:00
Richard Miller febceba19e copyright: don't skip directories "." or ".." in checkCopyright
The checkCopyright function skips directories with names beginning
with "." (for example ".git"). But TestToolsCopyright invokes
the function on directory "..", which means the test is not checking
anything. To avoid this, make an exception to the "." prefix test
so that "." and ".." will still be checked.

Also add a copyright notice to file gopls/doc/assets/assets.go, so
the TestToolsCopyright test will pass when it's no longer skipping
everything.

Fixes golang/go#68306

Change-Id: I773dd29113b34f79ce33a02cb91a53664d26b3df
Reviewed-on: https://go-review.googlesource.com/c/tools/+/596736
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-08 17:34:28 +00:00
Alan Donovan 283fce21c1 x/tools: drop go1.18 support
Updates golang/go#64407

Change-Id: I247a7ff7f07613674f8e31e4cb9c5a68762d2203
Reviewed-on: https://go-review.googlesource.com/c/tools/+/567418
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-02-29 16:54:26 +00:00
Alan Donovan 238800b70a gopls: manual tweaks after the lsp/ -> . rename
Also, update docs on testing.

Change-Id: Ie0381a84452162fe8036ae5e0be0f89071bebfd7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/557742
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2024-01-24 00:49:43 +00:00
Peter Weinbergr 559c4300da tools: replace references to obsolete package ioutils
ioutil defines 7 functions. 6 of these are replaced by
functions in io or os with the same signature.
ReadDir is deprecated, but the suggested replacement has a different
signature.

These changes were generated by a program, with some manual adjutments.
The program replaces ReadDir with a call to a function named ioutilReadDir
that has the same signature. The code for this function
is added to files if necessary. The program replaces all the others
with their new versions. The program removes the 'io/ioutil' import
and adds, as necessary, 'os', 'io', and 'io/fs', the latter being
needed for the signature of ioutilReadDir.

The automatic process fails in a few ways:
1. ReadFile occurs only in a comment but the program adds an unneeded import.
2. ioutilReadDir is added to more than one file in the same package
Both of these could be viewed as bugs and fixed by looking harder.

After manual adjustment, two tests failed:
1. gopls/internal/lsp/regtesg/mis:TestGenerateProgress. The reason
	 was a use of ioutil in a txtar constant. The calls were changed,
	 but the code is not smart enough to change the import inside the
	 string constant. (Or it's not smart enough not to change the
	 contents of a string.)
2. gopls/internal/lsp/analysis/deprecated, which wants to see a use
	 of ioutil

These tests were adjused by hand, and all tests (-short) pass.

Change-Id: If9efe40bbb0edda36173d9a88afaf71245db8e79
Reviewed-on: https://go-review.googlesource.com/c/tools/+/527675
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Peter Weinberger <pjw@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2023-09-12 20:13:37 +00:00
Heschi Kreinick 9e0a7b1054 copyright: don't require checkout to be named tools
The directory isn't named 'tools' on LUCI.

Change-Id: Ia91a77b924704496491bdf4e8306c9ac139f9f57
Reviewed-on: https://go-review.googlesource.com/c/tools/+/489755
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
2023-04-27 16:02:34 +00:00
Robert Findley b15dac2b88 gopls: migrate internal/lsp to gopls/internal/lsp
This CL was created using the following commands:

    ./gopls/internal/migrate.sh
    git add .
    git codereview gofmt

For golang/go#54509

Change-Id: Iceeec602748a5e6f609c3ceda8d19157e5c94009
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426796
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-07 16:44:44 +00:00
Russ Cox d5f48fca53 all: gofmt
Gofmt to update doc comments to the new formatting.

(There are so many files in x/tools I am breaking up the
gofmt'ing into multiple CLs. This is the leftovers.)

For golang/go#51082.

Change-Id: Id9d440cde9de7093d2ffe06cbaa7098993823d6b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/399363
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-12 17:53:17 +00:00
Rebecca Stambler 2758b0478a gopls/api-diff: create api-diff command for gopls api
This change adds a command that can be used to see the difference in
API between two gopls versions. It prints out the changes in a way that
can be copy-pasted into the release notes.

Also, only run the copyright test with 1.18. I wanted to do this before
to use filepath.WalkDir, but now it also doesn't work with generic
syntax (it doesn't use packages.Load, so doesn't respect build tags).

Fixes golang/go#46652

Change-Id: I3670e0289a8eeaca02f4dcd8f88f206796ed2462
Reviewed-on: https://go-review.googlesource.com/c/tools/+/327276
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-09-17 17:58:44 +00:00
Rebecca Stambler d33bae4414 copyright: test that all files in the repo have copyright notices
Adapted the script that I used to automatically add copyright notices
into a test that all files in the repository currently have appropriate
copyrights. Caught a few typos and extra spaces, which I decided to fix
rather than adjust regular expression.

Change-Id: Ifdbad969eca482e25c89afc5a2ddd5968c6661a6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/282592
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-01-11 22:19:46 +00:00