Skip to content

ci: add typo detection #3327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
typos:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: typos-action
uses: crate-ci/typos@v1.0.4
with:
config: .github/workflows/typos.toml
- name: Fix Helper
if: ${{ failure() }}
run: |
echo "::notice:: you can automatically fix typos from your CLI:
cargo install typos-cli
typos -c .github/workflows/typos.toml -w"

changes:
runs-on: ubuntu-latest
outputs:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[default.extend-identifiers]
alog = "alog"
Jetbrains = "JetBrains"
IST = "IST"

[default.extend-words]

[files]
extend-exclude = [
"**.svg",
"**.lock",
"go.sum",
"go.mod",
# These files contain base64 strings that confuse the detector
"**XService**.ts",
"**identity.go",
]
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (a *agent) createCommand(ctx context.Context, rawCommand string, env []stri
// These should override all variables we manually specify.
for envKey, value := range metadata.EnvironmentVariables {
// Expanding environment variables allows for customization
// of the $PATH, among other variables. Customers can prepand
// of the $PATH, among other variables. Customers can prepend
// or append to the $PATH, so allowing expand is required!
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", envKey, os.ExpandEnv(value)))
}
Expand Down
4 changes: 2 additions & 2 deletions cli/cliui/cliui.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var Styles = struct {
Placeholder,
Prompt,
FocusedPrompt,
Fuschia,
Fuchsia,
Logo,
Warn,
Wrap lipgloss.Style
Expand All @@ -51,7 +51,7 @@ var Styles = struct {
Placeholder: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#585858", Dark: "#005fff"}),
Prompt: defaultStyles.Prompt.Foreground(lipgloss.AdaptiveColor{Light: "#9B9B9B", Dark: "#5C5C5C"}),
FocusedPrompt: defaultStyles.FocusedPrompt.Foreground(lipgloss.Color("#651fff")),
Fuschia: defaultStyles.SelectedMenuItem.Copy(),
Fuchsia: defaultStyles.SelectedMenuItem.Copy(),
Logo: defaultStyles.Logo.SetString("Coder"),
Warn: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#04B575", Dark: "#ECFD65"}),
Wrap: lipgloss.NewStyle().Width(80),
Expand Down
2 changes: 1 addition & 1 deletion cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ type example struct {
Command string
}

// formatExamples formats the exampels as width wrapped bulletpoint
// formatExamples formats the examples as width wrapped bulletpoint
// descriptions with the command underneath.
func formatExamples(examples ...example) string {
wrap := cliui.Styles.Wrap.Copy()
Expand Down
2 changes: 1 addition & 1 deletion cli/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func displayTemplates(filterColumns []string, templates ...codersdk.Template) st
template.OrganizationID.String(),
template.Provisioner,
template.ActiveVersionID.String(),
cliui.Styles.Fuschia.Render(fmt.Sprintf("%d developer%s", template.WorkspaceOwnerCount, suffix)),
cliui.Styles.Fuchsia.Render(fmt.Sprintf("%d developer%s", template.WorkspaceOwnerCount, suffix)),
(time.Duration(template.MaxTTLMillis) * time.Millisecond).String(),
(time.Duration(template.MinAutostartIntervalMillis) * time.Millisecond).String(),
})
Expand Down
2 changes: 1 addition & 1 deletion coderd/audit/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This script facilitates code generation for auditing types. It outputs code
# that can be copied and pasted into the audit.AuditableResources table. By
# default, every field is ignored. It is your responsiblity to go through each
# default, every field is ignored. It is your responsibility to go through each
# field and document why each field should or should not be audited.
#
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion coderd/rbac/policy.rego
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ org = set {

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

# site allow
Expand Down
2 changes: 1 addition & 1 deletion codersdk/provisionerdaemons.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type ProvisionerDaemon struct {
Provisioners []ProvisionerType `json:"provisioners"`
}

// ProvisionerJobStaus represents the at-time state of a job.
// ProvisionerJobStatus represents the at-time state of a job.
type ProvisionerJobStatus string

// Active returns whether the job is still active or not.
Expand Down
4 changes: 2 additions & 2 deletions docs/ides.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ support should work:
- Rider
- RubyMine
- WebStorm
- Web IDEs (code-server, JupyterLab, Jetbrains Projector)
- Web IDEs (code-server, JupyterLab, JetBrains Projector)
- Note: These are [configured in the template](./ides/configuring-web-ides.md)

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

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

Web IDEs (code-server, JetBrains Projector, VNC, etc.) are defined in the template. See [configuring IDEs](./ides/configuring-web-ides.md).
2 changes: 1 addition & 1 deletion docs/ides/configuring-web-ides.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.3.0
RUN code-server --install-extension eamodio.gitlens

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

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.
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/aws-linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ instances provisioned by Coder:
"Resource": "*"
},
{
"Sid": "CoderResouces",
"Sid": "CoderResources",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/aws-windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ instances provisioned by Coder:
"Resource": "*"
},
{
"Sid": "CoderResouces",
"Sid": "CoderResources",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-code-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See `params.sample.yaml` for more information.
This template has the following predefined parameters:

- `docker_host`: Path to (or address of) the Docker socket.
> You can determine the correct value for this by runnning
> You can determine the correct value for this by running
> `docker context ls`.
- `docker_arch`: Architecture of the host running Docker.
This can be `amd64`, `arm64`, or `armv7`.
2 changes: 1 addition & 1 deletion examples/templates/docker-image-builds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable "step1_docker_host_warning" {
the Coder host, which is not necessarily your local machine.

You can specify a different host in the template file and
surpress this warning.
suppress this warning.
EOF
validation {
condition = contains(["Continue using /var/run/docker.sock on the Coder host"], var.step1_docker_host_warning)
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable "step1_docker_host_warning" {
the Coder host, which is not necessarily your local machine.

You can specify a different host in the template file and
surpress this warning.
suppress this warning.
EOF
validation {
condition = contains(["Continue using /var/run/docker.sock on the Coder host"], var.step1_docker_host_warning)
Expand Down
2 changes: 1 addition & 1 deletion peer/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *Channel) init() {
c.closeMutex.Unlock()

// pion/webrtc will return an io.ErrShortBuffer when a read
// is triggerred with a buffer size less than the chunks written.
// is triggered with a buffer size less than the chunks written.
//
// This makes sense when considering UDP connections, because
// buffering of data that has no transmit guarantees is likely
Expand Down
4 changes: 2 additions & 2 deletions site/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,13 @@ func sha1HashFile(name string) ([]byte, error) {
return []byte(hex.EncodeToString(b)), nil
}

func extractBin(dest string, r io.Reader) (numExtraced int, err error) {
func extractBin(dest string, r io.Reader) (numExtracted int, err error) {
opts := []zstd.DOption{
// Concurrency doesn't help us when decoding the tar and
// can actually slow us down.
zstd.WithDecoderConcurrency(1),
// Ignoring checksums can give a slight performance
// boost but it's probalby not worth the reduced safety.
// boost but it's probably not worth the reduced safety.
zstd.IgnoreChecksum(false),
// Allow the decoder to use more memory giving us a 2-3x
// performance boost.
Expand Down
8 changes: 4 additions & 4 deletions site/site_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,25 +296,25 @@ func TestServingBin(t *testing.T) {
},
},
{
name: "Serve local fs when embedd fs empty",
name: "Serve local fs when embed fs empty",
fs: fstest.MapFS{},
reqs: []req{
{url: "/bin/coder-linux-amd64", wantStatus: http.StatusNotFound},
{url: "/bin/GITKEEP", wantStatus: http.StatusNotFound},
},
},
{
name: "Serve embedd fs",
name: "Serve embed fs",
fs: fstest.MapFS{
"bin/GITKEEP": &fstest.MapFile{
Data: []byte(""),
},
"bin/coder-linux-amd64": &fstest.MapFile{
Data: []byte("embedd"),
Data: []byte("embed"),
},
},
reqs: []req{
{url: "/bin/coder-linux-amd64", wantStatus: http.StatusOK, wantBody: []byte("embedd")},
{url: "/bin/coder-linux-amd64", wantStatus: http.StatusOK, wantBody: []byte("embed")},
{url: "/bin/GITKEEP", wantStatus: http.StatusOK, wantBody: []byte("")},
},
},
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const typeToColor = (type: ConfirmDialogType): LoadingButtonProps["color"] => {
}

/**
* Quickly handels most modals actions, some combination of a cancel and confirm button
* Quickly handles most modals actions, some combination of a cancel and confirm button
*/
export const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({
cancelText = "Cancel",
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Resources/ResourceAvatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NullResource.args = {
type: "null_resource",
}

export const UnkownResource = Template.bind({})
UnkownResource.args = {
export const UnknownResource = Template.bind({})
UnknownResource.args = {
type: "noexistentvalue",
}
2 changes: 1 addition & 1 deletion site/src/components/TableCellLink/TableCellLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const useStyles = makeStyles((theme) => ({
cell: {
// This must override all padding for all rules on a TableCell.
// Otherwise, the link will not cover the entire region.
// It's unfortuante to use `!important`, but this seems to be
// It's unfortunate to use `!important`, but this seems to be
// a reasonable use-case.
padding: "0 !important",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ NoTTL.args = {
...Mocks.MockWorkspace,
latest_build: {
...Mocks.MockWorkspaceBuild,
// a mannual shutdown has a deadline of '"0001-01-01T00:00:00Z"'
// a manual shutdown has a deadline of '"0001-01-01T00:00:00Z"'
// SEE: #1834
deadline: "0001-01-01T00:00:00Z",
},
Expand Down
2 changes: 1 addition & 1 deletion site/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const dashboardHTMLPluginConfig = new HtmlWebpackPlugin({
export const createCommonWebpackConfig = (options?: { skipTypecheck: boolean }): Configuration => ({
// entry defines each "page" or "chunk". In v1, we have two "pages":
// dashboard and terminal. This is desired because the terminal has the xterm
// vendor, and it is undesireable to load all of xterm on a dashboard
// vendor, and it is undesirable to load all of xterm on a dashboard
// page load.
//
// The object key determines the chunk 'name'. This can be used in `output`
Expand Down
2 changes: 1 addition & 1 deletion site/webpack.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const config: Configuration = {

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