Skip to content

Extract duplicated dotnet initialization into helper function #84

@mircealungu

Description

@mircealungu

From review of PR #81.

The dotnet initialization block is copy-pasted identically in 4 places (render, render_json, render_diff, render_diff_json) in src/python/src/cli_interface.py:

from pythonnet import load
load("coreclr")
import clr
clr.AddReference(os.path.join(os.path.dirname(__file__), '.dotnet', 'Microsoft.CodeAnalysis.dll'))
clr.AddReference(os.path.join(os.path.dirname(__file__), '.dotnet', 'Archlens.dll'))
from Archlens.CLI import Program

Should be extracted into a helper like _init_dotnet() that returns Program.

Similarly, the plantuml rendering block (calling os.system with python -m plantuml) is duplicated in render and render_diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions