aCLImatise / CliHelpParser

Reads the output from CLI help commands, and generates machine readable schemas (CWL etc)
https://aclimatise.github.io/CliHelpParser/
GNU General Public License v3.0
14 stars 5 forks source link

try to refine type #38

Open bernt-matthias opened 4 years ago

bernt-matthias commented 4 years ago

by checking for subclasses

multimeric commented 4 years ago

This seems like a reasonable approach. I do have some feedback, however.

multimeric commented 4 years ago

Out of interest, what is an example of this PR improving behaviour? I would have though your example in #37 would predict None, then CliFile() then CliFile() respectively, and then return CliFile(). We only use subclasses for CliFileSystemType, and only recently, but the inference will never return CliFileSystemType, so it seems irrelevant.

If I ever rewrite my type system (and the representable property), I might be able to make this work better.

bernt-matthias commented 4 years ago

Could you please add a test case also please. You should be able to use the exact example from the linked issue.

Can try. Do you have an example how this is done? Or where?

multimeric commented 4 years ago

Ah well eventually I'll make a test_data_model.py or something, but in the meantime I think you could chuck this into test_type_inference.py. You can construct a Flag() object with the fields that you mentioned in #37, and then assert that the value of Flag.get_type() returns the right value.

multimeric commented 4 years ago

Also look into getting pre-commit set-up so that the builds pass, and the git diffs are easier for me to read. You should just have to run:

pip install pre-commit
pre-commit install