add support for "description" (tagline) attribute

This commit is contained in:
Ryan Kulp
2026-07-30 16:02:18 -04:00
parent 12778db54f
commit ea1a38b505
4 changed files with 28 additions and 0 deletions
+2
View File
@@ -4,6 +4,7 @@ require_relative 'lint/check'
require_relative 'lint/source'
require_relative 'lint/checks/title_casing'
require_relative 'lint/checks/title_length'
require_relative 'lint/checks/description_length'
require_relative 'lint/checks/layouts_have_content'
require_relative 'lint/checks/no_async_functions'
require_relative 'lint/checks/waits_for_dom_load'
@@ -23,6 +24,7 @@ module TRMNLP
CHECKS = [
Checks::TitleCasing,
Checks::TitleLength,
Checks::DescriptionLength,
Checks::LayoutsHaveContent,
Checks::NoAsyncFunctions,
Checks::WaitsForDomLoad,
@@ -0,0 +1,24 @@
# frozen_string_literal: true
require_relative '../check'
module TRMNLP
module Lint
module Checks
# MAX_LENGTH mirrors Plugin::MAX_DESCRIPTION_LENGTH in the hosted
# service. Refresh it by hand when that constant changes, the same
# policy db/data/form_fields.yml documents.
#
# Only the length is checked — a description is optional, so an
# absent or empty one passes.
class DescriptionLength < Check
MAX_LENGTH = 35
MESSAGE = "Description should be <= #{MAX_LENGTH} characters long.".freeze
private
def pass? = source.plugin_description.length <= MAX_LENGTH
end
end
end
end
+1
View File
@@ -16,6 +16,7 @@ module TRMNLP
end
def plugin_name = settings['name'].to_s
def plugin_description = settings['description'].to_s
def settings = config.plugin.settings
def custom_field_values = config.project.custom_fields
def custom_field_definitions = config.plugin.custom_field_definitions
+1
View File
@@ -13,4 +13,5 @@ framework_version: latest
polling_url: ''
polling_headers: ''
name: My Plugin
description: ''
refresh_interval: 1440