Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

feat: migrate @enum annotations#1126

Merged
Aclrian merged 17 commits intomainfrom
1125-migrate-enum-annotations
Dec 5, 2022
Merged

feat: migrate @enum annotations#1126
Aclrian merged 17 commits intomainfrom
1125-migrate-enum-annotations

Conversation

@Aclrian
Copy link
Copy Markdown
Contributor

@Aclrian Aclrian commented Dec 1, 2022

Closes #1125.

Summary of Changes

  • fix mypy error (hopefully)
  • add migration for enum annotations to another version, with the possibilities:
    • If the annotation is mapped to a parameter and its type is string and the default string value (if any) is a value expected by the annotation, the annotation will be migrated as expected.
    • If the annotation is mapped to a parameter and its type is known, but not a string, we would assume that the problem of a @enum annotation is solved. E.g., an enum type is created for this parameter.
    • If the annotation is mapped to a parameter, but its type is unknown, an unsure @enum annotation will be created for this parameter.
    • Otherwise, a @todo annotation will be crated instead of the @enum annotation.

Testing Instructions

run the migrate command or view and run the test_migration.py file

@Aclrian Aclrian linked an issue Dec 1, 2022 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 1, 2022

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 6 0 0.53s
✅ PYTHON black 6 0 0 1.52s
✅ PYTHON flake8 6 0 0.44s
✅ PYTHON isort 6 0 0 1.12s
✅ PYTHON mypy 6 0 2.71s
✅ PYTHON pylint 6 0 2.29s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@Aclrian Aclrian force-pushed the 1125-migrate-enum-annotations branch from 0274730 to f5398ae Compare December 1, 2022 17:57
@Aclrian Aclrian force-pushed the 1125-migrate-enum-annotations branch from 81d4c55 to 0aa05b0 Compare December 3, 2022 18:41
aka mypy fix your error message "no mypy cache directory" # 10768

5 hours in the making for
@Aclrian Aclrian force-pushed the 1125-migrate-enum-annotations branch from 7a765f8 to 9ad76a1 Compare December 4, 2022 17:08
@Aclrian Aclrian force-pushed the 1125-migrate-enum-annotations branch from f0b4e62 to 1cb674a Compare December 5, 2022 14:42
@Aclrian Aclrian changed the title feat: migrate @enum annotations feat: migrate @enum annotation Dec 5, 2022
@Aclrian Aclrian changed the title feat: migrate @enum annotation feat: migrate @enum annotations Dec 5, 2022
@Aclrian Aclrian marked this pull request as ready for review December 5, 2022 15:50
@Aclrian Aclrian requested a review from lars-reimann as a code owner December 5, 2022 15:50
@Aclrian Aclrian removed the request for review from lars-reimann December 5, 2022 16:11
@Aclrian Aclrian merged commit eddb597 into main Dec 5, 2022
@Aclrian Aclrian deleted the 1125-migrate-enum-annotations branch December 5, 2022 16:37
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2022

🎉 This PR is included in version 1.74.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Included in a release label Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate @enum annotations

1 participant