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
Documentation for the new visibility rules #17632
Conversation
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.
Any way to push this to readme for preview?
Or are there alternatives to get a peek at what this looks like?
|
||
The simpler glob syntax used by the `type` and `tags` selector values supports `*` as a match anything and is otherwise case sensitive. (implementation detail: it relies on the `fnmatch` python library so there is a bit more syntax available, but if you find yourself using more than `*` please let us know in case we switch to something else). | ||
|
||
### NOTE/TODO: maybe drop the use of `fnmatch` entirely, as supporting just `*` is real easy. |
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.
I'm in favour of dropping the remaining use of fnmatch
to limit the initial glob syntax supported. (see the implementation note in the previous paragraph for primary motivation for this)
(implementation detail: it relies on the
fnmatch
python library so there is a bit more syntax available, but if you find yourself using more than*
please let us know in case we switch to something else).
I tagged "everyone" as reviewer on this PR as I think everyone has potential to contribute. If it's not your area of interest/expertise you may very well be the expert at finding passages that are difficult to understand etc. ;) If you're so inclined 🙏🏽 |
Excellent work @kaos! Here are the notes from our experimentations:
It is only when you declare rules, for either direction at either side of the relationship link, that it needs to be comprehensive. So within a single The dependencies are validated from the origin targets only: if a module To make it easier to distinguish between dependencies and dependents, you can think in this way:
In this section:
“When applied for The Keep in mind that currently having multiple
It is under consideration whether multiple To check for any violations of your visibility rules, you can run |
Excellent work @kaos ! Would it be possible to add an example to the docs about how to pattern match third-party dependencies. |
Thanks for this @jake-sigtech. FWIW If I am not mistaken, you can also use a wildcard to permit all requirements, that's the syntax:
where the See an example here. |
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.
(didn't finish review)
|
||
> 🚧 There are no default rules | ||
> | ||
> When you setup a set of rules, it must be comprehensive or Pants will throw an error when it fails to find a matching rule for a dependency/dependent. |
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.
I think this repeats the paragraph above - wdyt?
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.
It does. I think of it like a news paper excerpt, something we want to draw a little extra attention too. And if it tickles your fancy, read the surrounding text for more details and in depth content.
Fix a couple of places where I'd confused transient for transitive.
Bar spelling/grammar/major issues I think we may want to merge this to get some base line for further updates, as it's becoming a rather large body of text it's not so pleasant to review. I've tried to incorporate as much as possible of the feedback provided here thus far. Thank you all for those! |
Initial visibility docs draft chapter.