Skip to content

Commit 54d7fdf

Browse files
committed
Extract configuration to goblint_config dune library
1 parent 1ac6baf commit 54d7fdf

15 files changed

Lines changed: 50 additions & 23 deletions

File tree

.github/workflows/options.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
run: npm install -g ajv-cli
2727

2828
- name: Migrate schema # https://github.com/ajv-validator/ajv-cli/issues/199
29-
run: ajv migrate -s src/common/util/options.schema.json
29+
run: ajv migrate -s src/config/options.schema.json
3030

3131
- name: Validate conf
32-
run: ajv validate -s src/common/util/options.schema.json -d "conf/**/*.json"
32+
run: ajv validate -s src/config/options.schema.json -d "conf/**/*.json"
3333

3434
- name: Validate incremental tests
35-
run: ajv validate -s src/common/util/options.schema.json -d "tests/incremental/*/*.json"
35+
run: ajv validate -s src/config/options.schema.json -d "tests/incremental/*/*.json"

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ build:
2020
- pip install json-schema-for-humans
2121
post_build:
2222
- mkdir _readthedocs/html/jsfh/
23-
- generate-schema-doc --config-file jsfh.yml src/common/util/options.schema.json _readthedocs/html/jsfh/
23+
- generate-schema-doc --config-file jsfh.yml src/config/options.schema.json _readthedocs/html/jsfh/

docs/user-guide/configuring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In `.vscode/settings.json` add the following:
2424
"/conf/*.json",
2525
"/tests/incremental/*/*.json"
2626
],
27-
"url": "/src/common/util/options.schema.json"
27+
"url": "/src/config/options.schema.json"
2828
}
2929
]
3030
}

src/common/common.mld

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ AnalysisState
1818
ControlSpecC
1919
}
2020

21-
{2 Configuration}
22-
{!modules:
23-
GobConfig
24-
AfterConfig
25-
JsonSchema
26-
Options
27-
}
28-
2921

3022
{1 Domains}
3123
{!modules:

src/common/dune

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,18 @@
88
batteries.unthreaded
99
zarith
1010
goblint_std
11+
goblint_config
1112
goblint_tracing
1213
goblint-cil
1314
fpath
1415
yojson
15-
json-data-encoding
16-
cpu
1716
goblint_timing
18-
goblint_build_info
19-
goblint.sites
2017
qcheck-core.runner)
2118
(flags :standard -open Goblint_std)
2219
(preprocess
2320
(pps
2421
ppx_deriving.std
2522
ppx_deriving_hash
26-
ppx_deriving_yojson
27-
ppx_blob))
28-
(preprocessor_deps (file util/options.schema.json)))
23+
ppx_deriving_yojson)))
2924

3025
(documentation)

src/config/config.mld

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{0 Library goblint.config}
2+
This library is unwrapped and provides the following top-level modules.
3+
For better context, see {!Goblint_lib} which also documents these modules.
4+
5+
6+
{1 Framework}
7+
8+
{2 Configuration}
9+
{!modules:
10+
GobConfig
11+
AfterConfig
12+
JsonSchema
13+
Options
14+
}

src/config/dune

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(include_subdirs unqualified)
2+
3+
(library
4+
(name goblint_config)
5+
(public_name goblint.config)
6+
(wrapped false) ; TODO: wrap
7+
(libraries
8+
batteries.unthreaded
9+
goblint_std
10+
goblint_tracing
11+
fpath
12+
yojson
13+
json-data-encoding
14+
cpu
15+
goblint.sites
16+
qcheck-core.runner)
17+
(flags :standard -open Goblint_std)
18+
(preprocess
19+
(pps
20+
ppx_blob))
21+
(preprocessor_deps (file options.schema.json)))
22+
23+
(documentation)

0 commit comments

Comments
 (0)