Skip to content

Show all constraints when formatting the config name - #1430

Open
cbarrete wants to merge 1 commit into
facebook:mainfrom
cbarrete:config-name
Open

Show all constraints when formatting the config name#1430
cbarrete wants to merge 1 commit into
facebook:mainfrom
cbarrete:config-name

Conversation

@cbarrete

Copy link
Copy Markdown
Contributor

This is important for OSS, who cannot add their modifiers to the hardcoded NAMED_CONSTRAINT_SETTINGS dict.

This is important for OSS, who cannot add their modifiers to the hardcoded
`NAMED_CONSTRAINT_SETTINGS` dict.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 31, 2026
@meta-codesync

meta-codesync Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D114419843. (Because this pull request was imported automatically, there will not be any future comments.)

@8Keep

8Keep commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Please give some better description in the PR, we should update the contribution guidelines for this. I'd want at least the output and what it looks like.

I'd prefer some kind of setup where the user can set this function in their set_cfg_constructor(), so it's easy to customize if they want, with good defaults. Or, could be combined somehow with the aliases that exist there, by default?

Probably want @scottcao to think about how he'd want this to be setup too.

if constraint_name:
name_list.append(constraint_name)

# Append any remaining constraints not covered by NAMED_CONSTRAINT_SETTINGS,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd been meaning to put a replacement of NAMED_CONSTRAINT_SETTINGS in set_cfg_constructor. Is that something which is possible/more advisable to solve this problem?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the custom cfg_name that I ended up writing ended up having quite a bit more logic than is conveniently handled by a list of transformers, so it's unclear to me that just expanding the list/making it configurable is the right way to go.

@cbarrete

Copy link
Copy Markdown
Contributor Author

I've had some more time to play with this, and I agree that this is not the right approach.

I think that we need to make cfg_name configurable, but it also needs to be called (likely with more arguments) for things like transitions.
It's unclear to me what the idiomatic way of making it configurable would be.

For now, I am going to wrap cfg_constructor_post_constraint_analysis to call a custom cfg_name on the returned platform, keeping its constraints but formatting a different label.
The big downside is that again, it doesn't handle transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants