ratchets

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

invalid.toml (1046B)


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