Linting and validation utilities for MarkupKit integrated into Xcode.
mklint.sh
is a script which validates your project's MarkupKit XML files and reports any issues it finds right in Xcode's Issue Navigator, and highlights the actual offending line in the text editor. It makes use of Xcode's Build Phases to provide this integration.
In its current (most basic) form, mklint.sh
passes through to xmllint
and currenly only provides basic XML syntax checking.
cd ~/Developer/YourAwesomeApp/
You can use the following cURL snippet to do so in one line:
curl -O https://raw.githubusercontent.com/jarrroo/MarkupKitLint/master/Scripts/mklint.sh ; chmod +x mklint.sh
- Open the
Project Navigator
pane in Xcode (Cmd+1) & select your project - Open the
Build Phases
tab - Add a new
Run Script Phase
- Type the following command into the shell box:
./mklint.sh
Now, whenever you build your project, the linter will run and highlight any issues it finds right inside Xcode.
📣 Tracked by issue #1
xmllint
supports passing in an XML schema. This can be used to provide more in depth validation beyond simple XML syntax. Currently working on:
- Creating a basic schema which describes MarkupKit's default set of markup semantics, including knowledge of basic components (like
LMColumnView
,LMRowView
) and attributes (likespacing
,width
,height
). - Auto-generating schema from a running MarkupKit instance
Pie-in-the-sky:
- Augment the standard schema with the end user app's custom markup element types. This would provide compile-time validation of all MarkupKit markup.