StyleCategory.h header
#include <ew/app/style/StyleCategory.h>
Namespace ew::app::style
Enumerations
enum class StyleCategory { Readability, Passive, CrutchWord, Repetition, Wordiness, Adverb, Cliche, Terminology }
The kind of writing issue a style rule reports. It groups diagnostics and drives how the editor colours them. New categories are additive; each maps to a stable lowercase token used for identification, configuration, and tests.
Functions
QString ew::app::style::ruleIdFor(StyleCategory category)
The rule id findings of category carry – "style/passive-voice".
One rule per category and one category per rule: the eight craft rules and the eight categories are the same eight things named twice. Deriving the id from the category means a rule and the findings it produces cannot come to disagree about which rule made them.
std::optional< StyleCategory > ew::app::style::styleCategoryForRuleId(QStringView ruleId)
The category ruleId names, or std::nullopt when it is not a style rule id.
std::optional< StyleCategory > ew::app::style::styleCategoryFromToken(QStringView token)
Parses a style category from its token; std::nullopt if unrecognized.
QString ew::app::style::toToken(StyleCategory category)
Returns the stable identification token for category (e.g. "passive").