From 725a88f73cfbaff9e43fbf50b6abbae59630bfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 21 Jan 2025 18:16:06 +0100 Subject: [PATCH] chore: fix misspellings (#1040) Co-authored-by: Adrian Hesketh --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .version | 2 +- README.md | 2 +- SECURITY.md | 2 +- cmd/templ/lspcmd/lsp_test.go | 6 +++--- docs/docs/02-quick-start/01-installation.md | 2 +- docs/docs/03-syntax-and-usage/12-script-templates.md | 2 +- docs/docs/09-developer-tools/02-ide-support.md | 4 ++-- docs/docs/09-developer-tools/03-live-reload.md | 2 +- docs/docs/09-developer-tools/05-llm.md | 4 ++-- docs/docs/10-security/03-code-signing.md | 2 +- docs/docs/13-experimental/02-urlbuilder.md | 2 +- docs/docs/14-help-and-community/index.md | 2 +- generator/generator.go | 4 ++-- generator/test-css-usage/expected.html | 2 +- generator/test-css-usage/template.templ | 6 +++--- generator/test-css-usage/template_templ.go | 6 +++--- handler_test.go | 4 ++-- parser/v2/ifexpressionparser.go | 4 ++-- parser/v2/switchexpressionparser.go | 4 ++-- parser/v2/textparser_test.go | 4 ++-- safehtml/style_test.go | 2 +- 22 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ef2ce9125..cf03af039 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -14,7 +14,7 @@ Please make sure you're using the latest version of the templ CLI (`go install g A clear and concise description of what the bug is. **To Reproduce** -A small, self-container, complete reproduction, uploaded to a Github repo, containing the minimum amount of files required to reproduce the behaviour, along with a list of commands that need to be run. Keep it simple. +A small, self-container, complete reproduction, uploaded to a GitHub repo, containing the minimum amount of files required to reproduce the behaviour, along with a list of commands that need to be run. Keep it simple. **Expected behavior** A clear and concise description of what you expected to happen. diff --git a/.version b/.version index d9bec1e2f..3ed8359ef 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.3.822 \ No newline at end of file +0.3.826 \ No newline at end of file diff --git a/README.md b/README.md index 60482fd5b..60d2f675e 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ git diff --exit-code ### push-release-tag -Push a semantic version number to Github to trigger the release process. +Push a semantic version number to GitHub to trigger the release process. ```sh ./push-tag.sh diff --git a/SECURITY.md b/SECURITY.md index 8241f5532..e8c820eea 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,4 +6,4 @@ The latest version of templ is supported. ## Reporting a Vulnerability -Use the "Security" tab in Github and fill out the "Report a vulnerability" form. +Use the "Security" tab in GitHub and fill out the "Report a vulnerability" form. diff --git a/cmd/templ/lspcmd/lsp_test.go b/cmd/templ/lspcmd/lsp_test.go index a3c807a7b..1767ee345 100644 --- a/cmd/templ/lspcmd/lsp_test.go +++ b/cmd/templ/lspcmd/lsp_test.go @@ -719,11 +719,11 @@ func TestDocumentSymbol(t *testing.T) { } } - expectdSlice, err := sliceToAnySlice(test.expect) + expectedSlice, err := sliceToAnySlice(test.expect) if err != nil { t.Errorf("failed to convert expect to any slice: %v", err) } - diff := cmp.Diff(expectdSlice, actual) + diff := cmp.Diff(expectedSlice, actual) if diff != "" { t.Errorf("unexpected document symbol: %v", diff) } @@ -843,7 +843,7 @@ func Setup(ctx context.Context, log *zap.Logger) (clientCtx context.Context, app var wg sync.WaitGroup var cmdErr error - // Copy from the LSP to the CLient, and vice versa. + // Copy from the LSP to the Client, and vice versa. fromClient, toLSP := io.Pipe() fromLSP, toClient := io.Pipe() clientStream := jsonrpc2.NewStream(newStdRwc(log, "clientStream", toLSP, fromLSP)) diff --git a/docs/docs/02-quick-start/01-installation.md b/docs/docs/02-quick-start/01-installation.md index d53c574d3..7a2d20e7b 100644 --- a/docs/docs/02-quick-start/01-installation.md +++ b/docs/docs/02-quick-start/01-installation.md @@ -8,7 +8,7 @@ With Go 1.23 or greater installed, run: go install github.com/a-h/templ/cmd/templ@latest ``` -## Github binaries +## GitHub binaries Download the latest release from https://github.com/a-h/templ/releases/latest diff --git a/docs/docs/03-syntax-and-usage/12-script-templates.md b/docs/docs/03-syntax-and-usage/12-script-templates.md index 12e284725..8cd027840 100644 --- a/docs/docs/03-syntax-and-usage/12-script-templates.md +++ b/docs/docs/03-syntax-and-usage/12-script-templates.md @@ -458,7 +458,7 @@ templ page(content string) { } ``` -The data passed into the Javascript funtion will be JSON encoded, which then can be used inside the function. +The data passed into the Javascript function will be JSON encoded, which then can be used inside the function. ```go title="main.go" package main diff --git a/docs/docs/09-developer-tools/02-ide-support.md b/docs/docs/09-developer-tools/02-ide-support.md index d62490122..732e73c77 100644 --- a/docs/docs/09-developer-tools/02-ide-support.md +++ b/docs/docs/09-developer-tools/02-ide-support.md @@ -213,9 +213,9 @@ end ### Troubleshooting -If you cannot run `:TSInstall templ`, ensure you have an up-to-date version of [tree-sitter](https://github.com/nvim-treesitter/nvim-treesitter). The [package for templ](https://github.com/vrischmann/tree-sitter-templ) was [added to the main tree-sitter repositry](https://github.com/nvim-treesitter/nvim-treesitter/pull/5667) so you shouldn't need to install a separate plugin for it. +If you cannot run `:TSInstall templ`, ensure you have an up-to-date version of [tree-sitter](https://github.com/nvim-treesitter/nvim-treesitter). The [package for templ](https://github.com/vrischmann/tree-sitter-templ) was [added to the main tree-sitter repository](https://github.com/nvim-treesitter/nvim-treesitter/pull/5667) so you shouldn't need to install a separate plugin for it. -If you still don't get syntax highlighting after it's installed, try running `:TSBufEnable highlight`. If you find that you need to do this every time you open a .templ file, you can run this autocmd to do it for your neovim configuation. +If you still don't get syntax highlighting after it's installed, try running `:TSBufEnable highlight`. If you find that you need to do this every time you open a .templ file, you can run this autocmd to do it for your neovim configuration. ```lua vim.api.nvim_create_autocmd("BufEnter", { pattern = "*.templ", callback = function() vim.cmd("TSBufEnable highlight") end }) diff --git a/docs/docs/09-developer-tools/03-live-reload.md b/docs/docs/09-developer-tools/03-live-reload.md index 510b97091..9badba498 100644 --- a/docs/docs/09-developer-tools/03-live-reload.md +++ b/docs/docs/09-developer-tools/03-live-reload.md @@ -106,7 +106,7 @@ templ generate --notify-proxy --proxybind="localhost" --proxyport="8080" wgo -file=.go -file=.templ -xfile=_templ.go templ generate :: go run main.go ``` -To avoid a continous reloading files ending with `_templ.go` should be skipped via `-xfile`. +To avoid a continuous reloading files ending with `_templ.go` should be skipped via `-xfile`. ## Alternative 2: air diff --git a/docs/docs/09-developer-tools/05-llm.md b/docs/docs/09-developer-tools/05-llm.md index 393a459b2..7031e9f14 100644 --- a/docs/docs/09-developer-tools/05-llm.md +++ b/docs/docs/09-developer-tools/05-llm.md @@ -1,6 +1,6 @@ # Coding assistants / LLMs -To provide AI coding assistants such as Github Copilot, Cursor or similar with help on how to write templ code, the templ project maintains a single file containing documentation for LLMs to read. +To provide AI coding assistants such as GitHub Copilot, Cursor or similar with help on how to write templ code, the templ project maintains a single file containing documentation for LLMs to read. You can find the file at `https://templ.guide/llms.md`. @@ -8,6 +8,6 @@ You can find the file at `https://templ.guide/llms.md`. ### https://github.com/CopilotC-Nvim/CopilotChat.nvim -CopilotChat is a plugin for Neovim that provides a chat interface for Github Copilot. It allows you to ask Copilot questions and get responses in real-time. +CopilotChat is a plugin for Neovim that provides a chat interface for GitHub Copilot. It allows you to ask Copilot questions and get responses in real-time. Use the URL feature to load `https://templ.guide/llms.md`. diff --git a/docs/docs/10-security/03-code-signing.md b/docs/docs/10-security/03-code-signing.md index 473850196..c6cfb751d 100644 --- a/docs/docs/10-security/03-code-signing.md +++ b/docs/docs/10-security/03-code-signing.md @@ -1,6 +1,6 @@ # Code signing -Binaries are created by the Github Actions workflow at https://github.com/a-h/templ/blob/main/.github/workflows/release.yml +Binaries are created by the GitHub Actions workflow at https://github.com/a-h/templ/blob/main/.github/workflows/release.yml Binaries are signed by cosign. The public key is stored in the repository at https://github.com/a-h/templ/blob/main/cosign.pub diff --git a/docs/docs/13-experimental/02-urlbuilder.md b/docs/docs/13-experimental/02-urlbuilder.md index 2848ebac3..b3ddf6157 100644 --- a/docs/docs/13-experimental/02-urlbuilder.md +++ b/docs/docs/13-experimental/02-urlbuilder.md @@ -24,7 +24,7 @@ templ component(o Order) { } ``` -See [URL Attribures](/syntax-and-usage/attributes#url-attributes) for more information. +See [URL Attributes](/syntax-and-usage/attributes#url-attributes) for more information. ## Feedback diff --git a/docs/docs/14-help-and-community/index.md b/docs/docs/14-help-and-community/index.md index daf12e2d7..d3a2faec2 100644 --- a/docs/docs/14-help-and-community/index.md +++ b/docs/docs/14-help-and-community/index.md @@ -8,6 +8,6 @@ Use the #templ channel in the Gopher Slack community. https://invite.slack.golangbridge.org/ -## Github Discussion +## GitHub Discussion https://github.com/a-h/templ/discussions diff --git a/generator/generator.go b/generator/generator.go index 3b8e316a6..a11dcf318 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -1013,7 +1013,7 @@ func (g *generator) writeAttributeCSS(indentLevel int, attr parser.ExpressionAtt } // Create a class name for the style. // The expression can either be expecting a templ.Classes call, or an expression that returns - // var templ_7745c5c3_CSSClassess = []any{ + // var templ_7745c5c3_CSSClasses = []any{ classesName := g.createVariableName() if _, err = g.w.WriteIndent(indentLevel, "var "+classesName+" = []any{"); err != nil { return @@ -1028,7 +1028,7 @@ func (g *generator) writeAttributeCSS(indentLevel int, attr parser.ExpressionAtt return } // Render the CSS before the element if required. - // templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_CSSClassess...) + // templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_CSSClasses...) if _, err = g.w.WriteIndent(indentLevel, "templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, "+classesName+"...)\n"); err != nil { return } diff --git a/generator/test-css-usage/expected.html b/generator/test-css-usage/expected.html index ff3319393..d488fa178 100644 --- a/generator/test-css-usage/expected.html +++ b/generator/test-css-usage/expected.html @@ -11,7 +11,7 @@
Maps can be used to determine if a class should be added or not.
KV can be used to conditionally set classes.
-
Psuedo attributes and complex class names are supported.
+
Pseudo attributes and complex class names are supported.
Class names are HTML escaped.
diff --git a/generator/test-css-usage/template.templ b/generator/test-css-usage/template.templ index 977344856..0af1f19e4 100644 --- a/generator/test-css-usage/template.templ +++ b/generator/test-css-usage/template.templ @@ -54,8 +54,8 @@ templ KVCanBeUsedToConditionallySetClasses() { } // Pseudo attributes can be used without any special syntax. -templ PsuedoAttributesAndComplexClassNamesAreSupported() { -
Psuedo attributes and complex class names are supported.
+templ PseudoAttributesAndComplexClassNamesAreSupported() { +
Pseudo attributes and complex class names are supported.
} // Class names are HTML escaped. @@ -89,7 +89,7 @@ templ TestComponent() { @CSSComponentsAndConstantsAreSupported() @MapsCanBeUsedToConditionallySetClasses() @KVCanBeUsedToConditionallySetClasses() - @PsuedoAttributesAndComplexClassNamesAreSupported() + @PseudoAttributesAndComplexClassNamesAreSupported() @ClassNamesAreHTMLEscaped() @CSSComponentsCanBeUsedWithArguments() @Rotate(45) diff --git a/generator/test-css-usage/template_templ.go b/generator/test-css-usage/template_templ.go index 47cd7496b..f93f3f272 100644 --- a/generator/test-css-usage/template_templ.go +++ b/generator/test-css-usage/template_templ.go @@ -290,7 +290,7 @@ func KVCanBeUsedToConditionallySetClasses() templ.Component { } // Pseudo attributes can be used without any special syntax. -func PsuedoAttributesAndComplexClassNamesAreSupported() templ.Component { +func PseudoAttributesAndComplexClassNamesAreSupported() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -329,7 +329,7 @@ func PsuedoAttributesAndComplexClassNamesAreSupported() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\">Psuedo attributes and complex class names are supported.") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\">Pseudo attributes and complex class names are supported.") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -564,7 +564,7 @@ func TestComponent() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = PsuedoAttributesAndComplexClassNamesAreSupported().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = PseudoAttributesAndComplexClassNamesAreSupported().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/handler_test.go b/handler_test.go index 7e7d6cea8..b3f365843 100644 --- a/handler_test.go +++ b/handler_test.go @@ -189,8 +189,8 @@ func TestHandler(t *testing.T) { } // Expect the status code to be 201, not 400, because in streaming mode, // we have to write the header before we can call the error handler. - if actualRepsonseCode := w.Result().StatusCode; http.StatusCreated != actualRepsonseCode { - t.Errorf("expected status %d, got %d", http.StatusCreated, actualRepsonseCode) + if actualResponseCode := w.Result().StatusCode; http.StatusCreated != actualResponseCode { + t.Errorf("expected status %d, got %d", http.StatusCreated, actualResponseCode) } // Expect the body to be "BodyError message", not just "Error message" because // in streaming mode, we've already written part of the body to the response, unlike in diff --git a/parser/v2/ifexpressionparser.go b/parser/v2/ifexpressionparser.go index f8cddb0df..926f6c575 100644 --- a/parser/v2/ifexpressionparser.go +++ b/parser/v2/ifexpressionparser.go @@ -19,7 +19,7 @@ func (ifExpressionParser) Parse(pi *parse.Input) (n Node, ok bool, err error) { return r, false, nil } - // Parse the Go if expresion. + // Parse the Go if expression. if r.Expression, err = parseGo("if", pi, goexpression.If); err != nil { return r, false, err } @@ -78,7 +78,7 @@ func (elseIfExpressionParser) Parse(pi *parse.Input) (r ElseIfExpression, ok boo // Rewind to the start of the `if` statement. pi.Seek(pi.Index() - 2) - // Parse the Go if expresion. + // Parse the Go if expression. if r.Expression, err = parseGo("else if", pi, goexpression.If); err != nil { return r, false, err } diff --git a/parser/v2/switchexpressionparser.go b/parser/v2/switchexpressionparser.go index f21e4bf8d..cbdb02c32 100644 --- a/parser/v2/switchexpressionparser.go +++ b/parser/v2/switchexpressionparser.go @@ -19,7 +19,7 @@ func (switchExpressionParser) Parse(pi *parse.Input) (n Node, ok bool, err error return } - // Parse the Go switch expresion. + // Parse the Go switch expression. if r.Expression, err = parseGo("switch", pi, goexpression.Switch); err != nil { return r, false, err } @@ -67,7 +67,7 @@ var caseExpressionStartParser = parse.Func(func(pi *parse.Input) (r Expression, pi.Seek(start) return r, false, nil } - // Parse the Go expresion. + // Parse the Go expression. if r, err = parseGo("case", pi, goexpression.Case); err != nil { return r, false, err } diff --git a/parser/v2/textparser_test.go b/parser/v2/textparser_test.go index 2e4602f33..d6b25d173 100644 --- a/parser/v2/textparser_test.go +++ b/parser/v2/textparser_test.go @@ -80,7 +80,7 @@ func TestTextParser(t *testing.T) { }, }, { - name: "Multiline text is colected line by line", + name: "Multiline text is collected line by line", input: "Line 1\nLine 2", expected: Text{ Value: "Line 1", @@ -92,7 +92,7 @@ func TestTextParser(t *testing.T) { }, }, { - name: "Multiline text is colected line by line (Windows)", + name: "Multiline text is collected line by line (Windows)", input: "Line 1\r\nLine 2", expected: Text{ Value: "Line 1", diff --git a/safehtml/style_test.go b/safehtml/style_test.go index 7617da133..c55a44a7b 100644 --- a/safehtml/style_test.go +++ b/safehtml/style_test.go @@ -172,7 +172,7 @@ func TestSanitizeCSS(t *testing.T) { expectedValue: InnocuousPropertyValue, }, { - name: "background-image invalid sufix", + name: "background-image invalid suffix", inputProperty: "background-image", expectedProperty: "background-image", inputValue: `url("/img.png`,