Idempotent formatter and linter for Scheme, Emacs Lisp, and Common Lisp.
Project details
Sift provides an idempotent formatter and rule-based linter for Lisp dialects, ensuring that code is clean, consistent, and free of errors. It recognizes the nuances of Scheme, Emacs Lisp, and Common Lisp to deliver precise formatting while preserving original comments and structure, making code maintenance easier.
sift is an advanced formatter, linter, and language server designed for Scheme, Emacs Lisp, and Common Lisp programming environments. This tool highlights the intricacies of Lisp dialects through a dialect-aware approach that ensures the exact preservation of comments, blank lines, and formatting conventions across three specific dialects without compromising on functionality.
Idempotent Formatting: The formatting process is deterministic and idempotent, meaning that running the formatter on an already formatted file will leave it unchanged. The preserved Tree structures maintain the integrity of whitespace, comments, and reader macros, ensuring that all elements remain in their original locations.
Rule-Based Linting: sift excels at checking code quality by employing 92 distinct rules tailored to each dialect. Every rule comes equipped with a rationale, examples, and can be individually explained, allowing users to learn while they code. Warnings and suggestions are provided in a human-readable format, facilitating easy integration into existing workflows.
Language Server Protocol (LSP): As an LSP-compliant server, sift facilitates seamless integration across various editors, enabling features such as diagnostics, quick fixes, and code navigation, ensuring developers work efficiently with tools like Emacs and Neovim.
Here are some commands demonstrating the functionality of sift:
# Check a file for issues
sift check square.scm
# Format a file and write changes
sift format --write square.scm
# Lint a file to identify issues
sift lint small.scm
# Explain a specific linting rule
sift explain if-without-else
sift is built with community collaboration in mind, embracing an open-source MIT license to facilitate adoption and modification across various coding landscapes. Discover more about the intricacies of each function in the documentation included within the repository.
Comments
0Start the conversation
Share the first comment.