Skip to content

Commit

Permalink
Merge pull request #1 from lefessan/z-2020-09-18-new-api
Browse files Browse the repository at this point in the history
api simplification
  • Loading branch information
lefessan committed Sep 21, 2020
2 parents 1efea97 + b2795f2 commit 352c9ad
Show file tree
Hide file tree
Showing 152 changed files with 15,432 additions and 12,989 deletions.
50 changes: 33 additions & 17 deletions .drom
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
# Keep this file in your GIT repo to help drom track generated files
ac2aab1d8f78befbbfca730668f71e8d .github/workflows/ci.ml
ecc81f6e7397d471ae02b1a8a2a79472 .github/workflows/workflow.yml
ad3289a3ff6fdac282e549432114f82b .gitignore
d41d8cd98f00b204e9800998ecf8427e .ocamlformat
5fcab669715b502c461f5156cb5cdffd .github/workflows/workflow.yml
82de7e58c3aa805a96aeb1d5e6afde97 .gitignore
be2d226b0dc658a425e86af1847a2316 .ocamlformat
5574462426a3706b11f5cbdbb0d4ad91 .ocamlformat-ignore
1281376e351d6c2be9ea4c576a29ebd4 .ocp-indent
7a038eccc259630a7aaa876eceb826ba CHANGES.md
bccf2d5b83a2ff0d2c284afea0d49e16 LICENSE.md
2ecfa2e801979053f133aa390b6b00a0 Makefile
6433d17c957a18520c87ee4be52fb9ea LICENSE.md
ad24f37c08af1e2e6de766c4b3e95f31 Makefile
b437ded55955d885b421f442f61f59bb README.md
d41d8cd98f00b204e9800998ecf8427e docs/.nojekyll
68b329da9893e34099c7d8ad5cb9c940 docs/.nojekyll
ed35af3f1c2d1d82a802ef41b86f5e66 docs/doc/index.html
c78c4051e699f3e0816b370bd5b26c58 docs/index.html
c0ab94dc41c82c7485de526b9f0ec5a2 docs/index.html
1e6c3e88922aed0893fc5d8e6f0e5b3e docs/sphinx/index.html
a95f1ab7d178b468eff6188a527535d9 docs/style.css
b1167bfb1bfcf1fcd7ee75d1642c5a05 drom.toml
1c801097a4f972113126747d760525a7 dune-project
6949ed8f885961a74050bfa2208a5e8a ez_file.opam
d41d8cd98f00b204e9800998ecf8427e sphinx/_static/css/fixes.css
f35a1e785f05124f2af11f8d4e62d4a7 drom.toml
79ebb54d58399284c3d3de4a2b331cae dune
3c5967c69a8f8ad7c82307c586384492 dune-project
e2e6943701ccc135fb723e1ac7a7c113 ez_file-deps.opam
31040ba3e1295f69a480cca7658c2cd3 ez_file.opam
68b329da9893e34099c7d8ad5cb9c940 sphinx/_static/css/fixes.css
0a65b84882d7bfac6dfd92446a14d397 sphinx/about.rst
7fc362a114a753ad223794b8224b6320 sphinx/conf.py
77fa1242b28f25053a536bad70222656 sphinx/index.rst
7a55c1afcb8550e133050638108c6244 sphinx/install.rst
86782b9deab3da02e4116e79f0390be6 sphinx/license.rst
cd7a86ab6edbdcf86ee543fbf40796bd src/dune
4245587cec9b76cbe6fe82cac1049d08 src/main.ml
af2008aeb131d1bd64e6335ab5ad1cd3 sphinx/conf.py
b3bd0932716c04312efef5609911c39f sphinx/index.rst
6a03117066bcb661598d9e3e5890ce4f sphinx/install.rst
fd5b8f08385c85bfec1e260941873854 sphinx/license.rst
de8d7df780a9c1c66bfc5d42b32510e2 src/dune
de8d7df780a9c1c66bfc5d42b32510e2 src/ez_file/dune
124b9ffb64e9285d0f81cd0de3328741 src/ez_file/index.mld
9aaf2b72b7f987b78a66b24ad041bae3 src/index.mld
120e66185a3783605be42112aab717d0 src/main.ml
608bdb1fe23e8d01fe656ffa9b139bdb src/version.ml
e2b4f39fcfb303f845699e550cb89a31 test/expect-tests/dune
734ed6b2b1cb8e0d6bce316d155bb157 test/expect-tests/test.ml
f83749a3827aaac58638994a6e6528d1 test/inline-tests/dune
e001d04969100c711855223ad6c23e6a test/inline-tests/test.ml
1c64bd7b595d50c839fca0ef7d70a1e5 test/output-tests/dune
f0ef7081e1539ac00ef5b761b4fb01b3 test/output-tests/test1.expected
894dddf3304cbcb0fe04f7c2bbd56073 test/output-tests/test2.expected
704ff05ffd8b0e50716542fa55b2db8a test/output-tests/test2.ml
46 changes: 31 additions & 15 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
name: Main Workflow

on:
- push
- pull_request
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build:
Expand All @@ -20,21 +24,26 @@ jobs:
- false

include:
- ocaml-version: 4.03.0
os: ubuntu-latest
- os: ubuntu-latest
ocaml-version: 4.07.0
skip_test: true

env:
SKIP_TEST: ${{ matrix.skip_test }}
OCAML_VERSION: ${{ matrix.ocaml-version }}
OS: ${{ matrix.os }}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Retrieve opam cache
uses: actions/cache@v2
id: cache-opam
with:
path: ~/.opam
key: v1-${{ runner.os }}-opam-${{ matrix.ocaml-version }}-${{ hashFiles('*.opam') }}
restore-keys: |
v1-${{ runner.os }}-opam-${{ matrix.ocaml-version }}-
- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v1
with:
Expand All @@ -45,17 +54,24 @@ jobs:
git config --global user.name github-actions
git config --global user.email github-actions-bot@users.noreply.github.com
- run: opam exec -- ocaml .github/workflows/ci.ml pin
- run: opam pin add . -y --no-action

- run: opam depext -y ez_file
if: steps.cache-opam.outputs.cache-hit != 'true'

- run: opam install -y ./*.opam --deps-only --with-test
if: steps.cache-opam.outputs.cache-hit != 'true'

- run: opam install ./ez_file.opam --deps-only --with-test
- run: opam upgrade --fixup
if: steps.cache-opam.outputs.cache-hit == 'true'

- run: opam exec -- make all
- run: opam exec -- dune build @install

- name: run test suite
run: opam exec -- ocaml .github/workflows/ci.ml test
if: env.SKIP_TEST != 'true'
run: opam exec -- dune build @runtest
if: matrix.skip_test != 'true'

- name: test source is well formatted
run: opam exec -- make fmt-check
run: opam exec -- dune build @fmt
continue-on-error: true
if: env.OCAML_VERSION == '4.10.0' && env.OS == 'ubuntu-latest'
if: matrix.ocaml-version == '4.10.0' && matrix.os == 'ubuntu-latest'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

/ez_file
*~
_build
.merlin
.vscode
/_drom
/_opam
/_build

14 changes: 14 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# profile=conventional
# margin=80
# parens-ite=true
# if-then-else=k-r
# parens-tuple=always
# type-decl=sparse
# space-around-collection-expressions=false
# break-cases=toplevel
# cases-exp-indent=2
# leading-nested-match-parens=true
# module-item-spacing=preserve
# doc-comments=after
# break-separators=after-and-docked
4 changes: 4 additions & 0 deletions .ocamlformat-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

vendor/*/*
vendor/*/*/*
vendor/*/*/*/*
131 changes: 131 additions & 0 deletions .ocp-indent
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@

# -*- conf -*-
# This is an example configuration file for ocp-indent
#
# Copy to the root of your project with name ".ocp-indent", customise, and
# transparently get consistent indentation on all your ocaml source files.

# Starting the configuration file with a preset ensures you won't fallback to
# definitions from "~/.ocp/ocp-indent.conf".
# These are `normal`, `apprentice` and `JaneStreet` and set different defaults.
normal

#
# INDENTATION VALUES
#

# Number of spaces used in all base cases, for example:
# let foo =
# ^^bar
base = 2

# Indent for type definitions:
# type t =
# ^^int
type = 2

# Indent after `let in` (unless followed by another `let`):
# let foo = () in
# ^^bar
in = 0

# Indent after `match/try with` or `function`:
# match foo with
# ^^| _ -> bar
with = 0

# Indent for clauses inside a pattern-match (after the arrow):
# match foo with
# | _ ->
# ^^^^bar
# the default is 2, which aligns the pattern and the expression
match_clause = 4 # this is non-default

# Indentation for items inside extension nodes:
# [%% id.id
# ^^^^contents ]
# [@@id
# ^^^^foo
# ]
ppx_stritem_ext = 2

# When nesting expressions on the same line, their indentation are in
# some cases stacked, so that it remains correct if you close them one
# at a line. This may lead to large indents in complex code though, so
# this parameter can be used to set a maximum value. Note that it only
# affects indentation after function arrows and opening parens at end
# of line.
#
# for example (left: `none`; right: `4`)
# let f = g (h (i (fun x -> # let f = g (h (i (fun x ->
# x) # x)
# ) # )
# ) # )
max_indent = 4


#
# INDENTATION TOGGLES
#

# Wether the `with` parameter should be applied even when in a sub-block.
# Can be `always`, `never` or `auto`.
# if `always`, there are no exceptions
# if `auto`, the `with` parameter is superseded when seen fit (most of the time,
# but not after `begin match` for example)
# if `never`, `with` is only applied if the match block starts a line.
#
# For example, the following is not indented if set to `always`:
# let f = function
# ^^| Foo -> bar
strict_with = never

# Controls indentation after the `else` keyword. `always` indents after the
# `else` keyword normally, like after `then`.
# If set to `never', the `else` keyword won't indent when followed by a newline.
# `auto` indents after `else` unless in a few "unclosable" cases (`let in`,
# `match`...).
#
# For example, with `strict_else=never`:
# if cond then
# foo
# else
# bar;
# baz
# `never` is discouraged if you may encounter code like this example,
# because it hides the scoping error (`baz` is always executed)
strict_else = always

# Ocp-indent will normally try to preserve your in-comment indentation, as long
# as it respects the left-margin or starts with `(*\n`. Setting this to `true`
# forces alignment within comments.
strict_comments = false

# Toggles preference of column-alignment over line indentation for most
# of the common operators and after mid-line opening parentheses.
#
# for example (left: `false'; right: `true')
# let f x = x # let f x = x
# + y # + y
align_ops = true

# Function parameters are normally indented one level from the line containing
# the function. This option can be used to have them align relative to the
# column of the function body instead.
# if set to `always`, always align below the function
# if `auto`, only do that when seen fit (mainly, after arrows)
# if `never`, no alignment whatsoever
#
# for example (left: `never`; right: `always or `auto)
# match foo with # match foo with
# | _ -> some_fun # | _ -> some_fun
# ^^parameter # ^^parameter
align_params = auto


#
# SYNTAX EXTENSIONS
#

# You can also add syntax extensions (as per the --syntax command-line option):
# syntax = mll lwt
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,4 @@ signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice

That's all there is to it!

24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@

.PHONY: all build-deps doc sphinx odoc view fmt fmt-check install dev-deps test
DEV_DEPS := merlin ocamlformat odoc
DEV_DEPS := merlin ocamlformat odoc ppx_expect ppx_inline_test

all: build

build:
dune build
opam exec -- dune build @install

build-deps:
opam install --deps-only ./ez_file.opam
if ! [ -e _opam ]; then \
opam switch create . --empty && \
opam install ocaml.4.10.0 ; \
fi
opam install ./*.opam --deps-only

sphinx:
sphinx-build sphinx docs/sphinx

doc:
dune build @doc
opam exec -- dune build @doc
rsync -auv --delete _build/default/_doc/_html/. docs/doc

view:
xdg-open file://$$(pwd)/docs/index.html

fmt:
dune build @fmt --auto-promote
opam exec -- dune build @fmt --auto-promote

fmt-check:
dune build @fmt
opam exec -- dune build @fmt

install:
dune install
opam exec -- dune install

opam:
opam pin -k path .

uninstall:
dune uninstall
opam exec -- dune uninstall

dev-deps:
opam install -y ${DEV_DEPS}
opam install ./*.opam --deps-only --with-doc --with-test

test:
dune build @runtest
opam exec -- dune build @runtest
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 3 additions & 1 deletion docs/doc/ez_file/EzFile/index.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/doc/ez_file/FileAbstract/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/doc/ez_file/FileChannel/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 352c9ad

Please sign in to comment.