Skip to content

Commit e738ddf

Browse files
committed
Merge pull request #14489 from milantracy:lint
PiperOrigin-RevId: 978806824
2 parents 073354c + e362ccc commit e738ddf

88 files changed

Lines changed: 638 additions & 204 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.clang-format‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2026 The gVisor Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# gVisor's C and C++ sources follow the Google C++ style guide.
16+
BasedOnStyle: Google
17+
SortIncludes: false

‎.codespellrc‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎.github/workflows/lint.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Runs the source-level lint suite. See tools/lint.sh.
2+
name: Lint
3+
4+
"on":
5+
pull_request:
6+
branches:
7+
- master
8+
push:
9+
branches:
10+
- master
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
24+
with:
25+
persist-credentials: false
26+
27+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
28+
with:
29+
go-version-file: 'go.mod'
30+
31+
- run: make lint

‎Makefile‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,16 @@ tag: ## Stages a release tag; the release pipeline publishes it once the artifac
914914
@tools/tag_release.sh "$(RELEASE_COMMIT)" "$(RELEASE_NAME)" "$(RELEASE_NOTES)"
915915
.PHONY: tag
916916

917-
codespell:
918-
codespell
919-
.PHONY: codespell
917+
##
918+
## Lint targets.
919+
##
920+
## These run the source-level linters that live outside the Bazel build.
921+
## Deep Go analysis is owned by gVisor nogo.
922+
##
923+
lint: ## Runs the source linters.
924+
@tools/lint.sh
925+
.PHONY: lint
926+
927+
lint-fix: ## Reformats sources in place.
928+
@tools/lint.sh --fix
929+
.PHONY: lint-fix

‎g3doc/user_guide/fuse.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The external FUSE server feature allows a host-side process to serve a FUSE
1919
filesystem into a gVisor sandbox. The host process and the sandbox communicate
2020
over a Unix socketpair using the standard FUSE protocol. This approach avoids
2121
the performance penalty incurred by context switching through the I/O proxy
22-
mechansim that's otherwise used to expose host filesystems.
22+
mechanism that's otherwise used to expose host filesystems.
2323

2424
### How It Works
2525

‎g3doc/user_guide/rootfs_snapshot.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Enable the flag `allow-rootfs-tar-annotation` to runtimeArgs, e.g.
8181

8282
Since the tar file path is provided via OCI spec's annotation, it is compatible
8383
with Docker client when the runtime is gVisor. You can pass the annotation via
84-
Docker commad and observe the file change as:
84+
Docker command and observe the file change as:
8585

8686
```
8787
$ docker run --rm --runtime=runsc --annotation "dev.gvisor.tar.rootfs.upper"="/tmp/rootfs.tar" alpine cat /dir/file

‎images/basic/integrationtest/link_test.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int main(int argc, char** argv) {
6565
new_stat.st_nlink);
6666
}
6767

68-
// Check taht contents are the same.
68+
// Check that contents are the same.
6969
fd = open(kNewPath, O_RDONLY);
7070
if (fd < 0) {
7171
errx(1, "open(%s) failed", kNewPath);

‎pkg/aio/aio.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
// Queues are not safe to use concurrently in multiple goroutines.
3232
type Queue interface {
3333
// Destroy cancels all inflight operations and releases resources owned by
34-
// the Queue. Destroy waits for cancelation, so the Queue will not access
34+
// the Queue. Destroy waits for cancellation, so the Queue will not access
3535
// memory corresponding to inflight operations after Destroy returns.
3636
Destroy()
3737

‎pkg/lisafs/client.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (c *Client) StartChannels() error {
140140
}
141141
channelsWg.Wait()
142142

143-
// Check that atleast 1 channel is created. This is not required by lisafs
143+
// Check that at least 1 channel is created. This is not required by lisafs
144144
// protocol. It exists to flag server side issues in channel creation.
145145
c.channelsMu.Lock()
146146
numChannels := len(c.channels)

‎pkg/sentry/devices/nvproxy/frontend.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (fd *frontendFD) Ioctl(ctx context.Context, uio usermem.IO, sysno uintptr,
234234
}
235235

236236
// nr determines the argument type.
237-
// Implementors:
237+
// Implementers:
238238
// - To map nr to a symbol, look in
239239
// src/nvidia/arch/nvalloc/unix/include/nv_escape.h,
240240
// kernel-open/common/inc/nv-ioctl-numbers.h, and
@@ -905,7 +905,7 @@ func rmControl(fi *frontendIoctlState) (uintptr, error) {
905905
// Consequently, its parameters cannot reasonably contain pointers.
906906
return rmControlSimple(fi, &ioctlParams)
907907
}
908-
// Implementors:
908+
// Implementers:
909909
// - Top two bytes of Cmd specifies class; third byte specifies category;
910910
// fourth byte specifies "message ID" (command within class/category).
911911
// e.g. 0x800288:
@@ -1223,7 +1223,7 @@ func rmAlloc(fi *frontendIoctlState) (uintptr, error) {
12231223
if log.IsLogging(log.Debug) {
12241224
fi.ctx.Debugf("nvproxy: allocation class %v", ioctlParams.HClass)
12251225
}
1226-
// Implementors:
1226+
// Implementers:
12271227
// - To map hClass to a symbol, look in
12281228
// src/nvidia/generated/g_allclasses.h.
12291229
// - See src/nvidia/src/kernel/rmapi/resource_list.h for table mapping class

0 commit comments

Comments
 (0)