Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.1
2 Name: proselint
3 Version: 0.14.0
4 Summary: A linter for prose.
5 Home-page: https://proselint.com
6 License: BSD-3-Clause
7 Author: Amperser Labs
8 Author-email: [email protected]
9 Requires-Python: >=3.8.1,<4.0.0
10 Classifier: License :: OSI Approved :: BSD License
11 Classifier: Programming Language :: Python :: 3
12 Classifier: Programming Language :: Python :: 3.9
13 Classifier: Programming Language :: Python :: 3.10
14 Classifier: Programming Language :: Python :: 3.11
15 Classifier: Programming Language :: Python :: 3.12
16 Classifier: Programming Language :: Python :: Implementation :: CPython
17 Requires-Dist: click (>=8.0.0,<9.0.0)
18 Project-URL: Repository, https://github.com/amperser/proselint
19 Description-Content-Type: text/markdown
20
21 <img src="https://raw.githubusercontent.com/amperser/proselint/main/logo.png" alt="proselint logo" width="200">
22
23 ![Workflow status](https://github.com/amperser/proselint/actions/workflows/ci-lint-test.yml/badge.svg)
24 [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
25 [![Code Climate](https://codeclimate.com/repos/5538989ee30ba0793100090f/badges/e10a2fe18a9256d69e2a/gpa.svg)](https://codeclimate.com/repos/5538989ee30ba0793100090f/feed)
26 [![codecov](https://codecov.io/gh/amperser/proselint/branch/main/graph/badge.svg?token=8E0I9sRpot)](https://codecov.io/gh/amperser/proselint)
27 [![License](https://img.shields.io/badge/License-BSD-blue.svg)](https://en.wikipedia.org/wiki/BSD_licenses)
28
29 Writing is notoriously hard, even for the best writers, and it's not for lack of good advice — a tremendous amount of knowledge about the craft is strewn across usage guides, dictionaries, technical manuals, essays, pamphlets, websites, and the hearts and minds of great authors and editors. But poring over Strunk & White hardly makes one a better writer — it turns you into neither Strunk nor White. And nobody has the capacity to apply all the advice from *Garner’s Modern English Usage*, an 1100-page usage guide, to everything they write. In fact, the whole notion that one becomes a better writer by reading advice on writing rests on untenable assumptions about learning and memory. The traditional formats of knowledge about writing are thus essentially inert, waiting to be transformed.
30
31 We devised a simple solution: `proselint`, a linter for English prose. A linter is a computer program that, akin to a spell checker, scans through a file and detects issues — like how a real lint roller helps you get unwanted lint off of your shirt.
32
33 `proselint` places the world's greatest writers and editors by your side, where they whisper suggestions on how to improve your prose. You’ll be guided by advice inspired by Bryan Garner, David Foster Wallace, Chuck Palahniuk, Steve Pinker, Mary Norris, Mark Twain, Elmore Leonard, George Orwell, Matthew Butterick, William Strunk, Elwyn White, Philip Corbett, Ernest Gowers, and the editorial staff of the world’s finest literary magazines and newspapers, among others. Our goal is to aggregate knowledge about best practices in writing and to make that knowledge immediately accessible to all authors in the form of a linter for prose; all in a neat command-line utility that you can integrate into other tools, scripts, and workflows.
34
35 ### Installation
36
37 To get this up and running, install it using [pip]:
38
39 ```bash
40 pip install proselint
41 ```
42
43 [pip]: https://packaging.python.org/installing/#use-pip-for-installing
44
45 #### Fedora
46
47 ```bash
48 sudo dnf install proselint
49 ```
50
51 #### Debian
52
53 ```bash
54 sudo apt install python3-proselint
55 ```
56
57 #### Ubuntu
58
59 ```bash
60 sudo add-apt-repository universe
61 sudo apt install python3-proselint
62 ```
63
64 ### Plugins for other software
65
66 `proselint` is available on:
67
68 - A [demo editor](http://proselint.com/write)
69 - [Sublime Text](https://github.com/amperser/proselint/tree/main/plugins/sublime/SublimeLinter-contrib-proselint)
70 - [Atom Editor](https://github.com/smockle/linter-proselint) (thanks to [Clay Miller](https://github.com/smockle)).
71 - Emacs via [Flycheck](http://www.flycheck.org/) or via [Flymake](https://sr.ht/~manuel-uberti/flymake-proselint/)
72 - Vim via [ALE](https://github.com/w0rp/ale) or [Syntastic](https://github.com/vim-syntastic/syntastic) (thanks to @lcd047, @Carreau, and [Daniel M. Capella](https://github.com/polyzen))
73 - Neovim via [null-ls](https://github.com/jose-elias-alvarez/null-ls.nvim) (null-ls has [diagnostics](https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/lua/null-ls/builtins/diagnostics/proselint.lua) and [code actions](https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/lua/null-ls/builtins/code_actions/proselint.lua) for proselint)
74 - [Phabricator's `arc` CLI](https://github.com/google/arc-proselint) (thanks to [Jeff Verkoeyen](https://github.com/jverkoey))
75 - [Danger](https://github.com/dbgrandi/danger-prose) (thanks to [David Grandinetti](https://github.com/dbgrandi) and [Orta Therox](https://github.com/orta))
76 - [Visual Studio Code](https://github.com/ppeszko/vscode-proselint) (thanks to [Patryk Peszko](https://github.com/ppeszko))
77 - [coala](https://github.com/coala-analyzer/bear-docs/blob/master/docs/ProseLintBear.rst) (thanks to the [coala Development Group](https://github.com/coala-analyzer))
78 - [IntelliJ](https://github.com/kropp/intellij-proselint) (by [Victor Kropp](https://github.com/kropp))
79 - [pre-commit](https://pre-commit.com/) (by [Andy Airey](https://github.com/aairey))
80 - [Statick](https://github.com/sscpac/statick-md)
81 - [MegaLinter](https://oxsecurity.github.io/megalinter/latest/descriptors/spell_proselint/)
82
83 ### Usage
84
85 Suppose you have a document `text.md` with the following text:
86
87 ```
88 John is very unique.
89 ```
90
91 You can run `proselint` over the document using the command line:
92
93 ```bash
94 proselint text.md
95 ```
96
97 This prints a list of suggestions to stdout, one per line. Each suggestion has the form:
98
99 ```bash
100 text.md:<line>:<column>: <check_name> <message>
101 ```
102
103 For example,
104
105 ```bash
106 text.md:0:10: wallace.uncomparables Comparison of an uncomparable: 'unique' cannot be compared.
107 ```
108
109 The command-line utility can also print suggestions in JSON using the `--json` flag. In this case, the output is considerably richer:
110
111 ```jsonc
112 {
113 // Type of check that output this suggestion.
114 check: "wallace.uncomparables",
115
116 // Message to describe the suggestion.
117 message: "Comparison of an uncomparable: 'unique' cannot be compared.",
118
119 // The person or organization giving the suggestion.
120 source: "David Foster Wallace"
121
122 // URL pointing to the source material.
123 source_url: "http://www.telegraph.co.uk/a/9715551"
124
125 // Line where the error starts.
126 line: 0,
127
128 // Column where the error starts.
129 column: 10,
130
131 // Index in the text where the error starts.
132 start: 10,
133
134 // Index in the text where the error ends.
135 end: 21,
136
137 // length from start -> end
138 extent: 11,
139
140 // How important is this? Can be "suggestion", "warning", or "error".
141 severity: "warning",
142
143 // Possible replacements.
144 replacements: [
145 {
146 value: "unique"
147 }
148 ]
149 }
150 ```
151
152 To run the linter as part of another Python program, you can use the `lint` function in `proselint.tools`:
153
154 ```python
155 import proselint
156
157 suggestions = proselint.tools.lint("This sentence is very unique")
158 ```
159
160 This will return a list of suggestions:
161
162 ```python
163 [('weasel_words.very', "Substitute 'damn' every time you're inclined to write 'very;' your editor will delete it and the writing will be just as it should be.", 0, 17, 17, 22, 5, 'warning', None), ('uncomparables.misc', "Comparison of an uncomparable: 'very unique.' is not comparable.", 0, 17, 17, 29, 12, 'warning', None)]
164 ```
165
166 ### Checks
167
168 You can disable any of the checks by modifying `$XDG_CONFIG_HOME/proselint/config.json`.
169 If `$XDG_CONFIG_HOME` is not set or empty, `~/.config/proselint/config.json` will be used.
170 Additionally, for compatibility reasons, the legacy configurations `~/.proselintrc` and `$XDG_CONFIG_HOME/proselint/config` will be checked if `$XDG_CONFIG_HOME/proselint/config.json` does not exist.
171
172 ```json
173 {
174 "checks": {
175 "typography.diacritical_marks": false
176 }
177 }
178 ```
179
180 | ID | Description |
181 | ----- | --------------- |
182 | `airlinese.misc` | Avoiding jargon of the airline industry |
183 | `annotations.misc` | Catching annotations left in the text |
184 | `archaism.misc` | Avoiding archaic forms |
185 | `cliches.hell` | Avoiding a common cliché |
186 | `cliches.misc` | Avoiding clichés |
187 | `consistency.spacing` | Consistent sentence spacing |
188 | `consistency.spelling` | Consistent spelling |
189 | `corporate_speak.misc` | Avoiding corporate buzzwords |
190 | `cursing.filth` | Words to avoid |
191 | `cursing.nfl` | Avoiding words banned by the NFL |
192 | `dates_times.am_pm` | Using the right form for the time of day |
193 | `dates_times.dates` | Stylish formatting of dates |
194 | `hedging.misc` | Not hedging |
195 | `hyperbole.misc` | Not being hyperbolic |
196 | `jargon.misc` | Avoiding miscellaneous jargon |
197 | `lgbtq.offensive_terms` | Avoding offensive LGBTQ terms |
198 | `lgbtq.terms` | Misused LGBTQ terms |
199 | `lexical_illusions.misc` | Avoiding lexical illusions |
200 | `links.broken` | Linking only to existing sites |
201 | `malapropisms.misc` | Avoiding common malapropisms |
202 | `misc.apologizing` | Being confident |
203 | `misc.back_formations` | Avoiding needless backformations |
204 | `misc.bureaucratese` | Avoiding bureaucratese |
205 | `misc.but` | Avoid starting a paragraph with "But..." |
206 | `misc.capitalization` | Capitalizing only what ought to be capitalized |
207 | `misc.chatspeak` | Avoiding lolling and other chatspeak |
208 | `misc.commercialese` | Avoiding jargon of the commercial world |
209 | `misc.currency` | Avoiding redundant currency symbols |
210 | `misc.debased` | Avoiding debased language |
211 | `misc.false_plurals` | Avoiding false plurals |
212 | `misc.illogic` | Avoiding illogical forms |
213 | `misc.inferior_superior` | Superior to, not than |
214 | `misc.latin` | Avoiding overuse of Latin phrases |
215 | `misc.many_a` | Many a singular |
216 | `misc.metaconcepts` | Avoiding overuse of metaconcepts |
217 | `misc.narcissism` | Talking about the subject, not its study |
218 | `misc.phrasal_adjectives` | Hyphenating phrasal adjectives |
219 | `misc.preferred_forms` | Miscellaneous preferred forms |
220 | `misc.pretension` | Avoiding being pretentious |
221 | `misc.professions` | Calling jobs by the right name |
222 | `misc.punctuation` | Using punctuation assiduously |
223 | `misc.scare_quotes` | Using scare quotes only when needed |
224 | `misc.suddenly` | Avoiding the word suddenly |
225 | `misc.tense_present` | Advice from Tense Present |
226 | `misc.waxed` | Waxing poetic |
227 | `misc.whence` | Using "whence" |
228 | `mixed_metaphors.misc` | Not mixing metaphors |
229 | `mondegreens.misc` | Avoiding mondegreen |
230 | `needless_variants.misc` | Using the preferred form |
231 | `nonwords.misc` | Avoid using nonwords |
232 | `oxymorons.misc` | Avoiding oxymorons |
233 | `psychology.misc` | Avoiding misused psychological terms |
234 | `redundancy.misc` | Avoiding redundancy and saying things twice |
235 | `redundancy.ras_syndrome` | Avoiding RAS syndrome |
236 | `skunked_terms.misc` | Avoid using skunked terms |
237 | `spelling.able_atable` | -able vs. -atable |
238 | `spelling.able_ible` | -able vs. -ible |
239 | `spelling.athletes` | Spelling of athlete names |
240 | `spelling.em_im_en_in` | -em vs. -im and -en vs. -in |
241 | `spelling.er_or` | -er vs. -or |
242 | `spelling.in_un` | in- vs. un- |
243 | `spelling.misc` | Spelling words correctly |
244 | `security.credit_card` | Keeping credit card numbers secret |
245 | `security.password` | Keeping passwords secret |
246 | `sexism.misc` | Avoiding sexist language |
247 | `terms.animal_adjectives` | Animal adjectives |
248 | `terms.denizen_labels` | Calling denizens by the right name |
249 | `terms.eponymous_adjectives` | Calling people by the right name |
250 | `terms.venery` | Call groups of animals by the right name |
251 | `typography.diacritical_marks` | Using dïacríticâl marks |
252 | `typography.exclamation` | Avoiding overuse of exclamation |
253 | `typography.symbols` | Using the right symbols |
254 | `uncomparables.misc` | Not comparing uncomparables |
255 | `weasel_words.misc` | Avoiding weasel words |
256 | `weasel_words.very` | Avoiding the word "very" |
257
258 ### Contributing
259
260 Interested in contributing to `proselint`? Great — there are plenty of ways you can help. Read more on [our website], where we describe how you can help us build `proselint` into the greatest writing tool in the world.
261
262 - [Issue Tracker](http://github.com/amperser/proselint/issues)
263 - [Source Code](http://github.com/amperser/proselint)
264
265 [our website]: http://proselint.com/contributing/
266
267 ### Support
268
269 If you run into a problem, please [open an issue](http://github.com/amperser/proselint/issues) in or send an email to [email protected].
270
271 ### Running Automated Tests
272
273 Automated tests are included in the `proselint/tests` directory. To run these tests locally, you can use `./utils`.
274
275 ### License
276
277 The project is licensed under the BSD license.
278