-
Notifications
You must be signed in to change notification settings - Fork 504
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
Add egbuilder #1058
Add egbuilder #1058
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #1058 +/- ##
==========================================
- Coverage 81.70% 81.63% -0.08%
==========================================
Files 135 135
Lines 15121 15138 +17
==========================================
+ Hits 12355 12358 +3
- Misses 2209 2225 +16
+ Partials 557 555 -2 ☔ View full report in Codecov by Sentry. |
doc/egbuilder.md
Outdated
raceDetector: false | ||
|
||
# skipBuild: if true, not build, just generate temp directory and files. | ||
# still clean up if skipCleanUp is false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the meaning of this line is not clear enough, please rewrite it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all updated, please check!
doc/egbuilder.md
Outdated
egbuilder run // run with default | ||
egbuilder run -f run.yaml // run with config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are shell commands, //
is not the correct comment format.
if !unicode.IsUpper(nameArr[0]) { | ||
return false | ||
} | ||
return ValidVariableName(string(nameArr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using ValidVariableName(name)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be ExportableVariableName
for the function name... I will update the function name
cmd/builder/utils/validation.go
Outdated
return true | ||
} | ||
|
||
func CapitalVariableName(name string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name of this function is not clearly described its functionality.
"fmt" | ||
"strings" | ||
|
||
j "github.com/dave/jennifer/jen" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine, but I think using 'text/template' for this task is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jennifer
can do some checks. And can split the generated files into pieces. Emmm, it's a trade off choice.
} | ||
fmt.Println("generate controllers success") | ||
|
||
err = initConfig.GenRegistry(cwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will all controllers and filters be added to registry even some of them failed to generate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if generation of file failed, the process will exit.
No description provided.