Skip to content

Commit cf82c8c

Browse files
Enable prettier on docs markdown (#11875)
* Enable prettier on docs markdown * Run prettier always --------- Co-authored-by: Sergei Garin <[email protected]>
1 parent 1df9ea6 commit cf82c8c

21 files changed

+361
-319
lines changed

.github/workflows/gui-checks.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ jobs:
3131
node-version-file: .node-version
3232
cache: "pnpm"
3333

34-
- uses: actions/cache/restore@v4
35-
name: Download cache
36-
id: cache
37-
with:
38-
path: |
39-
**/.eslintcache
40-
node_modules/.cache/prettier
41-
key: ${{ runner.os }}-gui-${{ github.run_id }}
42-
restore-keys: |
43-
${{ runner.os }}-gui
44-
4534
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
4635
name: Installing wasm-pack
4736
uses: jetli/[email protected]
@@ -51,10 +40,15 @@ jobs:
5140
- name: 📦 Install dependencies
5241
run: pnpm install --frozen-lockfile
5342

54-
- name: 📝 Prettier
55-
id: prettier
56-
continue-on-error: true
57-
run: pnpm run ci:prettier
43+
- uses: actions/cache/restore@v4
44+
name: Download cache
45+
id: cache
46+
with:
47+
path: |
48+
**/.eslintcache
49+
key: ${{ runner.os }}-gui-${{ github.run_id }}
50+
restore-keys: |
51+
${{ runner.os }}-gui
5852
5953
# Next Tasks are depend on Typecheck, because we build libraries at this stage
6054
- name: 🧠 Typecheck
@@ -88,7 +82,6 @@ jobs:
8882
- name: ❌ Fail if any check failed
8983
if: always() && (steps.prettier.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.typecheck.outcome == 'failure' || steps.unit-tests.outcome == 'failure')
9084
run: |
91-
echo "Prettier outcome: ${{ steps.prettier.outcome }}"
9285
echo "Lint outcome: ${{ steps.lint.outcome }}"
9386
echo "Typecheck outcome: ${{ steps.typecheck.outcome }}"
9487
echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}"
@@ -102,7 +95,6 @@ jobs:
10295
key: ${{ steps.cache.outputs.cache-primary-key }}
10396
path: |
10497
**/.eslintcache
105-
node_modules/.cache/prettier
10698
10799
playwright:
108100
name: 🎭 Playwright Tests

.github/workflows/gui-pull-request.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,52 @@ jobs:
5858
echo "$file was changed"
5959
done
6060
61+
prettier:
62+
name: 🧹 Prettier
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: 📦 Setup pnpm
68+
uses: pnpm/action-setup@v4
69+
70+
- uses: actions/setup-node@v4
71+
name: ⎔ Setup Node
72+
with:
73+
node-version-file: .node-version
74+
cache: "pnpm"
75+
76+
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
77+
name: Installing wasm-pack
78+
uses: jetli/[email protected]
79+
with:
80+
version: v0.12.1
81+
82+
- name: 📦 Install dependencies
83+
run: pnpm install --frozen-lockfile --ignore-scripts
84+
85+
- uses: actions/cache/restore@v4
86+
name: Download cache
87+
id: cache
88+
with:
89+
path: |
90+
node_modules/.cache/prettier
91+
key: ${{ runner.os }}-gui-${{ github.run_id }}
92+
restore-keys: |
93+
${{ runner.os }}-gui
94+
95+
- name: Run prettier
96+
run: pnpm run ci:prettier
97+
98+
- name: 💾 Save cache
99+
uses: actions/cache/save@v4
100+
if: always() && steps.cache.outputs.cache-hit != 'true'
101+
id: save-cache
102+
with:
103+
key: ${{ steps.cache.outputs.cache-primary-key }}
104+
path: |
105+
node_modules/.cache/prettier
106+
61107
checks:
62108
name: 🧰 Checks
63109
uses: ./.github/workflows/gui-checks.yml

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ distribution/lib/Standard/*/*/manifest.yaml
1616
distribution/lib/Standard/*/*/polyglot
1717
distribution/lib/Standard/*/*/THIRD-PARTY
1818
distribution/docs-js
19-
docs/**/*.md
2019

2120
built-distribution/
2221
THIRD-PARTY

docs/semantics/errors.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ users to deal with errors at runtime in the language.
2020

2121
## Asynchronous Exceptions
2222

23-
> [!WARNING]
24-
> The actionables for this section are:
23+
> [!WARNING] The actionables for this section are:
2524
>
2625
> - Why do we call it asynchronous, when they are synchronous!?
2726
> - Specify the semantics of Enso's async exceptions.
@@ -32,19 +31,16 @@ There is a special [dynamic dispatch](../types/dynamic-dispatch.md) for `Error`
3231
values. A dataflow error dispatch first checks if it may call a method on
3332
`Error` type.
3433

35-
> [!WARNING]
36-
> The actionables for this section are:
34+
> [!WARNING] The actionables for this section are:
3735
>
3836
> - Specify the semantics of Enso's broken values.
3937
4038
## Warnings
4139

42-
> [!WARNING]
43-
> TODO
40+
> [!WARNING] TODO
4441
>
4542
> - Values in Enso may have warnings attached
4643
4744
There is a special [dynamic dispatch](../types/dynamic-dispatch.md) for _values
48-
with warnings_. Before we pass the dispatch to the underlying value,
49-
we check if warning has a method 'overridden' - this is used for `remove_warnings`,
50-
etc.
45+
with warnings_. Before we pass the dispatch to the underlying value, we check if
46+
warning has a method 'overridden' - this is used for `remove_warnings`, etc.

docs/syntax/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ The various components of Enso's syntax are described below:
4343
- [**Functions:**](./functions.md) The syntax for writing functions in Enso.
4444
- [**Function Arguments:**](./function-arguments.md) The syntax for function
4545
arguments in Enso.
46-
- [**Conversions:**](./conversions.md) The syntax of special _conversion functions_ in Enso.
46+
- [**Conversions:**](./conversions.md) The syntax of special _conversion
47+
functions_ in Enso.
4748
- [**Field Access:**](./projections.md) The syntax for working with fields of
4849
data types in Enso.
4950
- [**Comments:**](./comments.md) The syntax for writing comments in Enso.

docs/syntax/conversions.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,36 @@ order: 10
88

99
# Conversions
1010

11-
Conversions are special [functions](./functions.md) associated with a [type](../types/hierarchy.md),
12-
named `from` and taking single `that` argument. Following example:
11+
Conversions are special [functions](./functions.md) associated with a
12+
[type](../types/hierarchy.md), named `from` and taking single `that` argument.
13+
Following example:
14+
1315
```ruby
1416
type Complex
1517
Num re:Float im:Float
1618

1719
Complex.from (that:Float) = Complex.Num that 0
1820
```
19-
defines type `Complex` and a **conversion** from `Float` which uses the provided `Float` value as
20-
real part of a complex number while setting the imaginary part to zero.
21+
22+
defines type `Complex` and a **conversion** from `Float` which uses the provided
23+
`Float` value as real part of a complex number while setting the imaginary part
24+
to zero.
2125

2226
## Type Checks
2327

24-
Conversions are integral part of [type checking](../types/inference-and-checking.md#type-checking-algorithm)
28+
Conversions are integral part of
29+
[type checking](../types/inference-and-checking.md#type-checking-algorithm)
2530
during runtime. Having the right conversion in scope one can write:
31+
2632
```ruby
2733
complex_pi = 3.14:Complex
2834
```
29-
to create a new instance of type `Complex`. The Enso runtime represents
30-
the `3.14` literal as `Float` value and that would fail the `Complex` type check if there was no
31-
conversion method available. However as there is one, the runtime uses `Complex.from` behind the
32-
scene and `complex_pi` then becomes `Complex.Num 3.14 0` value.
3335

34-
Type checks may perform no, one or multiple conversions (like in case of
36+
to create a new instance of type `Complex`. The Enso runtime represents the
37+
`3.14` literal as `Float` value and that would fail the `Complex` type check if
38+
there was no conversion method available. However as there is one, the runtime
39+
uses `Complex.from` behind the scene and `complex_pi` then becomes
40+
`Complex.Num 3.14 0` value.
41+
42+
Type checks may perform no, one or multiple conversions (like in case of
3543
[intersection types](../types/intersection-types.md)).

docs/types/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ instrumental for ensuring that we build the right language.
3939
> described in the [syntax](../syntax/README.md) document makes no promises as
4040
> to whether said syntax will be exposed in the surface language.
4141
42-
> [!WARNING]
43-
> The specification in this section is very outdated and far from
42+
> [!WARNING] The specification in this section is very outdated and far from
4443
> reality. Sections that are known to be _"off"_ are marked as _warning_.
4544
4645
Information on the type system is broken up into the following sections:

docs/types/access-modifiers.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ order: 4
88

99
# Access Modifiers
1010

11-
> [!WARNING]
12-
> Everybody who ever maintained a large system knows [encapsulation is essential](../semantics/encapsulation.md).
11+
> [!WARNING] Everybody who ever maintained a large system knows
12+
> [encapsulation is essential](../semantics/encapsulation.md).
1313
>
14-
> While we don't usually like making things private in a programming language, it
15-
> sometimes the case that it is necessary to indicate that certain fields should
16-
> not be touched (as this might break invariants and such like). To this end, Enso
17-
> provides an explicit mechanism for access modification.
14+
> While we don't usually like making things private in a programming language,
15+
> it sometimes the case that it is necessary to indicate that certain fields
16+
> should not be touched (as this might break invariants and such like). To this
17+
> end, Enso provides an explicit mechanism for access modification.
1818
1919
Enso targets large user base of _non-programmers_. They are mostly focused on
20-
getting their job done and [encapsulation](../semantics/encapsulation.md) of their own code is the last thing
21-
that comes to their mind.
20+
getting their job done and [encapsulation](../semantics/encapsulation.md) of
21+
their own code is the last thing that comes to their mind.
2222

23-
On the other hand, Enso supports and encourages creation of *sharable libraries*.
24-
Maintainers of such libraries are likely to treat API design and its
25-
backward compatibility seriously. As such they need a way to [encapsulate](../semantics/encapsulation.md)
26-
internals of their libraries and clearly *differentiate public API* and
27-
implementations details.
23+
On the other hand, Enso supports and encourages creation of _sharable
24+
libraries_. Maintainers of such libraries are likely to treat API design and its
25+
backward compatibility seriously. As such they need a way to
26+
[encapsulate](../semantics/encapsulation.md) internals of their libraries and
27+
clearly _differentiate public API_ and implementations details.
2828

2929
<!-- MarkdownTOC levels="2,3" autolink="true" -->
3030

@@ -35,27 +35,26 @@ implementations details.
3535

3636
## Access Modification
3737

38-
*By default* Enso elements (functions, types, methods) are *public*.
39-
One has to use an access modifier to hide and [encapsulate](../semantics/encapsulation.md) them. The
40-
reasoning is: those who don't care can access everything they create without
41-
any restriction. Those who care can make things `private` with an additional
42-
effort.
38+
_By default_ Enso elements (functions, types, methods) are _public_. One has to
39+
use an access modifier to hide and [encapsulate](../semantics/encapsulation.md)
40+
them. The reasoning is: those who don't care can access everything they create
41+
without any restriction. Those who care can make things `private` with an
42+
additional effort.
4343

44+
Accessing any member under an access modifier is an error when performed from
45+
another project. Such a check is enforced during runtime.
4446

45-
Accessing any member under an access modifier is an error when performed from another project.
46-
Such a check is enforced during runtime.
47-
48-
There is a command line switch to _disable access modifier check_.
49-
It maybe be useful for experimentation. However the general suggestion is:
50-
Avoid using it in production.
47+
There is a command line switch to _disable access modifier check_. It maybe be
48+
useful for experimentation. However the general suggestion is: Avoid using it in
49+
production.
5150

5251
## Private
5352

5453
Encapsulation is an effective _communication mechanism_ among _distributed
55-
groups_ of developers. The `private` modifier hides implementation details from clients of the API.
56-
The primary groups in the Enso case are those who *publish a library*
57-
and those who *consume such a library*.
54+
groups_ of developers. The `private` modifier hides implementation details from
55+
clients of the API. The primary groups in the Enso case are those who _publish a
56+
library_ and those who _consume such a library_.
5857

59-
As such Enso supports _library private_ encapsulation.
60-
To hide any element (module, type, constructor, function) away
61-
from *library consumers* prefix such an element with `private` keyword.
58+
As such Enso supports _library private_ encapsulation. To hide any element
59+
(module, type, constructor, function) away from _library consumers_ prefix such
60+
an element with `private` keyword.

0 commit comments

Comments
 (0)