Namelint Usage

Command line Arguments

  • --ext - File extension filter, case-insensitive (repeatable)
  • --ext-ci - File extension filter, Unicode case-insensitive (repeatable)
  • --ext-cs - File extension filter, case-sensitive (repeatable)
  • --output - Output format for failures: plain or json
  • --skip-dir - Directory name to skip (repeatable)
  • --skip-file - File name to skip (repeatable)
  • --type - Entry type to validate: dir, file, or both
  • --verbose - Verbose output

Rules

--ascii-an - Only ASCII alphanumeric characters

Restricts filenames to ASCII letters and digits.

  • base: no dots — alphanumerics only in the full name
  • both: allows a single dot separating an alphanumeric stem from an alphanumeric extension
  • ext: allows multiple dot-separated alphanumeric segments
--ascii-and - Only ASCII alphanumeric and dash characters

Restricts filenames to ASCII letters, digits, and dashes.

  • base: no dots — alphanumerics only in the full name
  • both: allows a single dot separating an alphanumeric stem from an alphanumeric extension
  • ext: allows multiple dot-separated alphanumeric segments
--nfc - Filename must be NFC-normalized Unicode.

Ensures the filename is in Unicode NFC form.

This helps avoid visually identical names being stored with different byte representations across filesystems and tools.

--no-combining - Filename must not contain combining marks.

Rejects filenames that include Unicode combining marks.

Combining marks can make names hard to compare and reason about across terminals, shells, and filesystems.

--posix-portable - Only POSIX portable filename characters (A-Za-z0-9._-).

Restricts filenames to the POSIX Portable Filename Character Set: ASCII letters, digits, dot (.), underscore (_), and dash (-).

--trimmed - No leading or trailing whitespace.

Ensures filename components are properly trimmed.

  • base: Stem (first dot-separated segment) must be trimmed (no leading/trailing whitespace)
  • ext: Extension (last dot-separated segment) must be trimmed
  • both: Both stem and extension must be trimmed, and no whitespace immediately before periods
--url-component_safe - Only characters safe as a URL path/query component (A-Za-z0-9-_).

Restricts filenames to characters that are unambiguously safe as a URL path segment or query parameter value: ASCII letters, digits, hyphen (-), and underscore (_).

More restrictive than url_safe: excludes dot (.) to avoid path-traversal ambiguity and tilde (~) which some servers treat specially.

--url-safe - Only RFC 3986 unreserved characters (A-Za-z0-9-._~).

Restricts filenames to the RFC 3986 unreserved characters: ASCII letters, digits, hyphen (-), dot (.), underscore (_), and tilde (~).

These characters are safe anywhere in a URL without percent-encoding.

--whitespace - Control how internal whitespace is allowed in filenames.

Controls internal whitespace policy for filenames.

  • none: no internal whitespace allowed
  • space: allow single ASCII spaces only
  • spaces: allow one or more ASCII spaces
  • any: allow any internal whitespace