-
-
Notifications
You must be signed in to change notification settings - Fork 649
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 --transitive
flag for all linters
#4973
Comments
If this were a scoped subsystem, the scope of the subsystem would get injected into the option, so tasks that already have a
...which is unfortunate. And actually, if it were a global subsystem, it would still end up being named |
cc @benjyw : thoughts on how to do this, option wise? |
Global option that each task can override in its scope? Then we could potentially implement globally by using this flag to determine whether invalidation returns the closure or just the root targets? |
If it's a global option, what happens with tasks such as Perhaps, instead of a subsystem, this is defined on a task mixin ( |
Yea, neither global nor scoped seem like great options. The hope/dream of placing in a scoped subsystem named " Would it be feasible to declare the option on a subsystem and then scope the subsystem using the goal name? ie, |
It should be, but we've never done anything like that before. I'll give it a whirl. If not, it doesn't seem too terrible if we have to set this task-by-task. |
Actually, I think it's better to set this per-task, on the task's options scope. A) Users already understand this (or at least, should). B) In some cases the transitivity concept doesn't apply to every task in a goal. For example, C) Existing How important do you think it is to be able to do |
See #5303. |
Well, see the original description. The usecase is that if you have a dozen linters (...pants already does), and you have already determined a precise set of affected targets via The (best?) way to do this currently is to have a |
Well, if the default for |
During a typical build you need to check lints transitively... it's only when you've already determined a precise set of targets to lint that you don't want transitivity. |
OK, so to pull the ideas into one place, possibilities include:
|
@stuhood your preference/other ideas? |
Not a preference, but similar to 3:
I think either 3 or 4 accomplish the goal, although 4 probably results in a bit more boilerplate to explicitly depend on the subsystem? Having the option implicitly present due to the recursion is a bit magical. Do values set for recursive options propagate downward to all subscopes? IE would setting |
(sorry, made a few edits to the above that may not have been reflected in email) |
I believe so, yes. I don't like the idea of shadowing the lint scope with a subsystem. The unintended consequences might be horrifyingly confusing. I'd be pretty strongly opposed to that. |
The more I think about it, the more I'm in favor of a global option. The concept of acting transitively or not is fairly widely applicable. For example, it could make sense to run tests either just on target roots or transitively. In practice test targets are unlikely to depend on other test targets, but the concept is at least coherent. |
By the way, does this end up getting complicated by scopes? Is the transitive option actually a whitelist or blacklist of scopes? I guess we can let each target decide. |
Implemented in #5383. |
We should add a
--[no]-transitive
flag for all lint tasks to support the usecase where you're running directly on changed targets.Running directly on changed targets happens when you use
./pants --changed lint
(for any setting of the--changed-include-dependees
option): in that case, you know that only files directly owned by a target are affected. It also happens duringarc lint
.Because this affects so many tasks, it seems likely that it should go on a (perhaps lint specific?) Subsystem and be consumed there.
The text was updated successfully, but these errors were encountered: