1
0
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:
Adrian Hesketh 2024-08-13 08:42:06 -07:00
parent 7279001e21
commit 15b34834ae
No known key found for this signature in database
GPG Key ID: 9E01387222323123
6 changed files with 17 additions and 10 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

View File

@ -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
View File

@ -26,3 +26,6 @@ result
# Go workspace.
go.work
# direnv
.direnv

View File

@ -1 +1 @@
0.2.754
0.2.759

View File

@ -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.

View File

@ -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 {