Current section

Files

Jump to
nldoc_validation lib nldoc validation rules no_underline.ex
Raw

lib/nldoc/validation/rules/no_underline.ex

defmodule NLdoc.Validation.Rules.NoUnderline do
@moduledoc """
This rule validates that the style underline was not used on a Text.
"""
alias NLdoc.Spec.{Link, Text}
alias NLdoc.Validation.Severity
use NLdoc.Validation.Rule,
severity: Severity.warning(),
rule: "no-underline",
ruleset: "https://validation.spec.nldoc.nl/",
# @TODO set `ruleset_version` to a real version
ruleset_version: "unknown",
validates: [Link, Text]
@impl true
def valid?(%{styling: styling}, _),
do: not Enum.member?(styling, :underline)
end