Skip to content

Issue 203 isolate language specific changes on generic options#254

Merged
eldipa merged 5 commits intomasterfrom
Issue-203-Isolate-Language-Specific-Changes-on-Generic-Options
Jun 10, 2022
Merged

Issue 203 isolate language specific changes on generic options#254
eldipa merged 5 commits intomasterfrom
Issue-203-Isolate-Language-Specific-Changes-on-Generic-Options

Conversation

@eldipa
Copy link
Copy Markdown
Collaborator

@eldipa eldipa commented Jun 10, 2022

Closes #203

eldipa added 5 commits June 9, 2022 21:48
Previous this commit each ExampleParser returned a default options and
the options parsed from the command line and byexample/init put those in
the main Options object making them active for all the rest of
byexample regardless of the examples' language.

This allowed one parser to change the default values for an option and
affect other parser/example of other language.

PythonParser was a case of this: when +py-doctest was enabled, the +tags
was disabled which makes sense for Python's Doctest but clearly breaks
any other language as +tags is expected to be enabled by default, not
disabled.

So the Python-specific option +py-doctest was indeed affecting
non-Python examples.

The isolation implemented makes byexample/init to store each
ExampleParser's defaults and options from command line in a separated
dictionary and indexed them by language. This
language_specific_defaults is available via the Options as another
entry and not as another options layer (they are not active)

FileExecutor is then now responsible of "activating" the lang-specific
defaults, putting them on top of the Options before executing
ExampleRunner's code or parsing/running an example.

The change should be transparent to ExampleParser and ExampleRunner but
it may be noticed by any ZoneDelimiter, ExampleFinder and in particular
to any Concern however it is belived that no real use-case exists for
requiring a Concern to have access to lang-specific options.
@eldipa eldipa added this to the 11.0.0 milestone Jun 10, 2022
@eldipa eldipa merged commit 55fef2b into master Jun 10, 2022
@eldipa eldipa deleted the Issue-203-Isolate-Language-Specific-Changes-on-Generic-Options branch June 10, 2022 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python option +py-doctest changes byexample's default config even for languages other than Python

1 participant