canonical / praecepta

Creative Commons Attribution Share Alike 4.0 International
12 stars 18 forks source link

Add rule #06 - Do not use these contractions #18

Closed a-velasco closed 5 months ago

a-velasco commented 6 months ago

Summary

Added a warning for the current list of forbidden contractions (except for 'twas)

Test details and sample output

Tested locally in this branch by adding a .vale.ini file and a test.md file. .vale.ini

StylesPath = styles

[*.md]
BasedOnStyles = Canonical

test.md

# This mayn't be the best heading

"ain't"
HOW'D
_how'll_
**I'd**
>something's
mayn't
may've
mightn't
might've
gonna
gotta

output

 1:8   warning  Consider using 'may not'        Canonical.006-Contractions-forbidden 
                instead of 'mayn't'                                                  
 3:2   warning  Consider using 'isn't' instead  Canonical.006-Contractions-forbidden 
                of 'ain't'                                                           
 4:1   warning  Consider using 'how did'        Canonical.006-Contractions-forbidden 
                instead of 'HOW'D'                                                   
 5:2   warning  Consider using 'how will'       Canonical.006-Contractions-forbidden 
                instead of 'how'll'                                                  
 6:3   warning  Consider using 'one would'      Canonical.006-Contractions-forbidden 
                instead of 'I'd'                                                     
 7:2   warning  Consider using 'something is'   Canonical.006-Contractions-forbidden 
                instead of 'something's'                                             
 8:1   warning  Consider using 'may not'        Canonical.006-Contractions-forbidden 
                instead of 'mayn't'                                                  
 9:1   warning  Consider using 'may have'       Canonical.006-Contractions-forbidden 
                instead of 'may've'                                                  
 10:1  warning  Consider using 'might not'      Canonical.006-Contractions-forbidden 
                instead of 'mightn't'                                                
 11:1  warning  Consider using 'might have'     Canonical.006-Contractions-forbidden 
                instead of 'might've'                                                
 12:1  warning  Consider using 'will' instead   Canonical.006-Contractions-forbidden 
                of 'gonna'                                                           
 13:1  warning  Consider using 'must' instead   Canonical.006-Contractions-forbidden 
                of 'gotta'
pmatulis commented 6 months ago

Shouldn't file # 06 - Contractions - Do not use these.yml be renamed to something like 006-Contractions-forbidden.yml ?

a-velasco commented 6 months ago

General doubt: I am unsure about the wording of the message.

Vale itself uses "Did you really mean '%s'?", but that seems kind of unhelpful.

Perhaps a subsitution would be clearer?

message: "Consider using '%s' instead of '%s'"
swap:
  ain't: isn't
  how'd: how did
  how'll: how will
  I'd: one would
  something's: something is
  mayn't: may not
  may've: may have
  mightn't: might not
  might've: might have
  gonna: will
  gotta: must
evilnick commented 6 months ago

@a-velasco Yes, I prefer the substitution approach

a-velasco commented 6 months ago

Updated description.