Skip to content

Add linter support for optional if statements #159

@nuwang

Description

@nuwang

We have a use case where a rule should be overridden without having to respecify the if condition. Currently, the absence of the if condition will trigger a lint failure because the if field is mandatory in the pydantic schema:

destinations:
  _pulsar_destination:
    rules:
      - id: pulsar_destination_docker_rule
        if: entity.params.get('docker_enabled')
        params:
            docker_set_user: '1000'
  pulsar-azure-gpu:
    inherits: _pulsar_destination
    rules:
      - id: pulsar_destination_docker_rule
        # the if condition is inherited here, so linter should not warn
        params:
            docker_volumes: $job_directory:ro,$tool_directory:ro,$job_directory/outputs:rw,$working_directory:rw,/data/alphafold_databases:/data:ro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions