Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c67f767
feat!: initial commit for codegen CLI with golang support
anghelflorinm Sep 10, 2024
ec78985
docs!: add comments to few missing exported functions
anghelflorinm Sep 10, 2024
32f8069
refactor!: add better error messages for the CLI
anghelflorinm Sep 10, 2024
e4b02d0
refactor: move package to the top of the repository
anghelflorinm Sep 24, 2024
47889fc
refactor: move main file to top directory
anghelflorinm Sep 24, 2024
e5620ed
refactor: embed flag manifest schema into the script
anghelflorinm Sep 26, 2024
faf47d4
Merge branch 'main' into 2-cli-prototype
anghelflorinm Sep 26, 2024
9b8ddd8
fix: remove files after being moved
anghelflorinm Sep 26, 2024
5bdfc10
refactor: move main.go back into SRC and attach module to flagmanifes…
anghelflorinm Sep 30, 2024
896ac8d
Merge remote-tracking branch 'origin' into 2-cli-prototype
anghelflorinm Oct 1, 2024
a5059d0
refactor: change property names in manifest to camel case format
anghelflorinm Oct 1, 2024
01240cc
refactor: change property names to camel case
anghelflorinm Oct 1, 2024
301a51b
Merge remote-tracking branch 'origin' into 2-cli-prototype
anghelflorinm Oct 2, 2024
9c37b8f
Merge remote-tracking branch 'origin' into 2-cli-prototype
anghelflorinm Oct 3, 2024
96b2139
Merge remote-tracking branch 'origin' into 2-cli-prototype
anghelflorinm Oct 7, 2024
c766e83
refactor: change folder, package structure; integrate with cobra
anghelflorinm Oct 9, 2024
087b76b
chore: delete comment; this has been replaced with Git project issue
anghelflorinm Oct 10, 2024
36124c8
chore: update internal/generate/plugins/golang/golang.tmpl
anghelflorinm Oct 10, 2024
d858654
Merge remote-tracking branch 'origin' into 2-cli-prototype
anghelflorinm Oct 23, 2024
97cdaff
test: add small tests for generate command for go and react with in m…
anghelflorinm Oct 29, 2024
4682490
Merge branch '2-cli-prototype' of https://github.com/open-feature/cod…
anghelflorinm Oct 29, 2024
09f0ac5
chore: update cmd/generate/generate_test.go
anghelflorinm Oct 30, 2024
6509bda
chore: update cmd/generate/generate_test.go
anghelflorinm Oct 30, 2024
efdcc4b
chore: update the permissions when making directory
anghelflorinm Oct 31, 2024
a883f7e
Merge remote-tracking branch 'origin' into 2-cli-prototype
anghelflorinm Nov 4, 2024
fc94016
chore: remove empty testutils package
anghelflorinm Nov 4, 2024
d96c3a0
/bin/bash: qm: command not found
anghelflorinm Nov 26, 2024
3cd02c6
Merge branch main into 2-cli-prototype
anghelflorinm Nov 26, 2024
1076fb8
Merge branch '2-cli-prototype' of https://github.com/open-feature/cod…
anghelflorinm Nov 26, 2024
356780b
Merge branch '2-cli-prototype' of https://github.com/open-feature/cod…
anghelflorinm Nov 26, 2024
9604583
chore: update back to previous mkdir permissions
anghelflorinm Nov 27, 2024
dd4fc72
Merge branch '2-cli-prototype' of https://github.com/open-feature/cod…
anghelflorinm Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func readOsFileAndWriteToMemMap(t *testing.T, inputPath string, memPath string,
if err != nil {
t.Fatalf("error reading file %q: %v", inputPath, err)
}
if err := memFs.MkdirAll(filepath.Dir(memPath), 0660); err != nil {
if err := memFs.MkdirAll(filepath.Dir(memPath), os.ModePerm); err != nil {
t.Fatalf("error creating directory %q: %v", filepath.Dir(memPath), err)
}
f, err := memFs.Create(memPath)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/iancoleman/strcase v0.3.0
github.com/open-feature/go-sdk v1.13.0
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
github.com/spf13/afero v1.11.0
)

require (
Expand All @@ -18,7 +19,6 @@ require (
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
Expand Down
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
Expand All @@ -15,6 +19,10 @@ github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSAS
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
Expand All @@ -24,6 +32,10 @@ github.com/open-feature/go-sdk v1.13.0/go.mod h1:poPa+RFCJumHcb59wgp+tnSyNvMU2C0
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
Expand Down Expand Up @@ -51,6 +63,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
Expand All @@ -65,6 +78,8 @@ golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
3 changes: 2 additions & 1 deletion internal/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package generate
import (
"bytes"
"fmt"
"os"
"path"
"path/filepath"
"text/template"
Expand All @@ -30,7 +31,7 @@ func GenerateFile(funcs template.FuncMap, contents string, data types.TmplDataIn
}
outputPath := data.BaseTmplDataInfo().OutputPath
fs := filesystem.FileSystem()
if err := fs.MkdirAll(filepath.Dir(outputPath), 0660); err != nil {
if err := fs.MkdirAll(filepath.Dir(outputPath), os.ModePerm); err != nil {
return err
}
f, err := fs.Create(path.Join(outputPath))
Expand Down