LLINT(1)

NAME
llint - lint checker for Lunar Linux moonbase module files

SYNOPSIS
llint [flags] module-name
llint --path module-dir

DESCRIPTION
llint validates Lunar Linux moonbase module files (DETAILS, DEPENDS) for correctness. It checks variable alignment, required fields, date formats, heredoc formatting, and dependency declarations.

When given a module name, llint reads the lunar configuration to locate the module directory, checking zlocal sections first before falling back to the module index. When given a path with --path, it lints the directory directly without requiring lunar configuration.

OPTIONS

--fix
    Auto-fix fixable issues by rewriting files in-place.

--verbose
    Show what was fixed. Use with --fix.

--max-line-length N
    Maximum line length for heredoc text in DETAILS. Default: 80.

--path dir
    Lint a module directory directly, skipping config and index lookup. Useful in CI and GitHub Actions.

--version
    Print version, commit SHA, and build date.

DETAILS CHECKS

= alignment (fixable)
    All variable assignments must have = at the same column.

Special option placement (fixable)
    PSAFE, GARBAGE, ARCHIVE, KEEP_SOURCE, USE_WRAPPERS, COMPRESS_MANPAGES, KEEP_OBSOLETE_LIBS, LUNAR_RESTART_SERVICES, LDD_CHECK, and FUZZY must be flush-left after the main variable block.

Heredoc spacing (fixable)
    Exactly one blank line before cat << EOF and no extra blank lines after EOF.

Heredoc line length (fixable)
    Lines in the heredoc block must not exceed --max-line-length.

Duplicate assignments (partially fixable)
    Exact duplicates are auto-removed. Conflicting duplicates (different values) are errors.

Required fields
    MODULE, VERSION, SOURCE, WEB_SITE, ENTERED, UPDATED, and SHORT must be present.

Date validation
    ENTERED and UPDATED must be valid dates in yyyymmdd format, must not be in the future, and UPDATED must be >= ENTERED.

MODULE name
    The MODULE value must match the directory name (case-sensitive).

DEPENDS CHECKS

Allowed functions only
    Only depends, optional_depends, optional_depends_requires, and optional_depends_one_of are allowed.

No bash logic
    if, case, for, while, test expressions, variable assignments, and command substitutions are all errors.

EXIT STATUS

0   No errors found.

1   Lint errors found.

2   Usage error (bad arguments, missing config, module not found).

FILES

/etc/lunar/config
    Main lunar configuration file.

/etc/lunar/local/config
    Local configuration overlay.

EXAMPLES
Lint a module by name:

    llint zlib

Lint a module directory directly:

    llint --path /var/lib/lunar/moonbase/libs/zlib

Auto-fix issues with verbose output:

    llint --fix --verbose zlib

SEE ALSO
lunar(8)