-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add local .pants.rc
support
#14142
Add local .pants.rc
support
#14142
Conversation
Did you know about pantsrc? Search here for two related options and their defaults: https://www.pantsbuild.org/docs/reference-global |
That's what I'm using here. Although now I'm wondering if my addition should actually be moved into the default list? I understand I could use global rc files, but it'd be nice to have different settings for different repos. |
Sounds good. Just wanted to make sure you knew about and rejected adding this to your |
pants.toml
Outdated
@@ -64,6 +64,9 @@ build_ignore.add = [ | |||
"testprojects/src/go/**", | |||
] | |||
|
|||
# Developers can customize Pants settings by using a `pants.dev.toml` file (which is .gitignored) | |||
pantsrc_files.add = ["pants.dev.toml"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I re-read the diff and now see you used pantsrc_files
and not config_files
. My only excuse is the wider context. IIUC the motivating issue was to silence some tools and the 1st attempt was to do that globally by changing Pants defaults in code. As such I'd think you'd actually want the ~/.pantsrc
solution instead of having to do something like this in each Pants repo you work in. Is this change ~unrelated to the motivating case / or related in that that made you see this might be useful someday for some other setting Pants devs don't universally agree on that you only want to change in the Pants repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, in the OP - you want to have the Pants repo only warn but other repos default to info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nailed it. They're all related.
I'll probably put the --quiet
arg addition in my global pants rc because I don't care about seeing that stuff in any repo.
But in local RC files I have things I want per-repo. E.g. I want to see stats logged for my work monorepo, but not for Pants. And I don't want to blast every dev with those logs either.
In the Pants repo, I'd like to define my own aliases (which will be different, because it uses different tools). Stuff like that.
But. in general, I want to customize options per-repo for my own sake but don't want to dirty the git-tracked files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. makes sense to me.
I think that it could, yea. But rather than |
945feb6
to
cc9e7e1
Compare
Changed the PR title & contents |
This allows developers to customize their Pants settings without dirtying any repo files. For instance, I like bumping the logging level up to
warn
😉