proselint
repository·main·Indexed 26 days ago
https://github.com/amperser/proselintA linter for English prose that aggregates best practices from writers and editors to detect stylistic issues. It provides a command-line interface, a Python library, and a REST API for linting text, with support for custom JSON configurations and integration with tools like pre-commit and SublimeLinter.
What's inside proselint
- CodeMirror is a JavaScript component designed to provide a code editor within a web browser. It supports syntax highlighting (coloring code) when a language mode is available and provides optional assistance with indentation.
Overview of Proselint
mainProselint is a linter for prose designed to improve writing quality. It scans documents and analyzes them for stylistic issues, providing suggestions inspired by famous writers and editors (such as George Orwell, Strunk & White, and Bryan Garner). It acts similarly to a spell checker but focuses on best practices in writing, such as avoiding clichés, mixed metaphors, and redundancy.Understand Proselint terminology
mainWhen working with Proselint, use the following standard terminology:
- check: A lint rule (e.g.,
annotations.misc). - term: A word or phrase that Proselint flags or recommends a replacement for.
- term pair or entry: A set of two terms where one is flagged and the other is recommended.
- lint file: A document being analyzed by Proselint.
- check result: An individual suggestion from a check (lacks file context).
- lint result: An extension of a check result that includes contextual information about the lint file.
- check: A lint rule (e.g.,
Implement technical requirements for checks
mainTo maintain performance and organization, all new checks must follow these implementation rules:
- Batching: Checks containing more than 150 entries must be batched into chunks of 150.
- External Data Files: Checks with more than 50 entries must have their contents factored out into a separate CSV file. The CSV file must bear the same name as the last element of the check path.
Example: A check at
cliches.misc.write_goodshould have an associated file namedwrite-good(formatted as CSV).Run the Jekyll development server
mainStart the Jekyll server to preview the site locally. Use the
--watchoption to automatically update the generated HTML whenever you make changes to the source files. The site will be available atlocalhost:4000.$ jekyll serve --watchVerify Jekyll version requirement
mainThe proselint.com site uses Native Sass, which requires Jekyll version 2.0.0 or later. Verify your installation with the following command:
$ jekyll -vInstall proselint linter
mainInstall Jekyll for proselint.com
mainTo set up the local development environment for the proselint.com site, you must first install Jekyll using RubyGems.
$ gem install jekyllUse proselint with pre-commit
mainTo integrate
proselintinto yourpre-commitorprekworkflow, add the following configuration to your.pre-commit-config.yaml. Ensure you update therevto the desired git tag or revision.repos: - repo: https://github.com/amperser/proselint rev: v0.16.0 hooks: - id: proselintInstall SublimeLinter-contrib-proselint plugin
mainTo use proselint within Sublime Text, you must have SublimeLinter 4 installed. You can then install the proselint plugin via Package Control:
- Open the Command Palette in Sublime Text.
- Type
installand selectPackage Control: Install Package. - When the plugin list appears, type
proselint. - Select
SublimeLinter-contrib-proselintto install.
Install proselint
mainYou can install
proselintusingpip, or via system package managers depending on your operating system.Python (pip):
pip install proselintFedora:
sudo dnf install proselintDebian:
sudo apt install python3-proselintUbuntu:
sudo add-apt-repository universe sudo apt install python3-proselintNix (Declarative):
environment.systemPackages = [pkgs.proselint];Nix (Imperative):
nix profile install nixpkgs#proselintpip install proselintUse proselint with Sublime Text
mainA Sublime Text plugin forproselintis available via the main GitHub repository.