Skip to content
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

cuelang.org: coverage of list.UniqueItems is inconsistent and somewhat confusing #171

Open
jpluscplusm opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jpluscplusm
Copy link
Collaborator

jpluscplusm commented Jul 24, 2024

What page were you looking at?

https://cuelang.org/docs/howto/list-no-duplicates/ &
https://cuelang.org/docs/howto/use-list-uniqueitems-as-a-field-validator/

What version of the site were you looking at?

cue-lang/cuelang.org@b5df5d4

What did you do?

Tried to understand list.UniqueItems as a newcomer to CUE.

What did you expect?

To be presented with clear examples.

What did you see instead?

https://cuelang.org/docs/howto/list-no-duplicates/ is inconsistent with the rest of the site, contains an odd warning about things "not working with non-integers" that isn't strictly backed up by the issue it links to, and feels way longer than it needs to be because it has type-specific sections, and also has a section on ensuring field subsets have unique composite values.

The example presented in https://cuelang.org/docs/howto/use-list-uniqueitems-as-a-field-validator/ tries to cover too many bases in one.

@jpluscplusm jpluscplusm added the bug Something isn't working label Jul 24, 2024
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jul 24, 2024
This removes several uses of "```" to format code on the page, and
replaces them with "{{{with code ...}}}". This benefits us by increasing
automated "cue fmt" coverage of the examples on the site, and by
engaging syntax highlighting without manual language markers.

Some examples of "```" remain, such as where an environment variable is
being demonstrated; or inside the language guide and spec, which aren't
being updated on the master branch currently.

One example in the modules reference triggers cue-lang/cue#722, and ends
up with a leading comment being incorrectly indented; this error is
allowed to exist as the issue is fixed, and the page will soon fix
itself when the site is updated to use CUE v0.10.0 or later.

One page (list-no-duplicates) loses the highlighting of specific lines
in some examples. This is acceptable in light of the changes anticipated
by cue-lang/docs-and-content#171, which are likely to result in this
page being completely rewritten or subsumed into another howto guide.

Preview-Path: /docs/howto/list-no-duplicates/
Preview-Path: /docs/introduction/
Preview-Path: /docs/reference/modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f
Dispatch-Trailer: {"type":"trybot","CL":1198345,"patchset":1,"ref":"refs/changes/45/1198345/1","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jul 24, 2024
This removes several uses of "```" to format code on the page, and
replaces them with "{{{with code ...}}}". This benefits us by increasing
automated "cue fmt" coverage of the examples on the site, and by
engaging syntax highlighting without manual language markers.

Some examples of "```" remain, such as where an environment variable is
being demonstrated; or inside the language guide and spec, which aren't
being updated on the master branch currently.

One example in the modules reference triggers cue-lang/cue#722, and ends
up with a leading comment being incorrectly indented; this error is
allowed to exist as the issue is fixed, and the page will soon fix
itself when the site is updated to use CUE v0.10.0 or later.

One page (list-no-duplicates) loses the highlighting of specific lines
in some examples. This is acceptable in light of the changes anticipated
by cue-lang/docs-and-content#171, which are likely to result in this
page being completely rewritten or subsumed into another howto guide.

Preview-Path: /docs/howto/list-no-duplicates/
Preview-Path: /docs/introduction/
Preview-Path: /docs/reference/modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f
Dispatch-Trailer: {"type":"trybot","CL":1198345,"patchset":2,"ref":"refs/changes/45/1198345/2","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jul 26, 2024
This removes several uses of "```" to format code on the page, and
replaces them with "{{{with code ...}}}". This benefits us by increasing
automated "cue fmt" coverage of the examples on the site, and by
engaging syntax highlighting without manual language markers.

Some examples of "```" remain, such as where an environment variable is
being demonstrated; or inside the language guide and spec, which aren't
being updated on the master branch currently.

One example in the modules reference triggers cue-lang/cue#722, and ends
up with a leading comment being incorrectly indented; this issue is
fixed, and the example will have its #nofmt removed after the site is
updated to use CUE v0.10.0 or later.

One page (list-no-duplicates) loses the highlighting of specific lines
in some examples. This is acceptable in light of the changes anticipated
by cue-lang/docs-and-content#171, which are likely to result in this
page being completely rewritten or subsumed into another howto guide.

Preview-Path: /docs/howto/list-no-duplicates/
Preview-Path: /docs/introduction/
Preview-Path: /docs/reference/modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f
Dispatch-Trailer: {"type":"trybot","CL":1198345,"patchset":3,"ref":"refs/changes/45/1198345/3","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue Jul 26, 2024
This removes several uses of "```" to format code on the page, and
replaces them with "{{{with code ...}}}". This benefits us by increasing
automated "cue fmt" coverage of the examples on the site, and by
engaging syntax highlighting without manual language markers.

Some examples of "```" remain, such as where an environment variable is
being demonstrated; or inside the language guide and spec, which aren't
being updated on the master branch currently.

One example in the modules reference triggers cue-lang/cue#722, and ends
up with a leading comment being incorrectly indented; this issue is
fixed, and the example will have its #nofmt removed after the site is
updated to use CUE v0.10.0 or later.

One page (list-no-duplicates) loses the highlighting of specific lines
in some examples. This is acceptable in light of the changes anticipated
by cue-lang/docs-and-content#171, which are likely to result in this
page being completely rewritten or subsumed into another howto guide.

Preview-Path: /docs/howto/list-no-duplicates/
Preview-Path: /docs/introduction/
Preview-Path: /docs/reference/modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1198345
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jan 3, 2025
This merges /docs/howto/list-no-duplicates and
/docs/howto/use-list-uniqueitems-as-a-field-validator into a single
guide, with prose rewritten around demonstrations that are more
consistently usable.

The previous form of /docs/howto/list-no-duplicates contained confusing
prose about list.UniqueItems not working "with non-integer values", and
demonstrated examples that would incorrectly fail to fail validation if
a list were imported from a package and were then referenced directly
(because the hidden `_itemsCheck` field wouldn't be evaluated).

Closes cue-lang/docs-and-content#171.

Preview-Path: /docs/howto/ensure-list-contains-no-duplicates/
Preview-Path: /docs/howto/list-no-duplicates/
Preview-Path: /docs/howto/use-list-uniqueitems-as-a-field-validator/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Id7bef53e0aef0f222c7859005c03598ff4d489a7
Dispatch-Trailer: {"type":"trybot","CL":1206577,"patchset":2,"ref":"refs/changes/77/1206577/2","targetBranch":"master"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant