An analyzer can automatically detect issues with submissions and comment on them.
The F# analyzer implements the analyzer interface. It uses the F# Compiler service to parse the submission's source code into syntax trees, which are then analyzed for known patterns.
To analyze a solution, follow these steps:
- Open a command prompt in the root directory.
- Run
./bin/run.sh <exercise> <source-directory> <output-directory>
. This script will run the analyzer on the specified directory. - Once the script has completed, the analysis results will be written to
<output-directory>/analysis.json
.
To analyze a solution using a Docker container, follow these steps:
- Open a command prompt in the root directory.
- Run
./bin/run-in-docker.sh <exercise> <source-directory> <output-directory>
. This script will:- Build the analyzer Docker image (if necessary).
- Run the analyzer Docker image (as a container), passing the specified
exercise
,source-directory
andoutput-directory
arguments.
- Once the script has completed, the analysis result can be found at
<output-directory>/analysis.json
.
Note that the Docker image is built using the .NET IL Linker, which is why building can be quite slow.