Skip to content

Commit

Permalink
Merge pull request #207 (yfyf/ocaml-maintenance)
Browse files Browse the repository at this point in the history
#207

Manual merge because GitHub web UI fails with

    Merge attempt failed
    Merge already in progress

when trying to merge the PR.
  • Loading branch information
knuton committed Nov 28, 2024
2 parents 5937507 + 9535b67 commit a63df50
Show file tree
Hide file tree
Showing 83 changed files with 3,875 additions and 3,547 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dune fmt ocaml code
d67590d2cd504ed931e225834746f9e13b3a27fa
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,15 @@ jobs:
system-features = nixos-test benchmark big-parallel kvm
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: cd controller && nix-shell --run 'bin/test --force --no-buffer'

ocaml-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
system-features = nixos-test benchmark big-parallel kvm
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: cd controller && nix-shell --run 'dune build @fmt'
13 changes: 13 additions & 0 deletions controller/.ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version = 0.26.1

profile = ocamlformat

break-infix = wrap-or-vertical
doc-comments = before
field-space = loose
indicate-multiline-delimiters = closing-on-separate-line
space-around-arrays = true
space-around-lists = true
space-around-records = true
space-around-variants = true
type-decl = sparse
7 changes: 7 additions & 0 deletions controller/bin/watch-command
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail

AUTO_FORMAT=${AUTO_FORMAT:-}

cd $(dirname "$0")/..

clear

if [ ! -z "$AUTO_FORMAT" ]; then
dune fmt || true
fi

if bin/build; then

bin/stop-server || true
Expand Down
Loading

0 comments on commit a63df50

Please sign in to comment.