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

support for x-enum-varnames in chaotic #712

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

gorundebug
Copy link

support for x-enum-varnames in chaotic

chaotic/chaotic/back/cpp/types.py Show resolved Hide resolved
@@ -262,13 +263,35 @@ def _gen_integer(
assert schema.format is None
assert user_cpp_type is None

enum_names = []

if hasattr(schema, 'x_properties') and 'x-enum-varnames' in schema.x_properties:
Copy link
Collaborator

Choose a reason for hiding this comment

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

x_properties должны быть всегда

Copy link
Author

Choose a reason for hiding this comment

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

уберем

result.extend([part.capitalize() for part in SPLIT_WORDS_RE.findall(word)])
return ''.join(result)

for i in range(len(schema.enum)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

enumerate(schema.enum)

Copy link
Author

Choose a reason for hiding this comment

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

принял

chaotic/chaotic/back/cpp/translator.py Show resolved Hide resolved
chaotic/chaotic/back/cpp/types.py Show resolved Hide resolved
chaotic/chaotic/back/cpp/translator.py Show resolved Hide resolved
Copy link

github-actions bot commented Oct 9, 2024


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

schemas:
Enum:
type: object
additionalProperties: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

это должен быть не голден тест, а тест на то, что static_cast(kInner) == 0 и т.п.

Copy link
Author

Choose a reason for hiding this comment

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

я про тест совсем не понял. Где это должно проверяться и почему именно static_cast(kInner)

Copy link
Collaborator

Choose a reason for hiding this comment

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

где - где-то в chaotic/tests/back/cpp
почему - ну ты написал некую функциональность, которая генерит другие имена констант; нужно проверить, что эти константы равны нужным значениям, а не абы каким
голден тесты - это не тесты, а лишь витрина для стороннего наблюдателя

@segoon
Copy link
Collaborator

segoon commented Oct 22, 2024

fixes #710

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.

3 participants