← Back to issue list

Can't ignore source-code metatada key in linter configuration

View original Github issue

Metadata

Project
snapcraft
Number
#5794
Type
issue
State
closed
Author
mbeijen
Labels
—
Created
Updated
Closed

Current evaluation

Fixed in merged PR #5795 (commit 11898bc89), correcting metadata linter ignores for the hyphenated source-code key; the fix shipped in 8.12.1.

Resolution: closed resolved

Reason: PR #5795 was merged as commit 11898bc89 and added coverage confirming that source-code can be ignored. The maintainer stated the fix was expected in the 8.12.1 release.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description With the new metadata linter that was added in #5610 and deployed with the 8.12.0 release, we now get warnings on missing metadatata keys in our `snapcraft.yaml`. As part of this feature, you can specify ignores for the linter. As my company is using snaps for in house deployment on our IoT fleet, most keys do not make sense for us so I added them to the ignore configuration. This works for all keys but the `source-code` key! ### To Reproduce If I specify this in `snapcraft.yaml`: ```yaml lint: ignore: - metadata: - source-code ``` I would expect it to suppress warnings on missing the `source-code` key. But this does not work **I found it _does_ work to specify the key as `source_code`, with underscore instead of hyphen**, which is unexpected. ### Environment Ubuntu 24.04 LTS, snapcraft 8.12.0 ### snapcraft.yaml ```yaml name: snapps base: core24 version: '0.1' summary: Single-line elevator pitch for your amazing snap # 79 char long summary description: your description wants to look good in the snap store. grade: stable confinement: devmode parts: my-part: plugin: nil lint: ignore: - metadata: - contact - donation - title - issues - source-code - website - license ``` ### Relevant log output ```shell $ snapcraft pack Lint information: - metadata: Metadata field 'source-code' is missing or empty. (https://documentation.ubuntu.com/snapcraft/stable/reference/project-file/snapcraft-yaml/#source-code) Packed snapps_0.1_amd64.snap ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed in merged PR #5795 (commit 11898bc89), correcting metadata linter ignores for the hyphenated source-code key; the fix shipped in 8.12.1.
stealth/space-bunny-alpha — closed resolved Fixed the metadata linter so hyphenated `source-code` keys can be ignored, rather than requiring `source_code`. Resolved by PR #5795 (commit 11898bc89).
qwen/qwen3.6-35b-a3b — — The metadata linter ignore configuration incorrectly rejected the hyphenated source-code key. A fix was identified and will be included in the snapcraft 8.12.1 release.
qwen/qwen3.6-35b-a3b — — Fixed the linter configuration bug that prevented ignoring the source-code metadata key. The resolution will be included in the snapcraft 8.12.1 release.
qwen/qwen3.6-35b-a3b — — Resolved a metadata linter bug where ignoring the hyphenated source-code key failed. The fix corrected the configuration key matching logic and was included in the snapcraft 8.12.1 release.
qwen3.6-35b-a3b-mtp-q6 — — The linter ignore configuration failed to suppress warnings for the hyphenated source-code key. A fix was identified and will be included in the 8.12.1 release. The issue is closed.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: snapcraft#5795 (confidence 100%)

    Merged fix that changed metadata linter handling so the source-code field is ignored correctly.

Related issues

Issue Project State Summary Similarity
#5795 fix: properly ignore source-code field in metadata linter snapcraft merged Merged PR #5795 as commit 11898bc89, fixing #5794 so the hyphenated source-code metadata field is ignored by the linter; shipped in Snapcraft 8.13.0.
79%