Skip to content

Separate custom types into its own file and format#33

Merged
predragnikolic merged 6 commits intomainfrom
refactor/separate-custom
Feb 28, 2026
Merged

Separate custom types into its own file and format#33
predragnikolic merged 6 commits intomainfrom
refactor/separate-custom

Conversation

@rchl
Copy link
Member

@rchl rchl commented Feb 27, 2026

No description provided.

@rchl
Copy link
Member Author

rchl commented Feb 27, 2026

Unfortunately there are some annoying

Union syntax cannot be used with string operand; use quotes around entire expression

errors that ruff can't fix automatically and it's hard to make a generic solution for those since the syntax is dependent on context...

@predragnikolic
Copy link
Member

Union syntax cannot be used with string operand; use quotes around entire expression

Looks like this error will not happen if we use Union instead of | for the custom.py generated types.

@predragnikolic
Copy link
Member

predragnikolic commented Feb 28, 2026

cbf1302
I am fine if the types are not sorted, but rather follow the order in how they are defined in the meta json file. (but ignore this one, as it is not really important)

rchl and others added 2 commits February 28, 2026 22:00
Co-authored-by: Предраг Николић <idmpepe@gmail.com>
Co-authored-by: Предраг Николић <idmpepe@gmail.com>
@rchl
Copy link
Member Author

rchl commented Feb 28, 2026

cbf1302 I am fine if the types are not sorted, but rather follow the order in how they are defined in the meta json file. (but ignore this one, as it is not really important)

I've assumed that order in upstream file could change randomly on update so went with sorting.

Maybe upstream file is updated manually in which case it wouldn't be a problem but I still like sorting anyway (in general) since it's easier to locate stuff.

@rchl
Copy link
Member Author

rchl commented Feb 28, 2026

Hmm, but the generated types that I've included in LSP now don't match those here.

In LSP I've used types after triggering ruff fix and then manually fixing remaining issues.

We could also ignore those issues in LSP but then we'd have to update those again.

But that's probably better than trying to fix the issue here. It will probably solve itself anyway after migrating to 3.14.

@rchl
Copy link
Member Author

rchl commented Feb 28, 2026

I'm OK with this state. If you are too then I will update types in LSP to match those.

@predragnikolic predragnikolic merged commit 96f4b13 into main Feb 28, 2026
1 check passed
@predragnikolic predragnikolic deleted the refactor/separate-custom branch February 28, 2026 21:59
@predragnikolic
Copy link
Member

predragnikolic commented Feb 28, 2026

It will probably solve itself anyway after migrating to 3.14.

👍

I'm OK with this state. If you are too then I will update types in LSP to match those.

Yes, I think it would be good to also update LSP. (only for consistence)

with future of python we can make adjustments to remove UP006, UP007

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

Successfully merging this pull request may close these issues.

2 participants