Design#
The fundamental building block of Stylist is the “Rule.” Each rule implements a single check which the source code must pass.
Rules are collected into “Styles” allowing different sets of rules to be used for different purposes.
Source is presented either line-by-line as strings from the text file or as an abstract syntax tree, gained by parsing the source.
The line based SourceText
can come from either a file or a string buffer.
This text can have preprocessors applied to it using the decorator pattern.
Operation is orchestrated through the Engine
class. It makes use of a
factory class to create the correct source object from a file.
Sample operation is shown in the following sequence diagram: