Skip to content

Commit 19fcf60

Browse files
authored
ci: add typo detection (#3327)
And fix them.
1 parent eb51435 commit 19fcf60

File tree

25 files changed

+63
-30
lines changed

25 files changed

+63
-30
lines changed

.github/workflows/coder.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ concurrency:
3030
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3131

3232
jobs:
33+
typos:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
- name: typos-action
39+
uses: crate-ci/typos@v1.0.4
40+
with:
41+
config: .github/workflows/typos.toml
42+
- name: Fix Helper
43+
if: ${{ failure() }}
44+
run: |
45+
echo "::notice:: you can automatically fix typos from your CLI:
46+
cargo install typos-cli
47+
typos -c .github/workflows/typos.toml -w"
48+
3349
changes:
3450
runs-on: ubuntu-latest
3551
outputs:

.github/workflows/typos.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[default.extend-identifiers]
2+
alog = "alog"
3+
Jetbrains = "JetBrains"
4+
IST = "IST"
5+
6+
[default.extend-words]
7+
8+
[files]
9+
extend-exclude = [
10+
"**.svg",
11+
"**.lock",
12+
"go.sum",
13+
"go.mod",
14+
# These files contain base64 strings that confuse the detector
15+
"**XService**.ts",
16+
"**identity.go",
17+
]

agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ func (a *agent) createCommand(ctx context.Context, rawCommand string, env []stri
402402
// These should override all variables we manually specify.
403403
for envKey, value := range metadata.EnvironmentVariables {
404404
// Expanding environment variables allows for customization
405-
// of the $PATH, among other variables. Customers can prepand
405+
// of the $PATH, among other variables. Customers can prepend
406406
// or append to the $PATH, so allowing expand is required!
407407
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", envKey, os.ExpandEnv(value)))
408408
}

cli/cliui/cliui.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var Styles = struct {
3434
Placeholder,
3535
Prompt,
3636
FocusedPrompt,
37-
Fuschia,
37+
Fuchsia,
3838
Logo,
3939
Warn,
4040
Wrap lipgloss.Style
@@ -51,7 +51,7 @@ var Styles = struct {
5151
Placeholder: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#585858", Dark: "#005fff"}),
5252
Prompt: defaultStyles.Prompt.Foreground(lipgloss.AdaptiveColor{Light: "#9B9B9B", Dark: "#5C5C5C"}),
5353
FocusedPrompt: defaultStyles.FocusedPrompt.Foreground(lipgloss.Color("#651fff")),
54-
Fuschia: defaultStyles.SelectedMenuItem.Copy(),
54+
Fuchsia: defaultStyles.SelectedMenuItem.Copy(),
5555
Logo: defaultStyles.Logo.SetString("Coder"),
5656
Warn: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#04B575", Dark: "#ECFD65"}),
5757
Wrap: lipgloss.NewStyle().Width(80),

cli/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ type example struct {
407407
Command string
408408
}
409409

410-
// formatExamples formats the exampels as width wrapped bulletpoint
410+
// formatExamples formats the examples as width wrapped bulletpoint
411411
// descriptions with the command underneath.
412412
func formatExamples(examples ...example) string {
413413
wrap := cliui.Styles.Wrap.Copy()

cli/templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func displayTemplates(filterColumns []string, templates ...codersdk.Template) st
7171
template.OrganizationID.String(),
7272
template.Provisioner,
7373
template.ActiveVersionID.String(),
74-
cliui.Styles.Fuschia.Render(fmt.Sprintf("%d developer%s", template.WorkspaceOwnerCount, suffix)),
74+
cliui.Styles.Fuchsia.Render(fmt.Sprintf("%d developer%s", template.WorkspaceOwnerCount, suffix)),
7575
(time.Duration(template.MaxTTLMillis) * time.Millisecond).String(),
7676
(time.Duration(template.MinAutostartIntervalMillis) * time.Millisecond).String(),
7777
})

coderd/audit/generate.sh

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

33
# This script facilitates code generation for auditing types. It outputs code
44
# that can be copied and pasted into the audit.AuditableResources table. By
5-
# default, every field is ignored. It is your responsiblity to go through each
5+
# default, every field is ignored. It is your responsibility to go through each
66
# field and document why each field should or should not be audited.
77
#
88
# Usage:

coderd/rbac/policy.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ org = set {
105105

106106
# The allow block is quite simple. Any set with `false` cascades down in levels.
107107
# Authorization looks for any `allow` statement that is true. Multiple can be true!
108-
# Note that the absense of `allow` means "unauthorized".
108+
# Note that the absence of `allow` means "unauthorized".
109109
# An explicit `"allow": true` is required.
110110

111111
# site allow

codersdk/provisionerdaemons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ProvisionerDaemon struct {
4141
Provisioners []ProvisionerType `json:"provisioners"`
4242
}
4343

44-
// ProvisionerJobStaus represents the at-time state of a job.
44+
// ProvisionerJobStatus represents the at-time state of a job.
4545
type ProvisionerJobStatus string
4646

4747
// Active returns whether the job is still active or not.

docs/ides.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ support should work:
1212
- Rider
1313
- RubyMine
1414
- WebStorm
15-
- Web IDEs (code-server, JupyterLab, Jetbrains Projector)
15+
- Web IDEs (code-server, JupyterLab, JetBrains Projector)
1616
- Note: These are [configured in the template](./ides/configuring-web-ides.md)
1717

1818
## SSH configuration
@@ -74,6 +74,6 @@ Connection and connect to your Coder workspace.](./ides/configuring-gateway.md)
7474
| 2022.1.4 | Working | Windows clients are unable to connect to Linux workspace |
7575
| 2022.2 RC | Working | Version >= 222.3345.108 |
7676

77-
## Web IDEs (Jupyter, code-server, Jetbrains Projector)
77+
## Web IDEs (Jupyter, code-server, JetBrains Projector)
7878

7979
Web IDEs (code-server, JetBrains Projector, VNC, etc.) are defined in the template. See [configuring IDEs](./ides/configuring-web-ides.md).

docs/ides/configuring-web-ides.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.3.0
6262
RUN code-server --install-extension eamodio.gitlens
6363

6464
# directly start code-server with the agent's startup_script (see above),
65-
# or use a proccess manager like supervisord
65+
# or use a process manager like supervisord
6666
```
6767

6868
You'll also need to specify a `coder_app` resource related to the agent. This is how code-server is displayed on the workspace page.

examples/templates/aws-linux/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ instances provisioned by Coder:
4242
"Resource": "*"
4343
},
4444
{
45-
"Sid": "CoderResouces",
45+
"Sid": "CoderResources",
4646
"Effect": "Allow",
4747
"Action": [
4848
"ec2:DescribeInstances",

examples/templates/aws-windows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ instances provisioned by Coder:
4444
"Resource": "*"
4545
},
4646
{
47-
"Sid": "CoderResouces",
47+
"Sid": "CoderResources",
4848
"Effect": "Allow",
4949
"Action": [
5050
"ec2:DescribeInstances",

examples/templates/docker-code-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See `params.sample.yaml` for more information.
1919
This template has the following predefined parameters:
2020

2121
- `docker_host`: Path to (or address of) the Docker socket.
22-
> You can determine the correct value for this by runnning
22+
> You can determine the correct value for this by running
2323
> `docker context ls`.
2424
- `docker_arch`: Architecture of the host running Docker.
2525
This can be `amd64`, `arm64`, or `armv7`.

examples/templates/docker-image-builds/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variable "step1_docker_host_warning" {
2121
the Coder host, which is not necessarily your local machine.
2222
2323
You can specify a different host in the template file and
24-
surpress this warning.
24+
suppress this warning.
2525
EOF
2626
validation {
2727
condition = contains(["Continue using /var/run/docker.sock on the Coder host"], var.step1_docker_host_warning)

examples/templates/docker/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variable "step1_docker_host_warning" {
2121
the Coder host, which is not necessarily your local machine.
2222
2323
You can specify a different host in the template file and
24-
surpress this warning.
24+
suppress this warning.
2525
EOF
2626
validation {
2727
condition = contains(["Continue using /var/run/docker.sock on the Coder host"], var.step1_docker_host_warning)

peer/channel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (c *Channel) init() {
136136
c.closeMutex.Unlock()
137137

138138
// pion/webrtc will return an io.ErrShortBuffer when a read
139-
// is triggerred with a buffer size less than the chunks written.
139+
// is triggered with a buffer size less than the chunks written.
140140
//
141141
// This makes sense when considering UDP connections, because
142142
// buffering of data that has no transmit guarantees is likely

site/site.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,13 @@ func sha1HashFile(name string) ([]byte, error) {
580580
return []byte(hex.EncodeToString(b)), nil
581581
}
582582

583-
func extractBin(dest string, r io.Reader) (numExtraced int, err error) {
583+
func extractBin(dest string, r io.Reader) (numExtracted int, err error) {
584584
opts := []zstd.DOption{
585585
// Concurrency doesn't help us when decoding the tar and
586586
// can actually slow us down.
587587
zstd.WithDecoderConcurrency(1),
588588
// Ignoring checksums can give a slight performance
589-
// boost but it's probalby not worth the reduced safety.
589+
// boost but it's probably not worth the reduced safety.
590590
zstd.IgnoreChecksum(false),
591591
// Allow the decoder to use more memory giving us a 2-3x
592592
// performance boost.

site/site_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,25 @@ func TestServingBin(t *testing.T) {
297297
},
298298
},
299299
{
300-
name: "Serve local fs when embedd fs empty",
300+
name: "Serve local fs when embed fs empty",
301301
fs: fstest.MapFS{},
302302
reqs: []req{
303303
{url: "/bin/coder-linux-amd64", wantStatus: http.StatusNotFound},
304304
{url: "/bin/GITKEEP", wantStatus: http.StatusNotFound},
305305
},
306306
},
307307
{
308-
name: "Serve embedd fs",
308+
name: "Serve embed fs",
309309
fs: fstest.MapFS{
310310
"bin/GITKEEP": &fstest.MapFile{
311311
Data: []byte(""),
312312
},
313313
"bin/coder-linux-amd64": &fstest.MapFile{
314-
Data: []byte("embedd"),
314+
Data: []byte("embed"),
315315
},
316316
},
317317
reqs: []req{
318-
{url: "/bin/coder-linux-amd64", wantStatus: http.StatusOK, wantBody: []byte("embedd")},
318+
{url: "/bin/coder-linux-amd64", wantStatus: http.StatusOK, wantBody: []byte("embed")},
319319
{url: "/bin/GITKEEP", wantStatus: http.StatusOK, wantBody: []byte("")},
320320
},
321321
},

site/src/components/Dialog/Dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const typeToColor = (type: ConfirmDialogType): LoadingButtonProps["color"] => {
9090
}
9191

9292
/**
93-
* Quickly handels most modals actions, some combination of a cancel and confirm button
93+
* Quickly handles most modals actions, some combination of a cancel and confirm button
9494
*/
9595
export const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({
9696
cancelText = "Cancel",

site/src/components/Resources/ResourceAvatar.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NullResource.args = {
2828
type: "null_resource",
2929
}
3030

31-
export const UnkownResource = Template.bind({})
32-
UnkownResource.args = {
31+
export const UnknownResource = Template.bind({})
32+
UnknownResource.args = {
3333
type: "noexistentvalue",
3434
}

site/src/components/TableCellLink/TableCellLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const useStyles = makeStyles((theme) => ({
3030
cell: {
3131
// This must override all padding for all rules on a TableCell.
3232
// Otherwise, the link will not cover the entire region.
33-
// It's unfortuante to use `!important`, but this seems to be
33+
// It's unfortunate to use `!important`, but this seems to be
3434
// a reasonable use-case.
3535
padding: "0 !important",
3636
},

site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ NoTTL.args = {
4040
...Mocks.MockWorkspace,
4141
latest_build: {
4242
...Mocks.MockWorkspaceBuild,
43-
// a mannual shutdown has a deadline of '"0001-01-01T00:00:00Z"'
43+
// a manual shutdown has a deadline of '"0001-01-01T00:00:00Z"'
4444
// SEE: #1834
4545
deadline: "0001-01-01T00:00:00Z",
4646
},

site/webpack.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const dashboardHTMLPluginConfig = new HtmlWebpackPlugin({
4141
export const createCommonWebpackConfig = (options?: { skipTypecheck: boolean }): Configuration => ({
4242
// entry defines each "page" or "chunk". In v1, we have two "pages":
4343
// dashboard and terminal. This is desired because the terminal has the xterm
44-
// vendor, and it is undesireable to load all of xterm on a dashboard
44+
// vendor, and it is undesirable to load all of xterm on a dashboard
4545
// page load.
4646
//
4747
// The object key determines the chunk 'name'. This can be used in `output`

site/webpack.dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const config: Configuration = {
4646

4747
// webpack-dev-server uses a webSocket to communicate with the browser
4848
// for HMR. By setting this to auto://0.0.0.0/ws, we allow the browser
49-
// to set the protocal, hostname and port automatically for us.
49+
// to set the protocol, hostname and port automatically for us.
5050
webSocketURL: "auto://0.0.0.0:0/ws",
5151
},
5252
devMiddleware: {

0 commit comments

Comments
 (0)