Skip to content

Commit

Permalink
Replace :hide:all with :hide-all
Browse files Browse the repository at this point in the history
The former was confusing because `:hide` and `:all` are not actually
separate tags.
  • Loading branch information
sellout committed Dec 10, 2024
1 parent b016af0 commit 523256c
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions unison-cli/src/Unison/Codebase/Transcript/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ nonNewlineSpaces = void $ P.takeWhileP Nothing (\ch -> ch == ' ' || ch == '\t')

formatHidden :: Hidden -> Maybe Text
formatHidden = \case
HideAll -> pure ":hide:all"
HideAll -> pure ":hide-all"
HideOutput -> pure ":hide"
Shown -> Nothing

hidden :: P Hidden
hidden =
(HideAll <$ word ":hide:all")
(HideAll <$ word ":hide-all")
<|> (HideOutput <$ word ":hide")
<|> pure Shown

Expand Down
2 changes: 1 addition & 1 deletion unison-src/transcripts/alias-many.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
``` ucm :hide
scratch/main> builtins.merge lib.builtins
```
``` unison :hide:all
``` unison :hide-all
List.adjacentPairs : [a] -> [(a, a)]
List.adjacentPairs as =
go xs acc =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
1 | ``` ucm :hode
| ^
unexpected ':'
expecting ":added-by-ucm", ":bug", ":error", ":hide", ":hide:all", or newline
expecting ":added-by-ucm", ":bug", ":error", ":hide", ":hide-all", or newline
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/missing-result-typed.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### Transcript parser hidden errors

When an error is encountered in a `unison :hide:all` block
When an error is encountered in a `unison :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` ucm :hide
scratch/main> builtins.merge
```

``` unison :hide:all
``` unison :hide-all
a : Nat
a =
b = 24
Expand Down
6 changes: 3 additions & 3 deletions unison-src/transcripts/errors/missing-result-typed.output.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### Transcript parser hidden errors

When an error is encountered in a `unison :hide:all` block
When an error is encountered in a `unison :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` ucm :hide
scratch/main> builtins.merge
```

``` unison :hide:all
``` unison :hide-all
a : Nat
a =
b = 24
Expand All @@ -18,7 +18,7 @@ a =

The transcript failed due to an error in the stanza above. The error is:

```
```
The last element of a block must be an expression, but this is a
definition:
Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/missing-result.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### Transcript parser hidden errors

When an error is encountered in a `unison :hide:all` block
When an error is encountered in a `unison :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all
``` unison :hide-all
x =
y = 24
```
6 changes: 3 additions & 3 deletions unison-src/transcripts/errors/missing-result.output.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### Transcript parser hidden errors

When an error is encountered in a `unison :hide:all` block
When an error is encountered in a `unison :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all
``` unison :hide-all
x =
y = 24
```
Expand All @@ -13,7 +13,7 @@ x =

The transcript failed due to an error in the stanza above. The error is:

```
```
The last element of a block must be an expression, but this is a
definition:
Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/ucm-hide-all-error.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Dangerous scary words!

When an expected error is not encountered in a `ucm :hide:all` block
When an expected error is not encountered in a `ucm :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` ucm :hide:all:error
``` ucm :hide-all :error
scratch/main> history
```
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/ucm-hide-all-error.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Dangerous scary words\!

When an expected error is not encountered in a `ucm :hide:all` block
When an expected error is not encountered in a `ucm :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` ucm :hide:all :error
``` ucm :hide-all :error
scratch/main> history
```

Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/ucm-hide-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Dangerous scary words!

When an error is encountered in a `ucm :hide:all` block
When an error is encountered in a `ucm :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` ucm :hide:all
``` ucm :hide-all
scratch/main> move.namespace foo bar
```
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/ucm-hide-all.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Dangerous scary words\!

When an error is encountered in a `ucm :hide:all` block
When an error is encountered in a `ucm :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` ucm :hide:all
``` ucm :hide-all
scratch/main> move.namespace foo bar
```

Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/unison-hide-all-error.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### Transcript parser hidden errors

When an expected error is not encountered in a `unison :hide:all:error` block
When an expected error is not encountered in a `unison :hide-all :error` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all:error
``` unison :hide-all :error
myVal = 3
```
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/unison-hide-all-error.output.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### Transcript parser hidden errors

When an expected error is not encountered in a `unison :hide:all:error` block
When an expected error is not encountered in a `unison :hide-all :error` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all :error
``` unison :hide-all :error
myVal = 3
```

Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/unison-hide-all.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### Transcript parser hidden errors

When an error is encountered in a `unison :hide:all` block
When an error is encountered in a `unison :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all
``` unison :hide-all
g 3
```
4 changes: 2 additions & 2 deletions unison-src/transcripts/errors/unison-hide-all.output.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### Transcript parser hidden errors

When an error is encountered in a `unison :hide:all` block
When an error is encountered in a `unison :hide-all` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all
``` unison :hide-all
g 3
```

Expand Down
2 changes: 1 addition & 1 deletion unison-src/transcripts/fix2840.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ scratch/main> builtins.merge

First, a few \[hidden] definitions necessary for typechecking a simple Doc2.

``` unison :hide:all
``` unison :hide-all
structural type Optional a = None | Some a
unique[b7a4fb87e34569319591130bf3ec6e24c9955b6a] type Doc2
Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts/hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ This works for `ucm` blocks as well.
scratch/main> rename.term x answerToUltimateQuestionOfLife
```

Doing `unison :hide:all` hides the block altogether, both input and output - this is useful for doing behind-the-scenes control of `ucm`'s state.
Doing `unison :hide-all` hides the block altogether, both input and output - this is useful for doing behind-the-scenes control of `ucm`'s state.

``` unison :hide:all
``` unison :hide-all
> [: you won't see me :]
```

Expand Down
2 changes: 1 addition & 1 deletion unison-src/transcripts/hello.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ This works for `ucm` blocks as well.
scratch/main> rename.term x answerToUltimateQuestionOfLife
```

Doing `unison :hide:all` hides the block altogether, both input and output - this is useful for doing behind-the-scenes control of `ucm`'s state.
Doing `unison :hide-all` hides the block altogether, both input and output - this is useful for doing behind-the-scenes control of `ucm`'s state.

## Expecting failures

Expand Down
6 changes: 3 additions & 3 deletions unison-src/transcripts/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ scratch/alice> delete.term Foo.Bar.Baz
scratch/alice> delete.term Foo.Bar.Qux
```

``` unison :hide:all
``` unison :hide-all
Foo.Bar.Baz : Nat
Foo.Bar.Baz = 100
Expand Down Expand Up @@ -1301,7 +1301,7 @@ Alice's branch:
scratch/main> branch alice
```

``` unison :hide:all
``` unison :hide-all
unique type Foo = Bar
```

Expand All @@ -1315,7 +1315,7 @@ Bob's branch:
scratch/main> branch bob
```

``` unison :hide:all
``` unison :hide-all
bob : Nat
bob = 101
```
Expand Down
2 changes: 1 addition & 1 deletion unison-src/transcripts/no-hash-in-term-declaration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There should not be hashes in the names used in term declarations, either in the type signature or the type definition.

``` unison :hide:all:error
``` unison :hide-all :error
x##Nat : Int -> Int -> Boolean
x##Nat = 5
```

0 comments on commit 523256c

Please sign in to comment.