summaryrefslogtreecommitdiff
path: root/lib/LintWriter.hs (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-11-09first example of a map adjustmentstuebinm1-2/+9
this also includes some more monad plumbing, and an option for the linter to actually write things out again. Some of the previous commit was reverted a bit since it turned out to be stupid, but overall it was suprisingly easy once I got around to it, so yay! i guess Also includes a fairly silly example of how to use it.
2021-11-02monad plumbing to let the linter modify thingsstuebinm1-13/+23
I'm not sure if this is the right approach tbh — it lets the LintWriter monad modify its own context, but maybe we might run into cases where lints and modifications depend on each other across longer "distances" than just the context of the linter (i.e. just across a property?)
2021-10-30flipping the output map structurestuebinm1-1/+8
for now, just with layers. Instead of listing by layer (and giving lints multiple times), list by lint type (and list all layers in which this lint was applicable). This is a bit wonky for now, but readability of output is much better.
2021-09-30simple map-map link dependency checkingstuebinm1-0/+12
This is purely based on a set difference, i.e. it won't catch stupid things like a map linking to itself, a map link going only one-way, etc. Also, it only handles map links; it doesn't check if all ressource files referenced by a map actually exist.
2021-09-23prettier pretty printing and stuffstuebinm1-5/+11
also, configurable log level, which only required relaxing the type system once!
2021-09-20use PrettyPrinter morestuebinm1-3/+9
2021-09-20typechecking for path depths!stuebinm1-8/+20
This now checks if relative paths are still inside the repository, as a general safety mechanism to stop the linter from accidentally reading other things, as well as a nice hint for users.
2021-09-20rebuilding the core LintWriter monadstuebinm1-51/+29
it is no longer an Either since that wasn't used anyways, but is now also a Reader.
2021-09-20simple parsing of local dependency pathsstuebinm1-0/+1
2021-09-20lint embedded tilesetsstuebinm1-5/+2
2021-09-20lint general map propertiesstuebinm1-1/+12
2021-09-18collecting map dependenciesstuebinm1-2/+18
2021-09-18moved types into Types.hsstuebinm1-46/+2
it's almost as if there's some structure to this code!
2021-09-18can collect dependencies!stuebinm1-10/+37
There's now a Lint type, which may be either a "true lint" (which is a Hint, which contains some message and level of severity), or a Depends, which indicates that this map depends on some ressource or other (and is otherwise treated as a special info Hint in all other cases)
2021-09-18type check propertiesstuebinm1-2/+2
/finally/ figured out that all properties just look like {name, value, type} so now that's abstracted away and Properties.hs doesn't look like javascript anymore
2021-09-18tame the stringsstuebinm1-4/+6
Adds a PrettyPrint typeclass which operates on Text and should replace Show, since constantly converting strings from linked lists to arrays seems somewhat silly.
2021-09-17(somewhat) reasonable representation of parse errorsstuebinm1-4/+7
This makes map loading (and parsing) part of the linter, and also makes it return "general lints" and nothing else in case that failed. Possibly a sum type would be nicer here, but I guess it's not really important since everything ends up as json anyways?
2021-09-16input options, output jsonstuebinm1-12/+28
input options are mostly dummies for now, but some work (e.g. --inpath and --json). Lints can now be optionally printed as json to be reasonably machine-readable (and the json can be pretty-printed to make it human-readable again …).
2021-09-16moving lots of code aroundstuebinm1-0/+61
(also renaming things now that concepts seem a bit clearer)