Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
van-de-bugger opened this issue Oct 21, 2022 · 2 comments

Comments

@van-de-bugger
Copy link

$ 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.

@ximion ximion changed the title description-first-word-not-capitalized if the first character is not a letter description-first-word-not-capitalized if the first character is hyphenation Oct 21, 2022
@ximion
Copy link
Owner

ximion commented Oct 21, 2022

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 ;-)

@van-de-bugger
Copy link
Author

van-de-bugger commented Oct 22, 2022

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>

ximion added a commit that referenced this issue Dec 22, 2022
This partially addresses #439

Sometimes for release descriptions, it is okay to start with
punctuation, e.g. for flag names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants