From c71cf47ee509353af88223850a1bae4db5f3393d Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 28 Nov 2021 22:32:57 +0100 Subject: update readme --- Readme.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index bd81bf7..ceb582b 100644 --- a/Readme.md +++ b/Readme.md @@ -82,14 +82,27 @@ For now there are two (useful) scopes: `map` applies to tiled map links By default `walint` prints lints in a hopefully human-readable manner. Its exit code will be 1 if the maximum lint level set in its config was exceeded, and 0 otherwise. Only in the latter case will it write out an adjusted map respository -to the path passed to `--out`. +to the path passed to `--out`. If the path given to `--out` already exists, +`walint` will print its normal output but refuse to write anything to that path, +and exit with code 2. If the `--json` option is given, output to stdout will be printed as json, which should conform to the following schema (here defined in a quasi-haskell syntax): ```haskell --- | The main type of walint's output -type Output = +-- | The main output type. All json output will conform to it. +type Output = + { severity :: Level + -- ^ the maximum Lint level that occurred + , result :: Result + -- ^ detailed lints in a structured way + , resultText :: String + -- ^ all lints in a human-readable text block + } + + +-- | A detailed description of which errors occurred +type Result = { mapLints :: Map FilePath MapLint -- ^ an object of per-map lints. Each key is a filepath from the repository's root , missingAssets :: List Asset @@ -116,7 +129,7 @@ type Where = -- ^ what is this lint's level? } --- | Valid lint levels. Encoded as strings, listed in order here. +-- | Valid lint levels. Encoded as strings, listed in ascending order here. data Level = Info | Suggestion | Warning | Forbidden | Error | Fatal @@ -136,5 +149,13 @@ type Entrypoint = -- ^ list of filenames of maps which reference this entrypoint } +-- | Lints that don't come grouped by place (for now, just those in generalLints) +type Lint = + { level :: Level + -- ^ this lint's level + , msg :: String + -- ^ a human-readable (single-line) message + } + ``` -- cgit v1.2.3