Skip to content

Commit 4873118

Browse files
committed
build: refactor paths for code-gen
1 parent 2c25dba commit 4873118

7 files changed

+8
-8
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bin/
99
completions/
1010
coverage.txt
1111
dist/
12-
/schema/*/ignore
12+
/schema/ignore
1313
manpages/
1414
scm-engine
1515
scm-engine.exe

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ The `skip_if` field must be a valid [Expr-lang](https://expr-lang.org/) expressi
360360
### Attributes
361361

362362
> [!NOTE]
363-
> Missing an attribute? The `schema/gitlab/schema.graphqls` file are what is used to query GitLab, adding the missing `field` to the right `type` should make it accessible.
363+
> Missing an attribute? The `schema/gitlab.schema.graphqls` file are what is used to query GitLab, adding the missing `field` to the right `type` should make it accessible.
364364
> Please open an issue or Pull Request if something is missing.
365365

366366
> [!IMPORTANT]

schema/generate.go

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package schema
2+
3+
//go:generate go run gitlab.go

schema/gitlab/main.go schema/gitlab.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func mutateHook(b *modelgen.ModelBuild) *modelgen.ModelBuild {
8181
}
8282

8383
func main() {
84-
cfg, err := config.LoadConfig(getRootPath() + "/schema/gitlab/gqlgen.yml")
84+
cfg, err := config.LoadConfig(getRootPath() + "/schema/gitlab.gqlgen.yml")
8585
if err != nil {
8686
fmt.Fprintln(os.Stderr, "failed to load config", err.Error())
8787

schema/gitlab/gqlgen.yml schema/gitlab.gqlgen.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Where are all the schema files located? globs are supported eg src/**/*.graphqls
22
schema:
3-
- "*.graphqls"
3+
- "gitlab.schema.graphqls"
44

55
# Where should the generated server code go?
66
exec:
@@ -14,7 +14,7 @@ exec:
1414

1515
# Where should any generated models go?
1616
model:
17-
filename: ../../pkg/scm/gitlab/context.gen.go
17+
filename: ../pkg/scm/gitlab/context.gen.go
1818
package: gitlab
1919

2020
# Where should the resolver implementations go?
File renamed without changes.

schema/gitlab/generate.go

-3
This file was deleted.

0 commit comments

Comments
 (0)