Skip to content

Commit 1ba687d

Browse files
Rename cmd/pretty to cmd/prettify for clearer verb-form API
prettify.JSON() reads as an imperative — "prettify this JSON" — which better communicates the function's intent than the ambiguous pretty.JSON(). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent ddc79a1 commit 1ba687d

20 files changed

+19
-19
lines changed

cmd/admin/organizations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package admin
1313
import (
1414
"fmt"
1515

16-
"github.com/adobe/imscli/cmd/pretty"
16+
"github.com/adobe/imscli/cmd/prettify"
1717
"github.com/adobe/imscli/ims"
1818
"github.com/spf13/cobra"
1919
)
@@ -33,7 +33,7 @@ func OrganizationsCmd(imsConfig *ims.Config) *cobra.Command {
3333
if err != nil {
3434
return fmt.Errorf("error in get admin organizations cmd: %w", err)
3535
}
36-
fmt.Println(pretty.JSON(resp))
36+
fmt.Println(prettify.JSON(resp))
3737
return nil
3838
},
3939
}

cmd/admin/profile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package admin
1414
import (
1515
"fmt"
1616

17-
"github.com/adobe/imscli/cmd/pretty"
17+
"github.com/adobe/imscli/cmd/prettify"
1818
"github.com/adobe/imscli/ims"
1919
"github.com/spf13/cobra"
2020
)
@@ -32,7 +32,7 @@ func ProfileCmd(imsConfig *ims.Config) *cobra.Command {
3232
if err != nil {
3333
return fmt.Errorf("error in get admin profile cmd: %w", err)
3434
}
35-
fmt.Println(pretty.JSON(resp))
35+
fmt.Println(prettify.JSON(resp))
3636
return nil
3737
},
3838
}

cmd/dcr.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package cmd
1313
import (
1414
"fmt"
1515

16-
"github.com/adobe/imscli/cmd/pretty"
16+
"github.com/adobe/imscli/cmd/prettify"
1717
"github.com/adobe/imscli/ims"
1818
"github.com/spf13/cobra"
1919
)
@@ -44,7 +44,7 @@ func registerCmd(imsConfig *ims.Config) *cobra.Command {
4444
return fmt.Errorf("error during client registration: %w", err)
4545
}
4646

47-
fmt.Println(pretty.JSON(resp))
47+
fmt.Println(prettify.JSON(resp))
4848
return nil
4949
},
5050
}

cmd/decode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"os"
1717
"time"
1818

19-
"github.com/adobe/imscli/cmd/pretty"
19+
"github.com/adobe/imscli/cmd/prettify"
2020
"github.com/adobe/imscli/ims"
2121
"github.com/spf13/cobra"
2222
)
@@ -36,7 +36,7 @@ func decodeCmd(imsConfig *ims.Config) *cobra.Command {
3636
}
3737

3838
output := fmt.Sprintf(`{"header":%s,"payload":%s}`, decoded.Header, decoded.Payload)
39-
fmt.Println(pretty.JSON(output))
39+
fmt.Println(prettify.JSON(output))
4040

4141
// When verbose, show human-readable token expiration on stderr
4242
// so it doesn't pollute the JSON output on stdout.

cmd/organizations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package cmd
1313
import (
1414
"fmt"
1515

16-
"github.com/adobe/imscli/cmd/pretty"
16+
"github.com/adobe/imscli/cmd/prettify"
1717
"github.com/adobe/imscli/ims"
1818
"github.com/spf13/cobra"
1919
)
@@ -33,7 +33,7 @@ func organizationsCmd(imsConfig *ims.Config) *cobra.Command {
3333
if err != nil {
3434
return fmt.Errorf("error in get organizations cmd: %w", err)
3535
}
36-
fmt.Println(pretty.JSON(resp))
36+
fmt.Println(prettify.JSON(resp))
3737
return nil
3838
},
3939
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// OF ANY KIND, either express or implied. See the License for the specific language
99
// governing permissions and limitations under the License.
1010

11-
// Package pretty provides output formatting helpers for the CLI.
12-
package pretty
11+
// Package prettify provides output formatting helpers for the CLI.
12+
package prettify
1313

1414
import (
1515
"bytes"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// OF ANY KIND, either express or implied. See the License for the specific language
99
// governing permissions and limitations under the License.
1010

11-
package pretty
11+
package prettify
1212

1313
import (
1414
"math/rand"
@@ -74,7 +74,7 @@ func randomString(rng *rand.Rand, length int) string {
7474
//
7575
// For deeper exploration, use Go's built-in fuzz engine:
7676
//
77-
// go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/pretty/
77+
// go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/prettify/
7878
func TestFuzzJSON(t *testing.T) {
7979
t.Parallel()
8080

@@ -96,7 +96,7 @@ func TestFuzzJSON(t *testing.T) {
9696
}
9797

9898
// FuzzJSON is a standard Go fuzz target for deeper exploration.
99-
// Run manually: go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/pretty/
99+
// Run manually: go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/prettify/
100100
func FuzzJSON(f *testing.F) {
101101
f.Add(`{}`)
102102
f.Add(`[]`)
File renamed without changes.

0 commit comments

Comments
 (0)