$ show amperser/proselint
proselint is a linter for English prose that checks style, usage, and common writing errors based on authoritative references like Garner's Modern American Usage. It operates as a Python library with a command-line interface (CLI) and a FastAPI web service. The architecture is a monolith: text input is tokenized and matched against a registry of checks (existence, preferred forms, consistency, etc.) using a pluggable regex engine (RE2 or Python re). Results are output as structured JSON or formatted text. The project also includes editor plugins (Sublime Text, CodeMirror), a pre-commit hook, and a Jekyll-based documentation site. While the core linting logic is well-architected with a clean check type system and configurable thresholds, the repository carries significant technical debt from vendored third-party code (an old CodeMirror distribution) and several unmaintained editor plugins. The codebase is actively maintained with CI/CD across platforms and Python versions, but the outdated dependencies and legacy components introduce medium technical drift.
The LLM identified 2 files worth highlighting for reuse:
Provides an abstract regex engine with two implementations: Fast (using google-re2) and Fancy (Python re). Includes caching, pattern sets (MatchSet) for efficient multi-pattern matching, and padding strategies (RAW, WORDS_IN_TEXT, STRICT_WORDS_IN_TEXT). This component is isolated, well-documented, and could be extracted for any project needing configurable regex matching with word-boundary awareness.
Implements hierarchical configuration loading and merging from multiple sources (cwd, parent directories, XDG path). Supports per-file check configuration via glob patterns, dot-separated keys, and specificity sorting. The _deepmerge_dicts and _flatten_checks functions are reusable patterns for any application needing layered config with override semantics.