Skip to content
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

Adjust profile manifest requirements for pfm_name and pfm_type #54

Closed
homebysix opened this issue Jan 31, 2022 · 5 comments
Closed

Adjust profile manifest requirements for pfm_name and pfm_type #54

homebysix opened this issue Jan 31, 2022 · 5 comments

Comments

@homebysix
Copy link
Owner

Copying over @apizz's comments from this pull request.

One thing I did discover is that while it will fail to let me commit if I remove the pfm_type key it will notably commit just fine without a pfm_name key. It's required for top-level keys (first layer of pfm_subkeys) but not for all items in the layer below that (thinking of an array with a subkey that's a string). Not sure how difficult it would be to add this just at the layer we need, but if we could get that included as a required key that would be awesome!

@homebysix
Copy link
Owner Author

@apizz Just to clarify: pfm_name should be required for the first level of pfm_subkeys, but is not required deeper than that?

@apizz
Copy link

apizz commented Feb 1, 2022

So I guess this is less nuanced than I thought. pfm_name is required for all first level subkeys from the top / root level manifest. After that, it is only for additional pfm_subkeys layers that do not have a parent preference whose pfm_type is array that a pfm_name is not required (all other pfm_types still require pfm_name). In that scenario 1 of 2 things are possible:

  • we have an array of strings in which case there should be no pfm_name
  • we have an array of dictionaries which similarly should have no pfm_name, but if there is yet another layer of subkeys which are not arrays or dictionaries we need pfm_name

Does that make sense?

@relgit
Copy link
Contributor

relgit commented Feb 1, 2022

I think you had an extra not sneak in there by mistake @apizz 😅

Let's go by this rule of thumb, from ProfileManifests' wiki: pfm_name is required for every preference key except immediate descendants of keys whosepfm_type is array.

@apizz
Copy link

apizz commented Feb 1, 2022

The problem is that if we have an array of dictionaries then there will be key value pairs in the dictionary that will need pfm_name

@relgit
Copy link
Contributor

relgit commented Feb 1, 2022

If you think about it, only the dictionary is an immediate descendant of the array - not its pairs. So the need for pfm_name on these pairs is respected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants