← Back to issue list

Format partition warnings and errors inside the error class

View original Github issue

Metadata

Project
craft-parts
Number
#670
Type
issue
State
open
Author
mr-cal
Labels
Created
2024-02-22 13:37:26+00:00
Updated
2025-03-11 14:29:03+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### What needs to get done Partition-related warnings are collated and presented as a nested list: ``` Possible misuse of partitions The following entries begin with a valid partition name but are not wrapped in parentheses. These entries will go into the default partition. parts.hello.organize misused partition 'default' in 'default/A1' misused partition 'kernel' in 'kernel/B' parts.hello.stage misused partition 'default' in 'default/' Wrap the partition name in parentheses, for example 'default/file' should be written as '(default)/file' ``` And the same for errors: ``` Invalid usage of partitions parts.hello.stage unknown partition 'bogus' in '(bogus)/C' no path specified after partition in '(kernel)' parts.hello.prime unknown partition 'extra/bogus' in '(extra/bogus)/C' no path specified after partition in '(kernel)/' Valid partitions: default, kernel, component/bar-baz Correct the invalid partition name(s) and try again. ``` Currently, the code that raises warnings and errors pass a list of indented strings to the error. Instead, the code should pass an unformatted data structure to the error. The error will handle the indenting. ### Why it needs to get done To reduce technical debt and improve code quality.

Evaluation history

No evaluation history available.