Skip to content

Commit

Permalink
Init from template
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin committed Feb 22, 2024
0 parents commit 4bcf41b
Show file tree
Hide file tree
Showing 19 changed files with 260 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Tell github that .ml and .mli files are OCaml
*.ml linguist-language=OCaml
*.mli linguist-language=OCaml

# Disable syntax detection for cram tests
*.t linguist-language=Text
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ci

on:
- pull_request
- push

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 5.1.x

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

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

- name: Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-repositories: |
default: https://github.com/ocaml/opam-repository.git
mbarbin: https://github.com/mbarbin/opam-repository.git
# janestreet-bleeding: https://ocaml.janestreet.com/opam-repository
# janestreet-bleeding-external: https://github.com/janestreet/opam-repository.git#external-packages

- name: Install dependencies
run:
opam install . --deps-only --with-doc --with-test

- name: Build
run: opam exec -- dune build

- name: Run tests
run: opam exec -- dune runtest

- name: Lint opam
uses: ocaml/setup-ocaml/lint-opam@v2

- name: Lint fmt
uses: ocaml/setup-ocaml/lint-fmt@v2

- name: Lint doc
uses: ocaml/setup-ocaml/lint-doc@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
2 changes: 2 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version=0.26.1
profile=janestreet
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cSpell.words": [
"janestreet",
"odoc",
"opam"
]
}
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## unreleased

### Added
### Changed
### Fixed
### Removed
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: all
all: build

.PHONY: build
build:
opam exec -- dune build

.PHONY: test
test:
opam exec -- dune runtest

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

.PHONY: lint
lint:
opam lint
opam exec -- opam-dune-lint

.PHONY: deps
deps:
opam install . --deps-only --with-doc --with-test

.PHONY: doc
doc:
opam exec -- dune build @doc

.PHONY: clean
clean:
opam exec -- dune clean

.PHONY: check-all
check-all: deps all test doc clean lint fmt
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# vcs

[![CI Status](https://github.com/mbarbin/vcs/workflows/ci/badge.svg)](https://github.com/mbarbin/vcs/actions/workflows/ci.yml)

## Code documentation

The code documentation of the latest release is built with `odoc` and published
to `GitHub` pages [here](https://mbarbin.github.io/vcs).
6 changes: 6 additions & 0 deletions bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(executable
(name main)
(public_name vcs)
(package vcs)
(flags :standard -w +a-4-40-41-42-44-45-48-66 -warn-error +a)
(libraries command-unix-for-opam vcs))
1 change: 1 addition & 0 deletions bin/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = Command_unix_for_opam.run Vcs.main
4 changes: 4 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(env
(dev
(odoc
(warnings fatal))))
48 changes: 48 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
(lang dune 3.14)

(name vcs)

(generate_opam_files)

(authors "Mathieu Barbin")

(maintainers "Mathieu Barbin")

(source
(github mbarbin/vcs))

(documentation "https://mbarbin.github.io/vcs/")

(package
(name vcs)
(synopsis "A collection of OCaml libraries defining interfaces and providers to interact with git repositories")
(depends
(ocaml
(>= 5.1))
(base
(and
(>= v0.16)
(< v0.17)))
(command-unix-for-opam
(>= 0.0.2))
(core
(and
(>= v0.16)
(< v0.17)))
(expect_test_helpers_core
(and
:with-test
(>= v0.16)
(< v0.17)))
(ppx_jane
(and
(>= v0.16)
(< v0.17)))
(ppx_js_style
(and
(>= v0.16)
(< v0.17)))
(stdio
(and
(>= v0.16)
(< v0.17)))))
16 changes: 16 additions & 0 deletions lib/vcs/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(library
(name vcs)
(public_name vcs)
(flags
:standard
-w
+a-4-40-41-42-44-45-48-66
-warn-error
+a
-open
Base
-open
Stdio)
(libraries base core.command stdio)
(preprocess
(pps ppx_jane ppx_js_style -check-doc-comments)))
10 changes: 10 additions & 0 deletions lib/vcs/src/vcs.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let hello_world = [%sexp "Hello, World!"]

let print_cmd =
Command.basic
~summary:"print hello world"
(let%map_open.Command () = return () in
fun () -> print_s hello_world)
;;

let main = Command.group ~summary:"" [ "print", print_cmd ]
2 changes: 2 additions & 0 deletions lib/vcs/src/vcs.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
val hello_world : Sexp.t
val main : Command.t
18 changes: 18 additions & 0 deletions lib/vcs/test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(library
(name vcs_test)
(flags
:standard
-w
+a-4-40-41-42-44-45-48-66
-warn-error
+a
-open
Base
-open
Stdio
-open
Expect_test_helpers_base)
(libraries base expect_test_helpers_core.expect_test_helpers_base stdio vcs)
(inline_tests)
(preprocess
(pps ppx_jane ppx_js_style -check-doc-comments)))
4 changes: 4 additions & 0 deletions lib/vcs/test/test__vcs.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let%expect_test "hello" =
print_s Vcs.hello_world;
[%expect {| "Hello, World!" |}]
;;
1 change: 1 addition & 0 deletions lib/vcs/test/test__vcs.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(*_ This signature is deliberately empty. *)
36 changes: 36 additions & 0 deletions vcs.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis:
"A collection of OCaml libraries defining interfaces and providers to interact with git repositories"
maintainer: ["Mathieu Barbin"]
authors: ["Mathieu Barbin"]
homepage: "https://github.com/mbarbin/vcs"
doc: "https://mbarbin.github.io/vcs/"
bug-reports: "https://github.com/mbarbin/vcs/issues"
depends: [
"dune" {>= "3.14"}
"ocaml" {>= "5.1"}
"base" {>= "v0.16" & < "v0.17"}
"command-unix-for-opam" {>= "0.0.2"}
"core" {>= "v0.16" & < "v0.17"}
"expect_test_helpers_core" {with-test & >= "v0.16" & < "v0.17"}
"ppx_jane" {>= "v0.16" & < "v0.17"}
"ppx_js_style" {>= "v0.16" & < "v0.17"}
"stdio" {>= "v0.16" & < "v0.17"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/mbarbin/vcs.git"

0 comments on commit 4bcf41b

Please sign in to comment.