Skip to content

Commit 647b5bf

Browse files
authored
Merge pull request #53 from cardano-scaling/formatting-spellcheck
Formatting & spell-checking
2 parents b8c2723 + 0e9a8a9 commit 647b5bf

File tree

37 files changed

+475
-303
lines changed

37 files changed

+475
-303
lines changed

.github/workflows/formatting.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Formating and spell-checking
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
10+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: false
14+
15+
jobs:
16+
treefmt:
17+
name: Formatting and spell-checking
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install nix
24+
uses: cachix/install-nix-action@V27
25+
with:
26+
extra_nix_config: |
27+
accept-flake-config = true
28+
log-lines = 1000
29+
30+
- name: Enter nix shell
31+
uses: nicknovitski/nix-develop@v1
32+
33+
- name: Run treefmt
34+
run: treefmt --ci

.github/workflows/link-check-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"retryOn429": true,
44
"retryCount": 5,
55
"fallbackRetryDelay": "30s",
6-
"aliveStatusCodes": [200, 206]
6+
"aliveStatusCodes": [200, 206, 403]
77
}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33

44
# Direnv cache
55
/.direnv/
6-
7-
# Trivial flake, no need to check in lock file
8-
/flake.lock

CONTRIBUTING.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Thank you for considering contributing and sharing your knowledge about the Cardano protocol in one capacity or another.
44

55
There are basically two ways to contribute:
6-
- Validate and provide feedback about existing blueprints
7-
- Create or update blueprints
6+
7+
- Validate and provide feedback about existing blueprints
8+
- Create or update blueprints
89

910
## Validate blueprints
1011

@@ -44,10 +45,10 @@ Thank you for contributing your changes by opening a pull request!
4445

4546
We do appreciate it if your pull request meets the following criteria:
4647

47-
+ **Description of the changes**: providing a clear summary of the changes is beneficial
48-
+ **Quality of changes**: ensure that new or updated automated tests validate your changes
49-
+ **Scope**: we prefer multiple pull requests that are well-scoped rather than a single large one
50-
+ **Correctness**: the pull request should pass the continuous integration (CI) pipeline.
48+
- **Description of the changes**: providing a clear summary of the changes is beneficial
49+
- **Quality of changes**: ensure that new or updated automated tests validate your changes
50+
- **Scope**: we prefer multiple pull requests that are well-scoped rather than a single large one
51+
- **Correctness**: the pull request should pass the continuous integration (CI) pipeline.
5152

5253
The project is currently in an expand-and-gather phase with no requirement of approvals, but consider requesting for reviews on Github-suggested reviewers.
5354

README.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ wide developer audience to understand the protocol and build Cardano components.
1414

1515
## Building
1616

17-
The blueprints are written using markdown and can be viewed
18-
[directly in Github](./src/introduction/README.md) or built into
19-
[the HTML site](https://cardano-scaling.github.io/cardano-blueprint)
20-
using [mdbook][mdbook].
17+
The blueprints are written using markdown and can be viewed [directly in
18+
Github](./src/introduction/README.md) or built into [the HTML
19+
site](https://cardano-scaling.github.io/cardano-blueprint) using [mdbook].
2120

2221
### With cargo
2322

24-
You can install [mdbook][mdbook] and the plugins we use with `cargo`:
23+
You can install [mdbook] and the plugins we use with `cargo`:
2524

2625
```shell
2726
cargo install mdbook mdbook-katex mdbook-mermaid mdbook-alerts mdbook-toc
@@ -47,16 +46,16 @@ cargo binstall mdbook mdbook-katex mdbook-mermaid mdbook-alerts mdbook-toc
4746

4847
### With nix
4948

50-
You can also use [nix][nix]:
49+
You can also use [nix]:
5150

5251
```shell
5352
nix build -o out
5453
```
5554

5655
## Editing
5756

58-
With [mdbook][mdbook] installed or inside a `nix develop` shell, you
59-
can live preview the result with:
57+
With [mdbook] installed or inside a `nix develop` shell, you can live preview
58+
the result with:
6059

6160
```shell
6261
mdbook serve --open
@@ -65,20 +64,39 @@ mdbook serve --open
6564
See the [mdbook manual][mdbook] or [github flavored markdown][gfm] for
6665
more information on what is available for editing.
6766

68-
[mdbook]: https://rust-lang.github.io/mdBook/index.html
69-
[gfm]: https://github.github.com/gfm/
70-
[nix]: https://nixos.org/download.html
67+
### Formatting & spell checking
68+
69+
We use `treefmt` that runs a few formatting and spell checking tools. This is
70+
also enforced through CI. See `formattingPkgs` in [`flake.nix`](./flake.nix) for
71+
a list of packages needed, then:
72+
73+
```shell
74+
treefmt
75+
```
7176

7277
## License
7378

74-
Cardano Blueprint created by [the Cardano Blueprint contributors](https://github.com/cardano-scaling/cardano-blueprint/graphs/contributors) is licensed under the [Apache 2.0 License](./LICENSE).
79+
Cardano Blueprint created by [the Cardano Blueprint
80+
contributors](https://github.com/cardano-scaling/cardano-blueprint/graphs/contributors)
81+
is licensed under the [Apache 2.0 License](./LICENSE).
7582

7683
## Logo
7784

78-
The [logo and wordmark](./logo/README.md) for the Cardano Blueprint was created by Roberto Nicolo, Sebastian Nagel and Input Output Global Ltd. Obviously, the design is derived from the official Cardano logo and we hereby accept and intend to follow the [official trademark policy](https://www.cardanofoundation.org/policy/trademark-policy). Cardano Blueprint is NOT registered as a trademark, nor shall it represent a commercial product, but any artifacts produced are covered under an open source [license](./LICENSE).
85+
The [logo and wordmark](./logo/README.md) for the Cardano Blueprint was created
86+
by Roberto Nicolo, Sebastian Nagel and Input Output Global Ltd. Obviously, the
87+
design is derived from the official Cardano logo and we hereby accept and intend
88+
to follow the [official trademark
89+
policy](https://www.cardanofoundation.org/policy/trademark-policy). Cardano
90+
Blueprint is NOT registered as a trademark, nor shall it represent a commercial
91+
product, but any artifacts produced are covered under an open source
92+
[license](./LICENSE).
7993

80-
---
94+
______________________________________________________________________
8195

8296
<p align="center">
8397
Thanks for visiting and hopefully the cardano blueprint is useful to you 💙!
8498
</p>
99+
100+
[gfm]: https://github.github.com/gfm/
101+
[mdbook]: https://rust-lang.github.io/mdBook/index.html
102+
[nix]: https://nixos.org/download.html

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,41 @@
1010
flake-utils.lib.eachSystem flake-utils.lib.defaultSystems (system:
1111
let
1212
pkgs = import nixpkgs { inherit system; };
13+
14+
formattingPkgs = with pkgs; [
15+
treefmt
16+
mdformat
17+
python3Packages.mdformat-footnote
18+
python3Packages.mdformat-gfm
19+
python3Packages.mdformat-myst # for latex math
20+
typos
21+
];
1322
in
1423
rec {
1524
inherit inputs;
1625
legacyPackages = pkgs;
17-
packages.mdbook =
18-
(
19-
pkgs.stdenv.mkDerivation {
20-
name = "cardano-blueprint-book";
21-
src = ./.;
22-
buildInputs = with pkgs; [
23-
mdbook
24-
mdbook-mermaid
25-
mdbook-katex
26-
mdbook-alerts
27-
mdbook-toc
28-
];
29-
phases = [ "unpackPhase" "buildPhase" ];
30-
buildPhase = ''
31-
mdbook build -d $out
32-
'';
33-
}
34-
);
26+
3527
defaultPackage = packages.mdbook;
28+
packages.mdbook = pkgs.stdenv.mkDerivation {
29+
name = "cardano-blueprint-book";
30+
src = ./.;
31+
buildInputs = with pkgs; [
32+
mdbook
33+
mdbook-mermaid
34+
mdbook-katex
35+
mdbook-alerts
36+
mdbook-toc
37+
];
38+
phases = [ "unpackPhase" "buildPhase" ];
39+
buildPhase = ''
40+
mdbook build -d $out
41+
'';
42+
};
43+
44+
devShells.default = pkgs.mkShell {
45+
inputsFrom = [ packages.mdbook ];
46+
buildInputs = formattingPkgs;
47+
};
3648
}
3749
);
3850
}

src/SUMMARY.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- [BlockFetch](network/node-to-node/blockfetch/README.md)
1010
- [TxSubmission2](network/node-to-node/txsubmission2/README.md)
1111
- [KeepAlive](network/node-to-node/keep-alive/README.md)
12-
- [PeerSharing]()
12+
- [PeerSharing](<>)
1313
- [Consensus](consensus/README.md)
1414
- [Chain validity](consensus/chainvalid.md)
1515
- [Chain selection](consensus/chainsel.md)
@@ -28,15 +28,15 @@
2828
- [Serialization](plutus/serialization.md)
2929
- [Client interfaces](client/README.md)
3030
- [NTC](client/node-to-client/README.md)
31-
- [Handshake]()
31+
- [Handshake](<>)
3232
- [LocalStateQuery](client/node-to-client/state-query/README.md)
33-
- [LocalTxSubmission]()
34-
- [TxMonitor]()
35-
- [LocalChainSync]()
33+
- [LocalTxSubmission](<>)
34+
- [TxMonitor](<>)
35+
- [LocalChainSync](<>)
3636
- [UTxO-RPC](client/utxo-rpc/README.md)
3737
- [Codec basics](codecs/README.md)
3838

39-
---
39+
______________________________________________________________________
4040

4141
- [Styleguide](styleguide.md)
4242
- [Contributing](CONTRIBUTING.md)

src/client/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ enabling this interaction:
1313
Below we present a table with clients and servers that implement each protocol:
1414

1515
| Server | NTC | UTxO RPC |
16-
|:---------------|-----|----------|
16+
| :------------- | --- | -------- |
1717
| [cardano-node] |||
1818
| [dingo] |||
1919
| [amaru] |||
2020

2121
<br/>
2222

2323
| Client | NTC | UTxO RPC |
24-
|:--------------|-----|----------|
24+
| :------------ | --- | -------- |
2525
| [cardano-cli] |||
2626
| [pallas] |||
2727
| [gouroboros] |||
@@ -30,9 +30,9 @@ Below we present a table with clients and servers that implement each protocol:
3030
>
3131
> Please help us keep this list up-to-date by [suggesting an edit](https://github.com/cardano-scaling/cardano-blueprint/edit/main/src/client/README.md).
3232
33-
[cardano-node]: https://github.com/IntersectMBO/cardano-node
33+
[amaru]: https://github.com/pragma-org/amaru/
3434
[cardano-cli]: https://github.com/IntersectMBO/cardano-cli
35+
[cardano-node]: https://github.com/IntersectMBO/cardano-node
3536
[dingo]: https://github.com/blinklabs-io/dingo
3637
[gouroboros]: https://github.com/blinklabs-io/gouroboros
37-
[amaru]: https://github.com/pragma-org/amaru/
3838
[pallas]: https://github.com/txpipe/pallas

src/client/node-to-client/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ In particular, these mini-protocols will also be wrapped by a
1111

1212
These mini-protocols are:
1313

14-
- [Handshake](): to negotiate the versions used in the connection,
15-
- [LocalTxSubmission](): to submit transactions to the network,
14+
- [Handshake](<>): to negotiate the versions used in the connection,
15+
- [LocalTxSubmission](<>): to submit transactions to the network,
1616
- [LocalStateQuery](state-query): to query for information about the ledger state,
17-
- [TxMonitor](): to monitor the status of transactions,
18-
- [LocalChainSync](): to retrieve chains of blocks from the node.
17+
- [TxMonitor](<>): to monitor the status of transactions,
18+
- [LocalChainSync](<>): to retrieve chains of blocks from the node.

0 commit comments

Comments
 (0)