forked from Hirni-Meshram2/pants
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discover config files automatically for tools Pants runs (pantsbuild#…
…11995) If a tool supports autodiscovery/autoloading of config files, Pants will now autodiscover those config files and include them in the chroot. This makes it more likely for Pants to work out-of-the-box. ### FYI: Semantics of `[tool].config` vs. `[tool].config_discovery` Some tools have both these options, and some only one but not the other. `[tool].config` is intended for custom config file locations. Pants will include the file in the chroot _and_ instruct the tool to load it via its option like `--config`/`--rcfile`. If the tool does not have an option like `--config` (Shellcheck, shfmt, and Pytest), then Pants should not have a `[tool].config` option. `[tool].config_discovery` will locate the relevant files and include them in the chroot, but _will not_ change the argv for the tool, i.e. will not use its `--config/--rcfile` option. This avoids a major problem: what to do if we detect >1 config file but the tool only supports 1 config file. Each tool handles that case differently, normally using "first one wins". Pants should not attempt to disambiguate there, and it's a bad UX for us to error. Instead, we simply populate the chroot with the files and let the tool do its thing. This means that we only offer `[tool].config_discovery` if the tool knows how to automatically load those config files without changing the argv. [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
1 parent
f5f59bb
commit 3acdae9
Showing
22 changed files
with
300 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.