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

Run qmllint on all examples #88

Open
mitchcurtis opened this issue Sep 17, 2021 · 4 comments
Open

Run qmllint on all examples #88

mitchcurtis opened this issue Sep 17, 2021 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mitchcurtis
Copy link
Contributor

This is a good way to check for any issues in the code.

@mitchcurtis
Copy link
Contributor Author

mitchcurtis commented Sep 17, 2021

I mentioned this because I see some code that might fail qmllint's checks:

import QtQuick
import QtQuick.Controls
import Qt.labs.platform as NativeDialogs

ApplicationWindow {
    id: root

    // ...

    menuBar: MenuBar {
        Menu {
            title: qsTr("&File")
            MenuItem {
                text: qsTr("&New")
                icon.name: "document-new"
                onTriggered: root.newDocument()
            }
            MenuSeparator {}
            MenuItem {
                text: qsTr("&Open")
                icon.name: "document-open"
                onTriggered: openDocument()
            }
            MenuItem {
                text: qsTr("&Save")
                icon.name: "document-save"
                onTriggered: saveDocument()
            }
            MenuItem {
                text: qsTr("Save &As...")
                icon.name: "document-save-as"
                onTriggered: saveAsDocument()
            }
        }
    }

    // ...

}

The root.newDocument() call looks correct, but the other onTriggered handlers are missing the "root" qualification. There might be more cases like this, so it's best to automate it.

@e8johan
Copy link
Member

e8johan commented Sep 24, 2021

I added a yarn command for it, i.e. yarnpgk run examples:lint . There are a few pages of things to fix...

@Inkane Inkane added this to the Impact milestone Sep 30, 2021
@e8johan
Copy link
Member

e8johan commented Oct 6, 2021

I will keep this bug open while addressing the qmllint issues.

When doing so, I will work on converting quoted code into imported code snippets. See https://vuepress.vuejs.org/guide/markdown.html#import-code-snippets to avoid having to fix the code in two places.

@e8johan e8johan added the bug Something isn't working label Oct 6, 2021
@LorenDB
Copy link
Contributor

LorenDB commented Feb 27, 2022

Any progress on this? I think it's a really good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants