default_plus_1.toml (1172B)
1 # these will be ran in *parallel 2 # (gthreads) 3 4 5 6 [ratchet.regex.typos] 7 regex = "rachet|ratchet|rathet|rachet|ratchett" 8 valid = [ 9 """ 10 ratchet 11 """ 12 ] 13 invalid = [ 14 """ 15 rachet 16 """ 17 ] 18 19 20 21 [ratchet.regex.exceptions] 22 regex = "except:" 23 valid = [ 24 """try: 25 x = 1 26 except ValueError: 27 pass""", 28 """try: 29 do_something() 30 except (IOError, ValueError): 31 handle()""" 32 ] 33 invalid = [ 34 """ 35 try: 36 pass 37 except: 38 pass""", 39 """try: 40 dangerous() 41 except: 42 recover()""" 43 ] 44 45 [ratchet.regex.lightning] 46 regex = "import pytorch_lightning|from pytorch_lightning" 47 valid = ["import torch", "from my_project import Trainer"] 48 invalid = ["import pytorch_lightning", "from pytorch_lightning import LightningModule"] 49 50 [ratchet.regex.tabs] 51 regex = "\\t" 52 valid = [ 53 """def foo(): 54 return 42""", 55 "print('no tab here')" 56 ] 57 invalid = [ 58 """\tprint('starts with tab')""", 59 """def bar(): 60 \treturn True""" 61 ] 62 63 # printed text is assumed to be failures 64 # each evaluation **must** accept a file path as input 65 # these can be tested by running echo FILEPATH | COMMAND 66 # these will be ran in parallel 67 68 [ratchet.shell.line_too_long] 69 command = "xargs -n1 awk 'length($0) > 80'"