Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Mar 17, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

This pull request introduces a new system for handling flags in the liblcf library. It introduces new templates and generated files to manage flags more efficiently, and updates the build system to include these new files.

Enhancements:

  • Implements a new flag handling system to improve the management of flags within the liblcf library. This includes the introduction of new templates for flag generation and updates to the build system to incorporate these changes.
  • Updates the code generation process to create separate header files for each flag field, improving modularity and organization.
  • Adds new Jinja2 filters and tests to enhance the code generation process, including filters for flag types, sizes, and sets, as well as tests for monotonic enums and scoped enums.
  • Updates the build system (CMakeLists.txt and Makefile.am) to include the new generated flag files.
  • Removes unused includes and template instantiations from reader_flags.cpp and reader_struct.h, streamlining the codebase and reducing dependencies.
  • Moves flag-related code from the main structure headers to separate flag-specific headers, improving code organization and reducing header file size.
  • Updates the code generation process to create separate header files for each flag field, improving modularity and organization.
  • Adds new Jinja2 filters and tests to enhance the code generation process, including filters for flag types, sizes, and sets, as well as tests for monotonic enums and scoped enums.
  • Updates the build system (CMakeLists.txt and Makefile.am) to include the new generated flag files.
  • Removes unused includes and template instantiations from reader_flags.cpp and reader_struct.h, streamlining the codebase and reducing dependencies.
  • Moves flag-related code from the main structure headers to separate flag-specific headers, improving code organization and reducing header file size.

Ghabry and others added 16 commits February 12, 2025 12:41
This was hardcoded to one Flag per struct.
The generator is now smarter and you can specify multiple flags which are resolved by their flag name.
…ify which enum names are considered to be "scoped" ('class' enums in C++)
… determine if an event has been created by EasyRPGs new "CloneMapEvent" command
…preter related SaveState structures (SaveEventExecState, SaveEventExecFrame & SaveMapEventBase)

Co-Authored-By: florianessl <[email protected]>
Use only "Flags" when struct = flagname as we originally did.
Flags: Do not hardcode one Flag field per class
@pull pull bot added the ⤵️ pull label Mar 17, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 17, 2025

Reviewer's Guide by Sourcery

This pull request introduces a new flag system that generates separate header files for each flag type, along with forward declarations and instantiations. This change aims to improve code organization and maintainability. The build system files have been updated to include the new flag-related files, and the flag generation logic has been modified to handle cases where the struct name is the same as the flag name. Manual instantiations of Flags templates have been removed.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Introduces a new system for handling flags in the liblcf library. This involves generating separate header files for each flag type, along with forward declarations and instantiation.
  • Added flag_type filter to generator to handle flag naming.
  • Modified the generator to create separate header files for flags.
  • Created new templates for flag forward declarations and instantiations.
  • Modified CMakeLists.txt and Makefile.am to include the new flag-related files.
  • Removed manual flag instantiations in reader_flags.cpp and reader_struct.h.
  • Added includes for generated flag headers in reader_flags.cpp and reader_struct.h.
generator/generate.py
src/reader_flags.cpp
src/reader_struct.h
CMakeLists.txt
Makefile.am
builds/sources2buildsystem.pl
generator/templates/flag_reader.tmpl
generator/templates/flag_fwd.tmpl
generator/templates/flag_instance.tmpl
src/generated/fwd_flags_impl.h
src/generated/fwd_flags_instance.h
Updates the build system files (CMakeLists.txt and Makefile.am) to include the newly generated flag files.
  • Added new generated flag files to the LCF_SOURCES variable in CMakeLists.txt.
  • Added new generated flag files to the liblcf_la_SOURCES variable in Makefile.am.
  • Modified the regex in builds/sources2buildsystem.pl to include fwd_.*.h files.
CMakeLists.txt
Makefile.am
builds/sources2buildsystem.pl
Modifies the flag generation logic to handle cases where the struct name is the same as the flag name.
  • The flag_type filter in generator/generate.py now handles cases where the struct name is the same as the flag name, emitting only "Flags" in such cases.
generator/generate.py
Removes manual instantiations of Flags templates for specific types.
  • Removed explicit template instantiations for various flag types in src/reader_flags.cpp.
  • Removed explicit template specializations for various flag types in src/reader_struct.h.
src/reader_flags.cpp
src/reader_struct.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@pull pull bot merged commit d182256 into CartoonFan:master Mar 17, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants