Add [GLOBAL] in pants.ini for pants global options; Add config file validations against options

Review Request #3475 - Created Feb. 18, 2016 and submitted

Information
Yi Cheng
pants
1803
Reviewers
pants-reviews
benjyw, molsen, patricklaw, stuhood, zundel

Earlier [DEFAULT] is used to store both variables and global options. This change, though still allows pants global options in [DEFAULT], adds the flexibility for them to move to [PANTS_GLOBAL] where variables are disallowed.

https://travis-ci.org/wisechengyi/pants/builds/111318743

[tw-mbp-yic pants (pants_globals)]$ cat test.ini 
[options]
colors: False
[yolo]
good: True
bad: False
[test.junit]
hello_world: 123
byebye: True

[tw-mbp-yic pants (pants_globals)]$ ./pants --config-override=test.ini --verify-config goals
ERROR] Invalid scope [yolo] in test.ini
ERROR] Invalid option 'hello_world' under [test.junit] in test.ini
ERROR] Invalid option 'byebye' under [test.junit] in test.ini
Exception caught: (<class 'pants.option.errors.OptionsError'>)
  File "/Users/yic/workspace/pants/src/python/pants/bin/pants_exe.py", line 50, in <module>
    main()
  File "/Users/yic/workspace/pants/src/python/pants/bin/pants_exe.py", line 44, in main
    PantsRunner(exiter).run()
  File "/Users/yic/workspace/pants/src/python/pants/bin/pants_runner.py", line 53, in run
    options_bootstrapper=options_bootstrapper)
  File "/Users/yic/workspace/pants/src/python/pants/bin/pants_runner.py", line 43, in _run
    return LocalPantsRunner(exiter, args, env, options_bootstrapper=options_bootstrapper).run()
  File "/Users/yic/workspace/pants/src/python/pants/bin/local_pants_runner.py", line 49, in run
    self._maybe_profiled(self._run)
  File "/Users/yic/workspace/pants/src/python/pants/bin/local_pants_runner.py", line 46, in _maybe_profiled
    runner()
  File "/Users/yic/workspace/pants/src/python/pants/bin/local_pants_runner.py", line 55, in _run
    options, build_config = OptionsInitializer(options_bootstrapper, exiter=self._exiter).setup()
  File "/Users/yic/workspace/pants/src/python/pants/bin/goal_runner.py", line 135, in setup
    return self._setup_options(self._options_bootstrapper, self._working_set)
  File "/Users/yic/workspace/pants/src/python/pants/bin/goal_runner.py", line 130, in _setup_options
    options_bootstrapper.verify_configs_against_options(options)
  File "/Users/yic/workspace/pants/src/python/pants/option/options_bootstrapper.py", line 152, in verify_configs_against_options
    raise OptionsError("Invalid config entries detected. See log for details.")

Exception message: Invalid config entries detected. See log for details.

Issues

  • 0
  • 8
  • 0
  • 8
Description From Last Updated
Yi Cheng
Benjy Weinberger
Matt Olsen
Yi Cheng
Yi Cheng
Benjy Weinberger
Yi Cheng
Benjy Weinberger
Eric Ayers
Stu Hood
Yi Cheng
Yi Cheng
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 916d0457216422c384ac4b4197ce5c8c16748987

Loading...