Skip to content

Remove dead code - #412

Merged
christophfroehlich merged 3 commits into
mainfrom
cleanup/dead-code
Nov 15, 2026
Merged

christophfroehlich merged 3 commits into
mainfrom
cleanup/dead-code

Conversation

@christophfroehlich

@christophfroehlich christophfroehlich commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Removes code that can never run or has no effect, 46 lines net. Nothing changes for users. The generated C++, Python, markdown and rst are identical.

One commit per topic:

  1. Conversions.
    • Each conversion module had five unused imports.
    • In Python, the five *_fixed_to_str functions were copies of the non-fixed ones, so the table now points at those. bool_array_fixed stays; Support bool_array_fixed_XX parameters #414 implements it.
  2. Parser and validators.
    • The second or language == 'markdown' branch in GenerateCode.__init__ was unreachable.
    • self.name was set twice.
    • raise NotImplemented() would itself fail with TypeError, so it is now NotImplementedError.
    • An unused variable in not_empty is removed.
  3. CMake.
    • ${LOCAL_PARAM_HEADER_FILE}, and ${VALIDATE_HEADER} in generate_parameter_module(), are never set.
    • generate_parameter_module() set C++ include directories on a target that only holds a Python module.

I built and tested all four example packages, checked that the module of example_cmake_python is still installed and importable, and compared the generated output for every definition in the repository before and after.

No backport-humble label, since this does not fix anything.

🤖 Generated with Claude Code

christophfroehlich and others added 3 commits November 15, 2026 07:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…functions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the dead-code and CMake cleanup.

No open issues 🎉

What changed in this PR

Removes dead and redundant code from the parameter generator and its CMake integration, with no intended changes to generated output or user-facing behavior.

Changes:

  • Removes unused imports and reuses existing Python conversion functions for fixed-size types.
  • Simplifies parser and validator code and corrects abstract-method exceptions to NotImplementedError.
  • Removes unused CMake variable references and C++ include settings from the Python-module target.
File Description
generate_parameter_library/​cmake/​generate_parameter_library.cmake Removes unused target inputs, dependencies, and Python-target include settings.
generate_parameter_library_py/​generate_parameter_library_py/​python_validators.py Removes an unused local variable.
generate_parameter_library_py/​generate_parameter_library_py/​python_conversions.py Removes unused imports and duplicate fixed-size conversion methods.
generate_parameter_library_py/​generate_parameter_library_py/​parse_yaml.py Removes redundant assignment and branching; corrects abstract-method exceptions.
generate_parameter_library_py/​generate_parameter_library_py/​cpp_conversions.py Removes unused imports.

Review effort: Balanced

@christophfroehlich
christophfroehlich merged commit cb9887d into main Nov 15, 2026
20 of 21 checks passed
@christophfroehlich
christophfroehlich deleted the cleanup/dead-code branch November 15, 2026 20:13
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