struct

Ignorelint::DockerignoreStyleLinter

Inherits Ignorelint::FormatLinter < Struct < Value < Object

The linter adapter for dockerignore files.

Dockerignore does NOT delegate to CommonGlob for all glob checks because its glob semantics differ from gitignore. Instead, it directly checks consecutive asterisks, malformed brackets, and invalid ** usage, then adds dockerignore-specific semantic checks.

Also overrides build_glob because dockerignore strips slashes before matching — unrooted and rooted patterns both match recursively.

Constructors

new

Instance methods

build_glob(pat : Pattern, base_dir : String) : String

Override the default glob builder: dockerignore strips leading/trailing slashes before matching, so rooted distinction does not exist — always use **/ prefix for dead-rule detection.

Without this override, a rooted pattern like /build would only check for ./build (missing matches at deeper levels).

check_pattern(pat : Pattern) : Array(Issue)

Check a single pattern for dockerignore-specific issues.

Performs structural glob checks directly (instead of delegating to CommonGlob) because dockerignore has subtly different ** semantics, then adds dockerignore-specific semantic checks.

check_patterns(patterns : Array(Pattern), issues : Array(Issue)) : Nil

Check the full pattern list for cross-pattern conflicts.

initialize