[importlinter] root_packages = icom_lan # Contract 1: Top-level layer ordering for the SUBPACKAGES that genuinely exist. # import-linter "layers" contract: items earlier in the list cannot import from items later in the list. # Per import-linter docs, by default each layer cannot import from any later layer; "containers" tells it where to look for these names. # This contract ONLY exercises the proposed rules over real subpackages (audio, backends, commands, dsp, rigctld, web). # It cannot capture top-level files (those need separate forbidden contracts, see below). [importlinter:contract:layered-subpackages] name = Layered subpackages (audio/backends/commands/dsp/rigctld/web) type = layers containers = icom_lan layers = cli web | rigctld audio | scope | dsp commands backends exhaustive = false # Contract 2: dsp must not import anything internal (it's pure DSP) [importlinter:contract:dsp-pure] name = dsp is pure (no internal icom_lan imports) type = forbidden source_modules = icom_lan.dsp forbidden_modules = icom_lan.audio icom_lan.backends icom_lan.commands icom_lan.rigctld icom_lan.web icom_lan.commander icom_lan.command_map icom_lan.command_spec icom_lan.civ icom_lan.protocol icom_lan.transport icom_lan.radio icom_lan.radio_protocol icom_lan.radio_state icom_lan.radio_state_snapshot icom_lan.profiles icom_lan.profiles_runtime # Contract 3: backends must not import runtime / web / rigctld / cli [importlinter:contract:backends-low] name = backends does not depend on runtime/web/rigctld/cli type = forbidden source_modules = icom_lan.backends forbidden_modules = icom_lan.web icom_lan.rigctld icom_lan.cli icom_lan.radio icom_lan.radio_protocol icom_lan.commander icom_lan.audio_bridge icom_lan.audio_bus icom_lan.audio_analyzer icom_lan.audio_fft_scope icom_lan.scope icom_lan.scope_render icom_lan._audio_runtime_mixin icom_lan._dual_rx_runtime icom_lan._scope_runtime icom_lan._shared_state_runtime icom_lan._state_cache icom_lan._state_queries # Contract 4: web must not import backends or cli (web is consumer of runtime, not producer) [importlinter:contract:web-no-backends] name = web does not depend on backends or cli type = forbidden source_modules = icom_lan.web forbidden_modules = icom_lan.backends icom_lan.cli # Contract 5: rigctld must not import web/audio/scope/cli [importlinter:contract:rigctld-narrow] name = rigctld does not depend on web/audio/scope/cli/backends type = forbidden source_modules = icom_lan.rigctld forbidden_modules = icom_lan.web icom_lan.cli icom_lan.audio icom_lan.audio_bridge icom_lan.audio_bus icom_lan.scope icom_lan.scope_render icom_lan.backends # Contract 6: commands must not import runtime / web / rigctld / cli / audio [importlinter:contract:commands-low] name = commands does not depend on runtime/web/rigctld/cli/audio type = forbidden source_modules = icom_lan.commands forbidden_modules = icom_lan.web icom_lan.rigctld icom_lan.cli icom_lan.radio icom_lan.radio_protocol icom_lan.commander icom_lan.audio icom_lan.audio_bridge icom_lan.audio_bus icom_lan.audio_analyzer icom_lan.audio_fft_scope icom_lan.scope icom_lan.scope_render icom_lan.backends # Contract 7: audio subpackage must not import runtime/web/rigctld/cli/commands/backends [importlinter:contract:audio-pure] name = audio subpackage does not depend on runtime/web/rigctld/cli/commands/backends type = forbidden source_modules = icom_lan.audio forbidden_modules = icom_lan.web icom_lan.rigctld icom_lan.cli icom_lan.radio icom_lan.radio_protocol icom_lan.commander icom_lan.commands icom_lan.backends icom_lan.scope icom_lan.scope_render # Contract 8: independence of rigctld and web (neither imports the other) [importlinter:contract:rigctld-web-independence] name = rigctld and web do not import each other type = independence modules = icom_lan.rigctld icom_lan.web