Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.proselintrc usage #491

Closed
lucascosti opened this issue Jun 22, 2016 · 24 comments · May be fixed by #1172
Closed

.proselintrc usage #491

lucascosti opened this issue Jun 22, 2016 · 24 comments · May be fixed by #1172
Labels
status: rejected Issues and PRs that have been denied and will not be worked on.

Comments

@lucascosti
Copy link

Are there any guidelines on how to use .proselintrc?

I've found a .proselintrc in /usr/lib/python2.7/site-packages/proselint and can modify the checks there, but it doesn't seem like I can override it with something like ~/.proselintrc.

Also, is there any way to disable a particular rule? I want to stop curly quote checking, but the following doesn't work in .proselintrc.

...
"typography.symbols"            : true,
"typography.symbols.curly_quotes" : false,
...

Is there any way to keep the rest of the checks in typography.symbols, but disable one rule?

@cpitclaudel
Copy link
Contributor

Adding e.g.

{ "checks": { "typography.diacritical_marks": false } }

to ~/.proselintrc works for me.

@lucascosti
Copy link
Author

Not sure what's going on for me.

Doing:

{ "checks": { "typography.symbols" : false } }

In ~/.proselintrc doesn't even disable all the symbol checking. Although, I'd rather just disable the curly quote checks.

@cpitclaudel
Copy link
Contributor

You're right. Hmm.

This works:

"misc.but": false

But this doesn't:

"typography.symbols.curly_quotes": false,

No idea what's up. Bug?

@lucascosti
Copy link
Author

Yeah, I think it may be a bug. Either the IDs of these checks aren't accurate, or the parsing of this one isn't being done or applied properly.

@netflash
Copy link

@cpitclaudel @lucascosti is this still a case ? wanna to confirm before trying to fix it :-)

@cpitclaudel
Copy link
Contributor

Sorry, I don't use proselint anymore.

@lucascosti
Copy link
Author

@netflash It's been a few months since I used proselint, but it was still happening back then.

@netflash
Copy link

Looks like the filter in the tools.py only works with first 2 keys,
"typography.symbols.curly_quotes": false, won't work, and this
"typography.symbols": false, should work

@gwern
Copy link

gwern commented May 29, 2017

I just installed proselint HEAD to try it out with my Markdown files (Python 2.7.12, Ubuntu 16.04.2), for which a lot of the default suggestions are inappropriate (eg all the Unicode stuff which Pandoc does already), and was puzzled why the ~/.proselintrc wasn't working. I know proselint is reading it because it crashes when the JSON is malformed, but none of the keys appear to have any effect, whether or not they are the first 2 keys. Does the config file not work at all?

@gwern
Copy link

gwern commented Jun 20, 2017

One workaround I am trying is simply redirecting the default config file to a customized version of it:

$ mv /home/gwern/.local/lib/python2.7/site-packages/proselint/.proselintrc ~/
$ ln -s ~/.proselintrc  ~/.local/lib/python2.7/site-packages/proselint/.proselintrc  

If it can only read one config file, it'll read mine (which will work as long as I never reinstalled or upgrade, which would overwrite or ignore the symlink). This appears to work, but I've run into another logical issue: it appears that config keys go from specific to general and clash, so you cannot enable/disable members of a general category. For example, the default .proselintrc has typography.symbols turned on, but you cannot turn off one of the symbols checks. Instead, you have to disable the entire category:

    "typography.symbols"            : true,
    "typography.symbols.ellipsis"   : false,

$ proselint /home/gwern/wiki/Soylent.page 
/home/gwern/wiki/Soylent.page:9:2: typography.symbols.ellipsis '...' is an approximation, use the ellipsis symbol '…'. Found once elsewhere.
...

Change to:

    "typography.symbols"            : false,
    "typography.symbols.ellipsis"   : false,

$ proselint /home/gwern/wiki/Soylent.page 
/home/gwern/wiki/Soylent.page:36:217: garner.phrasal_adjectives.ly No hyphen is necessary in phrasal adjectives with an adverb ending in -ly, unless the -ly adverb is part of a longer phrase
...

What if you want to enable specific members of the disabled category? Uh... Bad stuff happens:

    "typography.symbols"            : false,
    "typography.symbols.ellipsis"   : true,

$ proselint /home/gwern/wiki/Soylent.page 
Traceback (most recent call last):
  File "/home/gwern/.local/lib/python2.7/site-packages/proselint/command_line.py", line 139, in proselint
    errors = lint(f, debug=debug)
  File "/home/gwern/.local/lib/python2.7/site-packages/proselint/tools.py", line 219, in lint
    checks = get_checks(options)
  File "/home/gwern/.local/lib/python2.7/site-packages/proselint/tools.py", line 136, in get_checks
    module = importlib.import_module("checks." + check_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named ellipsis

@mnarrell
Copy link

What is the status here?

@reagle
Copy link

reagle commented Aug 30, 2018

I just encountered the issue that:

"typography.symbols.curly_quotes": false, does not work but
"typography.symbols": false, does -- yet is too expansive.

@matthew-piziak
Copy link

"garner.phrasal_adjectives" : true results in ModuleNotFoundError: No module named 'checks.garner'. and "garner.phrasal_adjectives" : false works but does nothing.

Warning:

bigblocks.org:8:11: garner.phrasal_adjectives.ly No hyphen is necessary in phrasal adjectives with an adverb ending in -ly, unless the -ly adverb is part of a longer phrase

The string it's breaking on is Apparently [[https://emacs.stackexchange.com/questions/50223/performantly-filter-against-a-custom-time-like-property][org is bad at this]; granted that's a problem with flycheck's integration and org-mode parsing.

@matthew-piziak
Copy link

I was using an old reference. Now that I know to use http://proselint.com/checks/ I can see that the correct binding is misc.phrasal_adjectives.

@Nytelife26
Copy link
Member

Can anyone confirm if this was resolved? Nothing seems to reference it.

@github-actions github-actions bot removed the question label May 19, 2021
@Nytelife26 Nytelife26 added the status: awaiting-triage Issues and PRs awaiting investigation and relabelling. label May 29, 2021
@mohkale
Copy link

mohkale commented Sep 15, 2021

I appear to be having this issue.

{
  "checks": {
    "typography.symbols.curly_quotes": false,
    "typography.symbols.sentence_spacing": false,
    "typography.symbols.ellipsis": false,
    "annotations.misc": false
  }
}

annotations and curly quotes is working but I'm still getting sentence spacing and ellipsis warnings despite my config file disabling them.

  "checks": {
    "typography.symbols": false,
    "annotations.misc": false
  }

This has no errors but I'd prefer to disable each error I don't need as I encounter it instead of blanket disabling all of them.

@Nytelife26
Copy link
Member

Thank you for the report, @mohkale. Can you tell us what version of proselint you are using, and if applicable show us the output of --dump-config?

@mohkale
Copy link

mohkale commented Sep 26, 2021

@Nytelife26

I'm on 0.12.0.

@Nytelife26
Copy link
Member

I'm on 0.12.0.

And the output of --dump-config?

@mohkale
Copy link

mohkale commented Sep 27, 2021

@Nytelife26

{
    "checks": {
        "airlinese.misc": true,
        "annotations.misc": false,
        "archaism.misc": true,
        "cliches.hell": true,
        "cliches.misc": true,
        "consistency.spacing": true,
        "consistency.spelling": true,
        "corporate_speak.misc": true,
        "cursing.filth": true,
        "cursing.nfl": false,
        "cursing.nword": true,
        "dates_times.am_pm": true,
        "dates_times.dates": true,
        "hedging.misc": true,
        "hyperbole.misc": true,
        "jargon.misc": true,
        "lexical_illusions.misc": true,
        "lgbtq.offensive_terms": true,
        "lgbtq.terms": true,
        "links.broken": false,
        "malapropisms.misc": true,
        "misc.apologizing": true,
        "misc.back_formations": true,
        "misc.bureaucratese": true,
        "misc.but": true,
        "misc.capitalization": true,
        "misc.chatspeak": true,
        "misc.commercialese": true,
        "misc.composition": true,
        "misc.currency": true,
        "misc.debased": true,
        "misc.false_plurals": true,
        "misc.illogic": true,
        "misc.inferior_superior": true,
        "misc.institution_name": true,
        "misc.latin": true,
        "misc.many_a": true,
        "misc.metaconcepts": true,
        "misc.metadiscourse": true,
        "misc.narcissism": true,
        "misc.not_guilty": true,
        "misc.phrasal_adjectives": true,
        "misc.preferred_forms": true,
        "misc.pretension": true,
        "misc.professions": true,
        "misc.punctuation": true,
        "misc.scare_quotes": true,
        "misc.suddenly": true,
        "misc.tense_present": true,
        "misc.waxed": true,
        "misc.whence": true,
        "mixed_metaphors.misc": true,
        "mondegreens.misc": true,
        "needless_variants.misc": true,
        "nonwords.misc": true,
        "oxymorons.misc": true,
        "psychology.misc": true,
        "redundancy.misc": true,
        "redundancy.ras_syndrome": true,
        "security.credit_card": true,
        "security.password": true,
        "sexism.misc": true,
        "skunked_terms.misc": true,
        "spelling.able_atable": true,
        "spelling.able_ible": true,
        "spelling.athletes": true,
        "spelling.em_im_en_in": true,
        "spelling.er_or": true,
        "spelling.in_un": true,
        "spelling.misc": true,
        "terms.animal_adjectives": true,
        "terms.denizen_labels": true,
        "terms.eponymous_adjectives": true,
        "terms.venery": true,
        "typography.diacritical_marks": true,
        "typography.exclamation": true,
        "typography.symbols": true,
        "typography.symbols.curly_quotes": false,
        "typography.symbols.ellipsis": false,
        "typography.symbols.sentence_spacing": false,
        "uncomparables.misc": true,
        "weasel_words.misc": true,
        "weasel_words.very": true
    },
    "max_errors": 1000
}

@Nytelife26
Copy link
Member

Ah, I apologize, I didn't see which checks you had specifically disabled before. That's related to another ongoing issue - the disabling of individual subchecks.

@mohkale
Copy link

mohkale commented Sep 27, 2021

@Nytelife26

Could you direct me to the issue ticket for it? This is the only issue I could find that seemed to be related to it.

@Nytelife26
Copy link
Member

Could you direct me to the issue ticket for it? This is the only issue I could find that seemed to be related to it.

All related issues are attached to #1172

@Nytelife26
Copy link
Member

Closing in favour of #1172.

@Nytelife26 Nytelife26 added status: rejected Issues and PRs that have been denied and will not be worked on. and removed status: awaiting-triage Issues and PRs awaiting investigation and relabelling. labels Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: rejected Issues and PRs that have been denied and will not be worked on.
Projects
None yet
10 participants