Skip to content

Inconsistent access to QgsProject.instance() #32

Description

@yan-sln

Observation: Some modules receive their QGIS dependencies as parameters (e.g. ui/service.py::run(selected_layer_id, feedback)), while others call QgsProject.instance() directly (utils/layers.py, intersection_context.py, intersection_processing.py, template_loader.py, and the PDF services). Both approaches coexist without an explicit guideline.

Impact: Limited in practice (this is documented as a deliberate architectural choice rather than an oversight-see core/AGENT.md), but a new contributor might reasonably expect systematic dependency injection and be surprised by the direct calls.

Future direction: If a more comprehensive testing/mocking layer is introduced, standardize on explicit injection of the QGIS project wherever it is practical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions