ratchets

Mirror of ratchets, my python testing utility
git clone git://git.laack.co/ratchets.git
Log | Files | Refs | README | LICENSE

default.toml (1020B)


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