One function

mergeConfig in CleanCut/green

The author described this change as Fixed a regression that prevented targets, help, config, store_opt, and parser from making it into the args object returned from mergeConfig(). It counts as a record because the check below fails on the code as it stood at 365b2327d and passes on 1d800f88c, with nothing else changed between the two runs.

Fix saved2014-07-25
Sharing licenceMIT · LICENSE
Change size+2 5

What the code was meant to do, written into the code itself as a docstring

I take in a namespace created by the ArgumentParser in cmdline.main() and merge in options from configuration files. The config items only replace argument items that are set to default value. Returns: I return a new argparse.Namespace, adding members: shouldExit = default False exitCode = default 0 omit = omit settings converted to list and extended cov = coverage object default None

The change

2525 elif name in ['omit']:
2626 config_getter = config.get
2727 elif name in ['targets', 'help', 'config']:
28- continue # Some options only make sense coming on the command-line.
28+ pass # Some options only make sense coming on the command-line.
2929 elif name in ['store_opt', 'parser']:
30- continue # These are added members we need to ignore
30+ pass # These are convenience objects, not actual settings
3131 else:
3232 raise NotImplementedError(name)
3333
4545 new_args.shouldExit = False
4646 new_args.exitCode = 0
4747 new_args.cov = None
48- # These two were added in getParser()
49- new_args.parser = args.parser
50- new_args.store_opt = args.store_opt
5148
5249 # Help?
5350 if new_args.help: # pragma: no cover

The check that tells the two apart

failpass·green/test/test_config.py::TestMergeConfig::test_targets

Check file green/test/test_config.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it365b2327d3325256074f1b581181b92eae578419
Broken version dated2014-07-25
Modulegreen.config
Units changedmergeConfig
Fingerprint6561d4af726d54ad
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.