Validate column colors in the CLI#174
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds CLI-side validation and normalization for --color on fizzy column create and fizzy column update, so invalid colors are rejected before making an API call (addressing the behavior described in #173).
Changes:
- Normalize friendly color aliases (case-insensitive) to the API’s CSS var color values before sending requests.
- Reject unknown colors early with an invalid-arguments error (no API call made).
- Expand tests to cover normalization, rejection behavior, and updated
--colorhelp text.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/commands/column.go | Validates/normalizes --color before create/update API calls; updates flag help text. |
| internal/commands/column_test.go | Updates create test expectation to match normalized API color value behavior. |
| internal/commands/column_color.go | Introduces alias/API-value normalization and invalid-color rejection. |
| internal/commands/column_color_test.go | Adds unit/integration-style tests for color normalization, rejection, and help text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
Fixed — clarified help and error text to say supported API color values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validates column colors for create and update commands so invalid values are reported before the API call. Supports the app’s lowercase friendly color aliases while preserving API color values, addressing the confusion reported in #173.
Fixes #173
Summary by cubic
Validate column colors for create/update in the CLI, mapping friendly aliases to API values and clarifying accepted values in help and errors. This blocks bad colors, aligns with the app’s lowercase names, and fixes #173.
--colorbefore requests; accepts case-insensitive aliases or API values; unknown colors return an invalid-args error listing allowed options.--colorhelp to show lowercase aliases (blue, gray, tan, yellow, lime, aqua, violet, purple, pink) and note that API values likevar(--color-card-5)are supported.Written for commit ca58ef1. Summary will update on new commits.