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

Refactor/reduce code duplication in plugins #31

Open
wants to merge 18 commits into
base: refactored
Choose a base branch
from

Commits on Apr 15, 2022

  1. Refactored ClassRegistry to reduce code duplication

    The duplicated methods per type `style style_XXX_class`, `generate_XXX` and `reference_XXX` were abstracted into a BaseTypeRegistry class.
    Provided a specific XXXTypeRegistry for every required type and added it as an attribute to the ClassRegistry.
    j-riebe committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    6a2898d View commit details
    Browse the repository at this point in the history
  2. Added sorting to forward refs

    j-riebe committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    3f4b088 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8c07759 View commit details
    Browse the repository at this point in the history
  4. Refactor EnumsPlugin

    Made generate_enums a "private" method of EnumsPlugin.
    
    Decoupled value parsing and code generation, by moving the generation of Ast-Elements into a separate class.
    j-riebe committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    006a1b0 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2022

  1. Added tests for InputsPlugin with 100% coverage to prepare refactoring

    Changed the generation of deprecation-reasons to print the deprecation reason after `DEPRECATED` instead of the field description.
    j-riebe committed Apr 16, 2022
    Configuration menu
    Copy the full SHA
    bac1f5b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8c045a View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2022

  1. Refactored generate_input_annotation

    Separated ast-generation to static class.
    Streamlined control flow inside generate_input_annotation.
    j-riebe committed Apr 17, 2022
    Configuration menu
    Copy the full SHA
    2d3a9d3 View commit details
    Browse the repository at this point in the history
  2. Moved ast-generators into separate module

    A centralized ast-generator module should make the reuse of repeating structures easier and hide the actual code-generation from plugin-developers.
    
    Optimized imports
    j-riebe committed Apr 17, 2022
    Configuration menu
    Copy the full SHA
    66abd5a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    00957ad View commit details
    Browse the repository at this point in the history
  4. Made tests for InputsPlugin reusable for ObjectsPlugin

    Added tests for ObjectsPlugin that include primitive types and nested object types
    j-riebe committed Apr 17, 2022
    Configuration menu
    Copy the full SHA
    520aeef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e30a955 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6438d16 View commit details
    Browse the repository at this point in the history
  7. Added TestCase for Union-generation and found a potential design-error.

    The issue is described in the doctstring to ObjectTypeTestCaseGenerator.make_test_cases_union_field_value()
    j-riebe committed Apr 17, 2022
    Configuration menu
    Copy the full SHA
    d28d259 View commit details
    Browse the repository at this point in the history
  8. Added test for ObjectsPlugin (100%-coverage) to prepare refactoring.

    This partially duplicated old tests in test_mro/test_multiple_inheritance
    j-riebe committed Apr 17, 2022
    Configuration menu
    Copy the full SHA
    7666cc4 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2022

  1. Refactored generate_types

    j-riebe committed Apr 18, 2022
    Configuration menu
    Copy the full SHA
    5edc79f View commit details
    Browse the repository at this point in the history
  2. Refactored generate_object_field_annotation

    Fixed bug in ObjectsPlugin._generate_type_body (introduced in last commit) that broke forward references by referencing the wrong "parent" in the subsequent call to generate_object_field_annotation.
    
    Added union method to the AnnotationAstGenerator.
    Refactored last method calls in ClassRegistry that slipped through during the first refactoring.
    j-riebe committed Apr 18, 2022
    Configuration menu
    Copy the full SHA
    4f5747f View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2022

  1. Fix

    j-riebe committed Apr 19, 2022
    Configuration menu
    Copy the full SHA
    507d29a View commit details
    Browse the repository at this point in the history

Commits on May 18, 2022

  1. fixed test relative import

    jhnnsrs committed May 18, 2022
    Configuration menu
    Copy the full SHA
    21e6208 View commit details
    Browse the repository at this point in the history