slug

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package slug provides shared slug-derivation helpers used across the SpecScore CLI. It is deliberately small and dependency-free so any artifact package (issue, idea, feature, …) can import it without cycling back through pkg/lint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IssueSlug

func IssueSlug(s string) string

IssueSlug derives the canonical slug for an `issue` artifact from a free-form one-liner. The algorithm:

  1. Lowercase the input (Unicode-aware via strings.ToLower).
  2. Replace every non-alphanumeric rune with `-`.
  3. Collapse consecutive `-` runs into a single `-`.
  4. Trim leading and trailing `-`.
  5. If the result exceeds 60 chars, truncate at the last `-` boundary at or before index 60 (exclusive of the `-`). If no `-` exists within the first 60 chars, hard-truncate at 60.

The truncation rule pins to the AC `cli/spec/lint/issue-rules#ac:slug-helper-truncation`.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL