Skip to content

Scanner

asciilint.scanner

File discovery and scanning.

CharacterIssue dataclass

One disallowed character occurrence.

Discovery dataclass

File discovery result.

FileError dataclass

A file that could not be decoded or read.

FileFinding dataclass

Policy findings for one file.

truncated property

Return whether only a prefix of issues is stored.

IgnoreSource dataclass

Loaded ignore file and its compiled pathspec.

ScanResult dataclass

Complete scan result.

has_issues property

Return whether this scan should fail CI.

total_policy_issues property

Return the number of policy violations found.

discover_files(paths, *, base_dir, respect_gitignore, ignore_files)

Discover files and apply gitignore-style filters in batches.

is_text_file(path, *, bytes_to_read=None)

Classify a file as text or binary with the zlib txtvsbin algorithm.

relpath(path, base_dir)

Return a stable POSIX-style path relative to base_dir when possible.

scan(paths, *, base_dir, respect_gitignore, ignore_files, policy, max_issues_per_file, on_discovery=None, on_status=None)

Discover and scan text files.

scan_text_file(path, *, policy, max_issues_per_file)

Scan one UTF-8 text file for policy violations.