-
Notifications
You must be signed in to change notification settings - Fork 105
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
Split checks from profiles #3188
Comments
We could have a profile for new contributions, to make it easier. Also maybe a profile for things that don't fit quite into existing buckets. When a trend establishes we could create a new profile that fit that. |
If the answer to this problem is to create a profile containing checks that are not members of a profile, that really convinces me that we need to separate checks from profiles... |
If we dive into a significant refactor of the profile / check structure, it would be great to see the development of an external configuration file with upstream and custom local test grouping support as part of this effort. fontbakery.toml[fontbakery.profiles.universal]
exclude = [
"skipped/universal/check/1",
"skipped/universal/check/2",
]
[fontbakery.checks]
include = [
"some/nonuniversal/upstream/check/1",
]
[local.profiles]
paths = [
"path/to/custom/localprofile/1",
"path/to/custom/localprofile/2",
]
We may be thinking along the same lines. And what I show above may be the new "profile" structure similar to what you suggest. If the check implementation is pulled out of the check grouping definition, it should be possible to define groups of tests through some structured data format that could live in either upstream (for the fontbakery maintained check groups) or downstream (to support expansion with custom checks in new check groups) locations. If the definition file is meant to support manual edits, my own preference is to use YAML or TOML rather than JSON. Beyond being more human friendly, you also get comment support which can be helpful for annotation. It is important that any change maintains support for downstream check grouping definitions that include a mix of upstream and downstream checks. |
I love that idea, as it would also allow individual projects to pass configuration details to the checks. This would clean up eg the shaping check, by eliminating hard-coded data file paths. |
As I explained to you before, the profile is defining the namespace in which the check is supposed to be executed. FontBakery uses Dependency Injection, so you don't have to call the check yourself. You define a check, and by the names of the arguments FontBakery decides how often to run the check, e.g. repeatedly for each ttFont, and what type the arguments are. The namespace is mainly made up of Hence, a profile is nothing else than defining a collection of checks and the dependencies required to run those checks. As such I don't see a fundamental difference to a normal python module, and in fact profile definition piggybacks much on the module system.
I can't believe the problem is to mark up a module as a profile, it seems more like there's a political issue and an overloading of the profile as more than just a description of dependencies. |
Trying to follow you here.
Not sure if I agree this is a good idea TBH.
Yes, the concepts are different: the profile is the container of the check; it defines the namespace available to the check. You can organize it differently, but you can't remove the namespace thing, it's important that we know what the arguments of a check are supposed to be.
Not true. At least, if true, it would be a bug. But the minimal profile definition is usually like this:
"top-level profile" introduces a new concept, never heard of it before this. I think your
Now you use the new concept and impose it onto the old one. That's confusing. It must also load up the This will be very specific for e.g. the
Please explain. Why would all the modules in the package want to load the list of profiles and why can't they do it right now?
You could just go ahead and implement this in a profile and if it's useful we can generalize it and remove friction. |
I'll try again. I think there is an important difference here. We already have a distinction between what I am calling "top-level profiles" and other profiles: a top-level profile is a profile that we consider important enough to have a The I'm not suggesting that we do this, because I think there is a better approach which I'll explain below, but I want to show that there are already two different kinds of "thing" in As well as those, we have a bunch of other stuff in I'm talking about stuff like The opentype profile, on the other hand, does not define any checks. It is purely a list of checks. These two profiles - But the adobefonts profile does both! It describes a list of checks to perform, and it also defines the definition of some of those checks. I think these two roles of the "profile" concept - defining which checks we want to perform and defining how to perform checks - should be separated.Here is my alternative architecture:
This is really useful because now profiles can mix and match - they can choose checks from a "pool" of checks. The fontbakery check runner loads up all the Once we have done this, all we should have in I understand your point about the namespacing of arguments. It's a very clever idea. But I don't think it's all that big a deal. We have the argument names for that. |
All other profiles can be used with
I was never really happy about those two, now I know why, their existence stimulates your argument. Most of this, i.e. reorganizing stuff, sounds acceptable but the last part. We should not bind the check runner to a certain namespace, in this case the one of The way I see it, If we don't pay attention now, it may even shut that door completely.
Before – we could use
We can do exactly this already, there can be a profile that contains all checks, we already have command line arguments that do this kind of selection. You could make this happen "data driven" in 15 minutes using a JSON file as list of checks.
🤣 we literally have |
I agree with this. And in fact it's the only way to do custom profiles out-of-tree - they would have to define their own pool. That's fine.
I understand why it's a good idea to make software implementations as generic as possible. But at some point you have to specialize. This project is called fontbakery; a certain amount of specialisation is expected. :-) We've talked about using fontbakery to check things which are not fonts. We need to allow that. But when we talked about that, @felipesanches wanted those checks would live in the same profiles as the font checks:
So you want to namespace profiles so that different profiles can define different "kind of things" that they test, and Felipe wants profiles to be able to test many different kinds of things! |
(Maybe we must make
Maybe, but it's neither necessary nor do we have to. Instead of specializing
I can't follow this. I don't think it compares well. Felipe wants the I also want to have attached to each check the environment information (namespace) it expects, but a profile already does that. The |
This happened! |
Yes! And the new profile stuff is amazing. Question: Should old profiles still work, or is it easy to make them work? I'm getting an error with ours:
but I don't know whether they should work (and we have an error) or they aren't expected to work. I know it isn't that hard to write a replacement, but for backwards compatibility with older fontbakery. |
Old profiles will not work - profiles are now pure data, not code, and are much, much simpler, but I'm sorry about the lack of backwards compatibility. Please look at the in-built profiles for examples of how profiles now look. See also the new Writing Profiles guide. |
As I suspected. thx. |
Last time I tried to add a profile (#3168), I was told that we shouldn't proliferate profiles and that the checks should find their way into other profiles. I agree with this, it's a good idea! The problem is that the checks need to be "put" somewhere and right now the only place we have to put them is a package called
fontbakery.profiles
. Now we are talking about the GRAD check (#3187). I'm happy to write a check but I don't want to have to fight over which profile it should go in. These are separate concepts.In fact, right now, we have some files in
fontbakery.profiles
which describe profiles, some which describe checks, and some which contain both checks and profiles. This is a bit crazy.I would like to see a package called
fontbakery.checks
which contains all the checking code, withfontbakery.profiles
reserved for actual top-level profile. Things infontbakery.profiles
should just load up the checks that they need and return a list. This is cleaner and it also means that the list of profiles can be automatically loaded from all the modules in the package.Eventually the
fontbakery.profiles
stuff can probably go away and become a bunch of JSON files.The text was updated successfully, but these errors were encountered: