Skip to content

Automatically generated documentation for configuration options confuses users into using curly braces #31

@MartinSpiessl

Description

@MartinSpiessl

This came up here:

https://gitlab.com/sosy-lab/software/cpachecker/-/issues/578#note_412755260

Currently e.g. configuration options with ImmutableList.of() as default value are printed as myoption={} in the compiled documentation of configuration options. If the default value for a option is a non-empty collection, it will look like this:

slicing.conditionFiles = {
          Paths.get("output/AssumptionAutomaton.txt"),
          Classes.getCodeLocation(ReducerExtractor.class)
              .resolveSibling("config/specification/AssumptionGuidingAutomaton.spc")}

This leads to users expecting to be able to input curly braces when they specify a specific value for such an option.
In this case there also appears java code, which leads user's to think that they might also provide this.

Ideally the type information is conveyed in the documentation in a less confusing manner.

Let's take for example:

cpa.smg.deallocationFunctions = {"free"}

Here if we omit the {} it looks fine, that command could also be written like that in a configuration. But then of course the user loses the type information (the fact that the option is fine with more than one string, separated by commas).

For other kinds of option we already provide information about the argument type, e.g.:

cpa.slicing.weakeningStrategy = CEX
  enum:     [SYNTACTIC, DESTRUCTIVE, CEX]

One proposal how to solve this would be to specify a option that is backed by a collection with a trailing comma:

#proposal 1
cpa.smg.deallocationFunctions = free,

But I find that rather ugly. Another proposal would be to provide the type information in an extra line (much like with enums):

#proposal 2
cpa.smg.deallocationFunctions = free
  accepts a list of arguments (separated by ",")

Yet another way to do it completely different would be to use explicitly state the grammar/structure/type that is expected as value:

#proposal 3
cpa.smg.deallocationFunctions = <string>,...
  default:                    = free

or the other way around:

#proposal 4
cpa.smg.deallocationFunctions = free
  type: <string>,...

Maybe we can also provide more semantic type information, e.g. for slicing.conditionFiles something like:

#proposal 5
  type: List<Path>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions