mirror of
https://github.com/a-h/templ.git
synced 2025-02-06 09:45:21 +00:00
refactor: add CI checks to xc task list
This commit is contained in:
parent
7279001e21
commit
15b34834ae
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -63,10 +63,7 @@ jobs:
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@v3
|
||||
|
||||
- name: Generate
|
||||
run: nix develop --command xc generate
|
||||
|
||||
- name: Ensure clean
|
||||
run: git diff --exit-code
|
||||
run: nix develop --command xc ensure-generated
|
||||
|
||||
ensure-fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -26,3 +26,6 @@ result
|
||||
|
||||
# Go workspace.
|
||||
go.work
|
||||
|
||||
# direnv
|
||||
.direnv
|
||||
|
@ -141,6 +141,14 @@ go run ./cmd/templ fmt .
|
||||
golangci-lint run --verbose
|
||||
```
|
||||
|
||||
### ensure-generated
|
||||
|
||||
Requires: generate
|
||||
|
||||
```sh
|
||||
git diff --exit-code
|
||||
```
|
||||
|
||||
### push-release-tag
|
||||
|
||||
Push a semantic version number to Github to trigger the release process.
|
||||
|
@ -7,9 +7,7 @@ package main
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
import "context"
|
||||
|
||||
func NameFromContext(ctx context.Context) string {
|
||||
if name, ok := ctx.Value("name").(string); ok && name != "" {
|
||||
@ -43,7 +41,7 @@ func Home(name string) templ.Component {
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `examples/integration-gofiber/home.templ`, Line: 15, Col: 18}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `examples/integration-gofiber/home.templ`, Line: 13, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@ -56,7 +54,7 @@ func Home(name string) templ.Component {
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(NameFromContext(ctx))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `examples/integration-gofiber/home.templ`, Line: 16, Col: 34}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `examples/integration-gofiber/home.templ`, Line: 14, Col: 34}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user