This is a clone of Erik Rimskog's repo for his master thesis at Uppsala Univeristy. The original repo is at Github. The report can be found on Diva.
This is my master thesis project for a linter for MiniZinc, project at libminizinc.
Each linting rule is a separate issue tagged with lint. This gives
each one a unique id and space for discussions on a specific rule.
Some are labeled with help wanted, which means I have a question or
have something I don't understand about a rule. Feel free to add more
linting rules and to comment with opinions.
Have something to discuss? Create an issue!
First, clone with all submodules using for example git clone --recurse-submodules. Then, inside the cloned folder, build with:
mkdir build
cd build
cmake ..
cmake --build .Build in parallel with -j <N> on the build step where N is the number of jobs.
There are some interesting flags that can be set on the generation step. For example cmake -DCMAKE_BUILD_TYPE=Debug ...
Here is a table of some of them:
| Variable | Default | Description |
|---|---|---|
| CMAKE_EXPORT_COMPILE_COMMANDS | NO | Export how each file got compiled, useful for ccls |
| CMAKE_BUILD_TYPE | Release | Whether to build with debug flags or release flags |
| CMAKE_POSITION_INDEPENDENT_CODE | NO | Whether to compile with -fPIC |
| LZN_FLAGS | NO | Use my preferred development flags |
The linter is run as:
./lzn some_model.mznThe linter currently expects the standard library to be in the same directory as the executable. A symlink to it can be added inside the build directory with:
ln -s ../deps/libminizinc/share .Unit tests to test all rules against small MiniZinc models are run with:
cmake --build . --target test