Skip to content

exercism/fsharp-analyzer

Repository files navigation

Exercism F# analyzer

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.

Analyzing a solution

To analyze a solution, follow these steps:

  1. Open a command prompt in the root directory.
  2. Run ./bin/run.sh <exercise> <source-directory> <output-directory>. This script will run the analyzer on the specified directory.
  3. Once the script has completed, the analysis results will be written to <output-directory>/analysis.json.

Analyzing a solution using Docker

To analyze a solution using a Docker container, follow these steps:

  1. Open a command prompt in the root directory.
  2. Run ./bin/run-in-docker.sh <exercise> <source-directory> <output-directory>. This script will:
    1. Build the analyzer Docker image (if necessary).
    2. Run the analyzer Docker image (as a container), passing the specified exercise, source-directory and output-directory arguments.
  3. 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.