appstream icon indicating copy to clipboard operation
appstream copied to clipboard

description-first-word-not-capitalized if the first character is hyphenation

Open van-de-bugger opened this issue 3 years ago • 2 comments

$ appstreamcli --version
AppStream version: 0.15.5

$ cat lorem.metainfo.xml 
<?xml version="1.0" encoding="UTF-8"?>
<component>
    <id>io.sourceforge.lorem</id>
    <name>Lorem</name>
    <summary>Lorem Ipsum</summary>
    <project_license>GPL-3.0-or-later</project_license>
    <metadata_license>FSFAP</metadata_license>
    <description>
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua.
        </p>
    </description>
    <releases>
        <release date="2022-10-01" version="0.1.0">
            <description>
                <p>
                    <code>--syslog</code> command line option is introduced.
                </p>
            </description>
        </release>
    </releases>
</component>

$ appstreamcli validate lorem.metainfo.xml 
I: io.sourceforge.lorem:16: description-first-word-not-capitalized

✔ Validation was successful: infos: 1

appstreamcli complains description-first-word-not-capitalized, while the first word of the description is --syslog, it can't be capitalized. appstreamcli should not complain if the first character of the description is not a letter.

van-de-bugger avatar Oct 21 '22 22:10 van-de-bugger

Looks like we do allow digits just fine, but if the first character is a dash, dot or any other such thing this hint is generated. Starting the main description with punctuation feels like a bad idea, but allowing it for release notes is probably fine (in any case, we should have a better error message in case this wasn't okay). Workaround for now: Just throw in a The in front of the --syslog text ;-)

ximion avatar Oct 21 '22 22:10 ximion

Also note, that error message remains the same if the problem paragraph is not the first one, e. g.:

$ cat lorem.metainfo.xml 
<?xml version="1.0" encoding="UTF-8"?>
<component>
    <id>io.sourceforge.lorem</id>
    <name>Lorem</name>
    <summary>Lorem Ipsum</summary>
    <project_license>GPL-3.0-or-later</project_license>
    <metadata_license>FSFAP</metadata_license>
    <description>
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua.
        </p>
    </description>
    <releases>
        <release date="2020-05-06" version="0.4.4">
            <description> <!--line 16 -->
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
                    incididunt ut labore et dolore magna aliqua.
                </p>
                <p> <!-- line 21 -->
                    <code>--syslog</code> command line option is introduced.
                </p>
            </description>
        </release>
    </releases>
</component>

$ appstreamcli validate lorem.metainfo.xml 
I: io.sourceforge.lorem:16: description-first-word-not-capitalized

✔ Validation was successful: infos: 1

appstreamcli blames the line 16, that line contains <description> tag. The error message is misleading, since the first word of the description is capitalized. It would be nice if appstreamcli blames the line 21, not 16.

Workaround for now: Just throw in a The in front of the --syslog text ;-)

Good catch, thanks. But appstreamcli also blames on other funny characters, e. g.:

<description>
    <p>
        ❗ The <code>--syslog</code> command line option is introduced.
    </p>
</description>

or

<description>
    <p>
        ✔ The bug CVE1000000 fixed.
    </p>
</description>

van-de-bugger avatar Oct 22 '22 20:10 van-de-bugger