summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2021-11-28 22:32:57 +0100
committerstuebinm2021-11-28 22:32:57 +0100
commitc71cf47ee509353af88223850a1bae4db5f3393d (patch)
treecc6e6c9d5119fe6260a609cab87a45e6837966f0
parent25ef5fb8233b65365fdd8da9e7ab7baf983fdb51 (diff)
update readme
-rw-r--r--Readme.md29
1 files 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
+ }
+
```