IBDecodable / IBLinter

A linter tool for Interface Builder
MIT License
948 stars 42 forks source link

New Dynamic fonts rule #143

Closed HonzaMac closed 3 years ago

HonzaMac commented 4 years ago

In our code base, we would like to encourage developers to use Dynamic Fonts (change size based on user preference).

This can be found in xib file as node: <fontDescription key="fontDescription" type="system" pointSize="15"/> can be replace by <fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>

Basically, when xib contains pointSize we should encourage to use Defined dynamic font size instead.

Does it make sense for IBLinter?

HonzaMac commented 4 years ago

FYI: There could be similar approach for custom swiftLint rule:

  dynamic_font_size:
    included: ".*.swift"
    name: "Prefer Dynamic fonts"
    message: "Please use dynamic preferred font styles instead of static system fonts"
    regex: '\.(italic|bold|monospaced|monospacedDigit)?[sS]ystemFont\('
    severity: warning
HonzaMac commented 3 years ago

I don't need it anymore.